Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-fc.h
blob5f21b620cf2171d45df52ff80386ef367a21434b
1 /* packet-fc.h
2 * Basic Fibre Channel Header definitions
3 * Copyright 2002 Dinesh G Dutt (ddutt@cisco.com)
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __PACKET_FC_H_
13 #define __PACKET_FC_H_
15 #include <epan/conversation.h>
16 #include <epan/etypes.h>
17 #include "ws_symbol_export.h"
19 /* R_CTL upper bits creates a classification tree */
20 #define FC_RCTL_DEV_DATA 0x00
21 #define FC_RCTL_ELS 0x20
22 #define FC_RCTL_LINK_DATA 0x30
23 #define FC_RCTL_VIDEO 0x40
24 #define FC_RCTL_BLS 0x80
25 #define FC_RCTL_LINK_CTL 0xC0
26 /* XXX - is 0xF0 Extended Routing? It is in the FC-FS draft on the T11
27 Web site. */
29 #define FC_TYPE_CMNSVC 0x0 /* Used in PRLI Svc Param Page */
31 /* TYPE definitions for Basic or Extended Link_Data */
32 #define FC_TYPE_BLS 0x0
33 #define FC_TYPE_ELS 0x1
35 /* TYPE definitions for FC-4 */
36 #define FC_TYPE_LLCSNAP 0x4
37 #define FC_TYPE_IP 0x5
38 #define FC_TYPE_SCSI 0x8
39 #define FC_TYPE_SB_TO_CU 0x1B
40 #define FC_TYPE_SB_FROM_CU 0x1C
41 #define FC_TYPE_FCCT 0x20
42 #define FC_TYPE_SWILS 0x22
43 #define FC_TYPE_AL 0x23
44 #define FC_TYPE_SNMP 0x24
45 #define FC_TYPE_VENDOR 0xFF
49 * the following allows TAP code access to the messages
50 * without having to duplicate it. With MSVC and a
51 * libwireshark.dll, we need a special declaration.
53 WS_DLL_PUBLIC const value_string fc_fc4_val[];
55 /* DF_CTL bits */
56 #define FC_DFCTL_DH 0x03 /* Device_Header type bits: */
57 #define FC_DFCTL_DH_NONE 0x00 /* No Device_Header */
58 #define FC_DFCTL_DH_16_BYTE 0x01 /* 16 Byte Device_Header */
59 #define FC_DFCTL_DH_32_BYTE 0x02 /* 32 Byte Device_Header */
60 #define FC_DFCTL_DH_64_BYTE 0x03 /* 64 Byte Device_Header */
61 #define FC_DFCTL_AH 0x10 /* Association_Header bit */
62 #define FC_DFCTL_NH 0x20 /* Association_Header bit */
63 #define FC_DFCTL_SH 0x40 /* reserved for security header */
65 /* Derived Frame types (used for ULP demux) */
66 #define FC_FTYPE_UNDEF 0x0
67 #define FC_FTYPE_SWILS 0x1
68 #define FC_FTYPE_IP 0x2
69 #define FC_FTYPE_SCSI 0x3
70 #define FC_FTYPE_BLS 0x4
71 #define FC_FTYPE_ELS 0x5
72 #define FC_FTYPE_FCCT 0x7
73 #define FC_FTYPE_LINKDATA 0x8
74 #define FC_FTYPE_VDO 0x9
75 #define FC_FTYPE_LINKCTL 0xA
76 #define FC_FTYPE_SWILS_RSP 0xB
77 #define FC_FTYPE_SBCCS 0xC
78 #define FC_FTYPE_OHMS 0xD
80 /* Well-known Address Definitions (in Network order) */
81 #define FC_WKA_MULTICAST 0xFFFFF5
82 #define FC_WKA_CLKSYNC 0xFFFFF6
83 #define FC_WKA_KEYDIST 0xFFFFF7
84 #define FC_WKA_ALIAS 0xFFFFF8
85 #define FC_WKA_QOSF 0xFFFFF9
86 #define FC_WKA_MGMT 0xFFFFFA
87 #define FC_WKA_TIME 0xFFFFFB
88 #define FC_WKA_DNS 0xFFFFFC
89 #define FC_WKA_FABRIC_CTRLR 0xFFFFFD
90 #define FC_WKA_FPORT 0xFFFFFE
91 #define FC_WKA_BCAST 0xFFFFFF
93 /* Well-known Address Definitions (in little endian) */
95 /* Information Categories for Link Data & Link Control Frames */
96 #define FC_IU_UNCATEGORIZED 0x0
97 #define FC_IU_SOLICITED_DATA 0x1
98 #define FC_IU_UNSOLICITED_CTL 0x2
99 #define FC_IU_SOLICITED_CTL 0x3
100 #define FC_IU_UNSOLICITED_DATA 0x4
101 #define FC_IU_DATA_DESCRIPTOR 0x5
102 #define FC_IU_UNSOLICITED_CMD 0x6
103 #define FC_IU_CMD_STATUS 0x7
105 /* FC_CTL bits */
106 #define FC_FCTL_EXCHANGE_RESPONDER 0x800000
107 #define FC_FCTL_SEQ_RECIPIENT 0x400000
108 #define FC_FCTL_EXCHANGE_FIRST 0x200000
109 #define FC_FCTL_EXCHANGE_LAST 0x100000
110 #define FC_FCTL_SEQ_LAST 0x080000
111 #define FC_FCTL_PRIORITY 0x020000
112 #define FC_FCTL_TRANSFER_SEQ_INITIATIVE 0x010000
113 #define FC_FCTL_LAST_DATA_FRAME_MASK 0x00c000
114 #define FC_FCTL_ACK_0_1_MASK 0x003000
115 #define FC_FCTL_REXMITTED_SEQ 0x000200
116 #define FC_FCTL_ABTS_MASK 0x000030
117 #define FC_FCTL_REL_OFFSET 0x000008
120 typedef struct _fc_exchange_t {
121 uint32_t first_exchange_frame;
122 uint32_t last_exchange_frame;
123 nstime_t fc_time;
124 } fc_exchange_t;
126 /* FC header structure */
127 typedef struct _fc_hdr {
128 address s_id;
129 address d_id;
130 uint32_t fctl;
131 uint8_t type;
132 uint16_t seqcnt;
133 uint16_t oxid;
134 uint16_t rxid;
135 uint8_t r_ctl;
136 uint8_t cs_ctl;
137 uint16_t lun;
138 fc_exchange_t* fc_ex;
139 uint32_t relative_offset;
140 } fc_hdr;
142 #define FC_DATA_SOF_FIRST_FRAME 0x1
143 #define FC_DATA_SOF_SOFF 0x2
144 #define FC_DATA_EOF_LAST_FRAME 0x80
145 #define FC_DATA_EOF_INVALID 0x40
147 /* Data structure to pass into FC dissector */
148 typedef struct _fc_data {
149 unsigned ethertype;
150 uint8_t sof_eof; /**< FC's SOF/EOF encoding passed to FC decoder
151 * Bit 7 set if Last frame in sequence
152 * Bit 6 set if invalid frame content
153 * Bit 2 set if SOFf
154 * Bit 1 set if first frame in sequence
156 } fc_data_t;
158 #endif /* __PACKET_FC_H_ */