Include <string.h> to get "strcmp()" declared.
[obnox/wireshark/wip.git] / packet-fcswils.h
1 /* packet-fcswils.h
2  * Fibre Channel Switch InterLink Services Definitions
3  * Copyright 2001 Dinesh G Dutt (ddutt@cisco.com)
4  *
5  * $Id: packet-fcswils.h,v 1.2 2003/06/30 21:50:18 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  * 
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  * 
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifndef __PACKET_FCSWILS_H_
27 #define __PACKET_FCSWILS_H_
28
29 /* Command codes */
30 #define FC_SWILS_SWRJT          0x01
31 #define FC_SWILS_SWACC          0x02
32 #define FC_SWILS_ELP            0x10
33 #define FC_SWILS_EFP            0x11
34 #define FC_SWILS_DIA            0x12
35 #define FC_SWILS_RDI            0x13
36 #define FC_SWILS_HLO            0x14
37 #define FC_SWILS_LSU            0x15
38 #define FC_SWILS_LSA            0x16
39 #define FC_SWILS_BF             0x17
40 #define FC_SWILS_RCF            0x18
41 #define FC_SWILS_RSCN           0x1B
42 #define FC_SWILS_DRLIR          0x1E
43 #define FC_SWILS_DSCN           0x20
44 #define FC_SWILS_LOOPD          0x21
45 #define FC_SWILS_MR             0x22
46 #define FC_SWILS_ACA            0x23
47 #define FC_SWILS_RCA            0x24
48 #define FC_SWILS_SFC            0x25
49 #define FC_SWILS_UFC            0x26
50 #define FC_SWILS_ESC            0x30
51
52 /* Reject reason codes */
53
54 #define FC_SWILS_RJT_INVCODE       0x01
55 #define FC_SWILS_RJT_INVVER        0x02
56 #define FC_SWILS_RJT_LOGERR        0x03
57 #define FC_SWILS_RJT_INVSIZE       0x04
58 #define FC_SWILS_RJT_LOGBSY        0x05
59 #define FC_SWILS_RJT_PROTERR       0x07
60 #define FC_SWILS_RJT_GENFAIL       0x09
61 #define FC_SWILS_RJT_CMDNOTSUPP    0x0B
62 #define FC_SWILS_RJT_VENDUNIQ      0xFF
63
64 /* Detailed reason code defines */
65 #define FC_SWILS_RJT_NODET         0x0
66 #define FC_SWILS_RJT_CLSF_ERR      0x1
67 #define FC_SWILS_RJT_CLSN_ERR      0x3
68 #define FC_SWILS_RJT_INVFC_CODE    0x4
69 #define FC_SWILS_RJT_INVFC_PARM    0x5
70 #define FC_SWILS_RJT_INV_PNAME     0xD
71 #define FC_SWILS_RJT_INV_SNAME     0xE
72 #define FC_SWILS_RJT_TOV_MSMTCH    0xF
73 #define FC_SWILS_RJT_INV_DIDLST    0x10
74 #define FC_SWILS_RJT_CMD_INPROG    0x19
75 #define FC_SWILS_RJT_OORSRC        0x29
76 #define FC_SWILS_RJT_NO_DID        0x2A
77 #define FC_SWILS_RJT_INV_DID       0x2B
78 #define FC_SWILS_RJT_NO_REQ        0x2C
79 #define FC_SWILS_RJT_NOLNK_PARM    0x2D
80 #define FC_SWILS_RJT_NO_REQDID     0x2E
81 #define FC_SWILS_RJT_EP_ISOL       0x2F
82
83 typedef struct _fcswils_elp {
84     guint8 revision;
85     guint8 flags[2];
86     guint8 rsvd1;
87     guint32 r_a_tov;
88     guint32 e_d_tov;
89     guint8  req_epname[8];
90     guint8  req_sname[8];
91     guint8  clsf_svcparm[6];
92     guint16 clsf_rcvsize;
93     guint16 clsf_conseq;
94     guint16 clsf_e2e;
95     guint16 clsf_openseq;
96     guint16 rsvd;
97     guint8  cls1_svcparm[2];
98     guint16 cls1_rcvsize;
99     guint8  cls2_svcparm[2];
100     guint16 cls2_rcvsize;
101     guint8  cls3_svcparm[2];
102     guint16 cls3_rcvsize;
103     guint8  rsvd2[20];
104     guint16 isl_flwctrl_mode;
105     guint16 flw_ctrl_parmlen;
106     guint32 b2b_credit;
107     guint32 compat_p1;
108     guint32 compat_p2;
109     guint32 compat_p3;
110     guint32 compat_p4;
111 } fcswils_elp;
112 #define FC_SWILS_ELP_SIZE 100
113
114 #define FC_SWILS_ELP_FC_VENDOR   0x1
115 #define FC_SWILS_ELP_FC_RRDY     0x2
116
117 struct _fcswils_efp_didrec {
118     guint8 rec_type;
119     guint8 dom_id;
120     guint16 rsvd1;
121     guint32 rsvd2;
122     guint8  sname[8];
123 };
124 struct _fcswils_efp_mcastrec {
125     guint8 rec_type;
126     guint8 mcast_grpnum;
127     guint8 rsvd[14];
128 };
129
130 typedef union _fcswils_efp_listrec {
131     struct _fcswils_efp_didrec didrec;
132     struct _fcswils_efp_mcastrec mcastrec;
133 } fcswils_efp_listrec;
134
135 #define FC_SWILS_LRECTYPE_DOMAIN 0x1
136 #define FC_SWILS_LRECTYPE_MCAST  0x2
137
138 typedef struct _fcswils_efp {
139     guint8  opcode;
140     guint8  reclen;
141     guint16 payload_len;
142     guint8  rsvd1[3];
143     guint8  pswitch_prio;
144     guint8  pswitch_name[8];
145     fcswils_efp_listrec *listrec;
146 } fcswils_efp;
147 #define FC_SWILS_EFP_SIZE 16    /* not including listrec */
148
149 typedef struct _fcswils_dia {
150     guint8 switch_name[8];
151     guint8 rsvd[4];
152 } fcswils_dia;
153
154 typedef struct _fcswils_rdi_req {
155     guint8 rsvd[3];
156     guint8 domain_id;
157 } fcswils_rdi_req;
158 #define FC_SWILS_RDIREQ_SIZE 4
159
160 #define FC_SWILS_LSR_SLR    0x1 /* switch link record */
161 #define FC_SWILS_LSR_ARS    0x2 /* AR Summary record */
162
163 #define FC_SWILS_PDESC_FSPF_BB 0x01
164 #define FC_SWILS_PDESC_FSPF    0x02
165
166 #define FC_SWILS_ZONEOBJ_ZONESET    1
167 #define FC_SWILS_ZONEOBJ_ZONE       2
168 #define FC_SWILS_ZONEOBJ_ZONEALIAS  3
169
170 #define FC_SWILS_ZONEMBR_WWN             1
171 #define FC_SWILS_ZONEMBR_DP              2
172 #define FC_SWILS_ZONEMBR_FCID            3
173 #define FC_SWILS_ZONEMBR_ALIAS           4
174 #define FC_SWILS_ZONEMBR_WWN_LUN         0xE1
175 #define FC_SWILS_ZONEMBR_DP_LUN          0xE2
176 #define FC_SWILS_ZONEMBR_FCID_LUN        0xE3
177
178 extern const value_string fc_swils_zonembr_type_val[];
179
180 #endif