Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-infiniband.c
blob836d8e501468ccbadf0e44efa179e439c89192b2
1 /* packet-infiniband.c
2 * Routines for Infiniband/ERF Dissection
3 * Copyright 2008 Endace Technology Limited
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * Modified 2010 by Mellanox Technologies Ltd.
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "config.h"
16 #include <epan/packet.h>
17 #include <epan/exceptions.h>
18 #include <epan/conversation.h>
19 #include <epan/prefs.h>
20 #include <epan/etypes.h>
21 #include <epan/show_exception.h>
22 #include <epan/decode_as.h>
23 #include <wiretap/erf_record.h>
24 #include <wiretap/wtap.h>
26 #include "packet-infiniband.h"
28 void proto_register_infiniband(void);
29 void proto_reg_handoff_infiniband(void);
31 /*Default RRoce UDP port*/
32 #define DEFAULT_RROCE_UDP_PORT 4791
34 /* service id prefix 0x0000000001 is designated for
35 * RDMA IP CM service as per Annex A11.2
37 #define RDMA_IP_CM_SID_PREFIX_MASK 0xFFFFFFFFFF000000
38 #define RDMA_IP_CM_SID_PREFIX 0x0000000001000000
40 /* Wireshark ID */
41 static int proto_infiniband;
42 static int proto_infiniband_link;
44 /* Variables to hold expansion values between packets */
45 /* static int ett_infiniband; */
46 static int ett_all_headers;
47 static int ett_lrh;
48 static int ett_grh;
49 static int ett_bth;
50 static int ett_rwh;
51 static int ett_rdeth;
52 static int ett_deth;
53 static int ett_reth;
54 static int ett_atomiceth;
55 static int ett_aeth;
56 static int ett_aeth_syndrome;
57 static int ett_atomicacketh;
58 static int ett_immdt;
59 static int ett_ieth;
60 static int ett_payload;
61 static int ett_vendor;
62 static int ett_subn_lid_routed;
63 static int ett_subn_directed_route;
64 static int ett_subnadmin;
65 static int ett_mad;
66 static int ett_cm;
67 static int ett_cm_sid;
68 static int ett_cm_ipcm;
69 static int ett_rmpp;
70 static int ett_subm_attribute;
71 static int ett_suba_attribute;
72 static int ett_datadetails;
73 static int ett_noticestraps;
74 /* static int ett_nodedesc; */
75 /* static int ett_nodeinfo; */
76 /* static int ett_switchinfo; */
77 /* static int ett_guidinfo; */
78 /* static int ett_portinfo; */
79 static int ett_portinfo_capmask;
80 static int ett_pkeytable;
81 static int ett_sltovlmapping;
82 static int ett_vlarbitrationtable;
83 static int ett_linearforwardingtable;
84 static int ett_randomforwardingtable;
85 static int ett_multicastforwardingtable;
86 static int ett_sminfo;
87 static int ett_vendordiag;
88 static int ett_ledinfo;
89 static int ett_linkspeedwidthpairs;
90 static int ett_informinfo;
91 static int ett_linkrecord;
92 static int ett_servicerecord;
93 static int ett_pathrecord;
94 static int ett_mcmemberrecord;
95 static int ett_tracerecord;
96 static int ett_multipathrecord;
97 static int ett_serviceassocrecord;
98 static int ett_perfclass;
99 static int ett_link;
101 /* Dissector Declaration */
102 static dissector_handle_t ib_handle;
103 static dissector_handle_t ib_link_handle;
105 /* Subdissectors Declarations */
106 static dissector_handle_t ipv6_handle;
107 static dissector_handle_t eth_handle;
108 static dissector_table_t ethertype_dissector_table;
110 static dissector_table_t subdissector_table;
112 /* MAD_Data
113 * Structure to hold information from the common MAD header.
114 * This is necessary because the MAD header contains information which significantly changes the dissection algorithm. */
115 typedef struct {
116 uint8_t managementClass;
117 uint8_t classVersion;
118 uint8_t method;
119 uint8_t status;
120 uint16_t classSpecific;
121 uint64_t transactionID;
122 uint16_t attributeID;
123 uint32_t attributeModifier;
124 char data[MAD_DATA_SIZE];
125 } MAD_Data;
127 typedef enum {
128 IB_PACKET_STARTS_WITH_LRH, /* Regular IB packet */
129 IB_PACKET_STARTS_WITH_GRH, /* ROCE packet */
130 IB_PACKET_STARTS_WITH_BTH /* RROCE packet */
131 } ib_packet_start_header;
133 /* Forward-declarations */
135 static void dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ib_packet_start_header starts_with);
136 static int32_t find_next_header_sequence(struct infinibandinfo* ibInfo);
137 static bool contains(uint32_t value, uint32_t* arr, int length);
138 static void dissect_general_info(tvbuff_t *tvb, int offset, packet_info *pinfo, ib_packet_start_header starts_with);
140 /* Parsing Methods for specific IB headers. */
142 static void parse_VENDOR(proto_tree *, tvbuff_t *, int *);
143 static void parse_PAYLOAD(proto_tree *, packet_info *, struct infinibandinfo *, tvbuff_t *, int *, int length, int crclen, proto_tree *);
144 static void parse_IETH(proto_tree *, tvbuff_t *, int *);
145 static void parse_IMMDT(proto_tree *, tvbuff_t *, int *offset);
146 static void parse_ATOMICACKETH(proto_tree *, tvbuff_t *, int *offset);
147 static void parse_AETH(proto_tree *, tvbuff_t *, int *offset, packet_info *pinfo);
148 static void parse_ATOMICETH(proto_tree *, tvbuff_t *, int *offset);
149 static void parse_RETH(proto_tree *, tvbuff_t *, int *offset,
150 struct infinibandinfo *info);
151 static void parse_DETH(proto_tree *, packet_info *, tvbuff_t *, int *offset);
152 static void parse_RDETH(proto_tree *, tvbuff_t *, int *offset);
153 static void parse_IPvSix(proto_tree *, tvbuff_t *, int *offset, packet_info *);
154 static void parse_RWH(proto_tree *, tvbuff_t *, int *offset, packet_info *, proto_tree *);
155 static void parse_DCCETH(proto_tree *parentTree, tvbuff_t *tvb, int *offset);
156 static void parse_FETH(proto_tree *, tvbuff_t *, int *offset);
158 static void parse_SUBN_LID_ROUTED(proto_tree *, packet_info *, tvbuff_t *, int *offset);
159 static void parse_SUBN_DIRECTED_ROUTE(proto_tree *, packet_info *, tvbuff_t *, int *offset);
160 static void parse_SUBNADMN(proto_tree *, packet_info *, tvbuff_t *, int *offset);
161 static void parse_PERF(proto_tree *, tvbuff_t *, packet_info *, int *offset);
162 static void parse_BM(proto_tree *, tvbuff_t *, int *offset);
163 static void parse_DEV_MGT(proto_tree *, tvbuff_t *, int *offset);
164 static void parse_COM_MGT(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, int *offset, proto_tree* top_tree);
165 static void parse_SNMP(proto_tree *, tvbuff_t *, int *offset);
166 static void parse_VENDOR_MANAGEMENT(proto_tree *, tvbuff_t *, int *offset);
167 static void parse_APPLICATION_MANAGEMENT(proto_tree *, tvbuff_t *, int *offset);
168 static void parse_RESERVED_MANAGEMENT(proto_tree *, tvbuff_t *, int *offset);
170 static bool parse_MAD_Common(proto_tree*, tvbuff_t*, int *offset, MAD_Data*);
171 static bool parse_RMPP(proto_tree* , tvbuff_t* , int *offset);
172 static void label_SUBM_Method(proto_item*, MAD_Data*, packet_info*);
173 static void label_SUBM_Attribute(proto_item*, MAD_Data*, packet_info*);
174 static void label_SUBA_Method(proto_item*, MAD_Data*, packet_info*);
175 static void label_SUBA_Attribute(proto_item*, MAD_Data*, packet_info*);
177 /* Class Attribute Parsing Routines */
178 static bool parse_SUBM_Attribute(proto_tree*, tvbuff_t*, int *offset, MAD_Data*);
179 static bool parse_SUBA_Attribute(proto_tree*, tvbuff_t*, int *offset, MAD_Data*);
181 /* These methods parse individual attributes
182 * Naming convention FunctionHandle = "parse_" + [Attribute Name];
183 * Where [Attribute Name] is the attribute identifier from chapter 14 of the IB Specification
184 * Subnet Management */
185 static void parse_NoticesAndTraps(proto_tree*, tvbuff_t*, int *offset);
186 static void parse_NodeDescription(proto_tree*, tvbuff_t*, int *offset);
187 static int parse_NodeInfo(proto_tree*, tvbuff_t*, int *offset);
188 static int parse_SwitchInfo(proto_tree*, tvbuff_t*, int *offset);
189 static int parse_GUIDInfo(proto_tree*, tvbuff_t*, int *offset);
190 static int parse_PortInfo(proto_tree*, tvbuff_t*, int *offset);
191 static void parse_P_KeyTable(proto_tree*, tvbuff_t*, int *offset);
192 static void parse_SLtoVLMappingTable(proto_tree*, tvbuff_t*, int *offset);
193 static void parse_VLArbitrationTable(proto_tree*, tvbuff_t*, int *offset);
194 static void parse_LinearForwardingTable(proto_tree*, tvbuff_t*, int *offset);
195 static void parse_RandomForwardingTable(proto_tree*, tvbuff_t*, int *offset);
196 static void parse_MulticastForwardingTable(proto_tree*, tvbuff_t*, int *offset);
197 static int parse_SMInfo(proto_tree*, tvbuff_t*, int *offset);
198 static int parse_VendorDiag(proto_tree*, tvbuff_t*, int *offset);
199 static void parse_LedInfo(proto_tree*, tvbuff_t*, int *offset);
200 static int parse_LinkSpeedWidthPairsTable(proto_tree*, tvbuff_t*, int *offset);
202 /* These methods parse individual attributes for specific MAD management classes.
203 * Naming convention FunctionHandle = "parse_" + [Management Class] + "_" + [Attribute Name];
204 * Where [Management Class] is the shorthand name for the management class as defined
205 * in the MAD Management Classes section below in this file, and [Attribute Name] is the
206 * attribute identifier from the corresponding chapter of the IB Specification */
207 static int parse_PERF_PortCounters(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, int *offset);
208 static int parse_PERF_PortCountersExtended(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, int *offset);
210 /* Subnet Administration */
211 static int parse_InformInfo(proto_tree*, tvbuff_t*, int *offset);
212 static int parse_LinkRecord(proto_tree*, tvbuff_t*, int *offset);
213 static int parse_ServiceRecord(proto_tree*, tvbuff_t*, int *offset);
214 static int parse_PathRecord(proto_tree*, tvbuff_t*, int *offset);
215 static int parse_MCMemberRecord(proto_tree*, tvbuff_t*, int *offset);
216 static int parse_TraceRecord(proto_tree*, tvbuff_t*, int *offset);
217 static int parse_MultiPathRecord(proto_tree*, tvbuff_t*, int *offset);
218 static int parse_ServiceAssociationRecord(proto_tree*, tvbuff_t*, int *offset);
220 /* Subnet Administration */
221 static void parse_RID(proto_tree*, tvbuff_t*, int *offset, MAD_Data*);
223 /* Common */
224 static int parse_ClassPortInfo(proto_tree*, tvbuff_t*, int *offset);
226 /* SM Methods */
227 static const value_string SUBM_Methods[] = {
228 { 0x01, "SubnGet("},
229 { 0x02, "SubnSet("},
230 { 0x81, "SubnGetResp("},
231 { 0x05, "SubnTrap("},
232 { 0x07, "SubnTrapResp("},
233 { 0, NULL}
235 /* SM Attributes */
236 static const value_string SUBM_Attributes[] = {
237 { 0x0002, "Attribute (Notice)"},
238 { 0x0010, "Attribute (NodeDescription)"},
239 { 0x0011, "Attribute (NodeInfo)"},
240 { 0x0012, "Attribute (SwitchInfo)"},
241 { 0x0014, "Attribute (GUIDInfo)"},
242 { 0x0015, "Attribute (PortInfo)"},
243 { 0x0016, "Attribute (P_KeyTable)"},
244 { 0x0017, "Attribute (SLtoVLMappingTable)"},
245 { 0x0018, "Attribute (VLArbitrationTable)"},
246 { 0x0019, "Attribute (LinearForwardingTable)"},
247 { 0x001A, "Attribute (RandomForwardingTable)"},
248 { 0x001B, "Attribute (MulticastForwardingTable)"},
249 { 0x001C, "Attribute (LinkSpeedWidthPairsTable)"},
250 { 0x0020, "Attribute (SMInfo)"},
251 { 0x0030, "Attribute (VendorDiag)"},
252 { 0x0031, "Attribute (LedInfo)"},
253 { 0, NULL}
256 /* SA Methods */
257 static const value_string SUBA_Methods[] = {
258 { 0x01, "SubnAdmGet("},
259 { 0x81, "SubnAdmGetResp("},
260 { 0x02, "SubnAdmSet("},
261 { 0x06, "SubnAdmReport("},
262 { 0x86, "SubnAdmReportResp("},
263 { 0x12, "SubnAdmGetTable("},
264 { 0x92, "SubnAdmGetTableResp("},
265 { 0x13, "SubnAdmGetTraceTable("},
266 { 0x14, "SubnAdmGetMulti("},
267 { 0x94, "SubnAdmGetMultiResp("},
268 { 0x15, "SubnAdmDelete("},
269 { 0x95, "SubnAdmDeleteResp("},
270 { 0, NULL}
272 /* SA Attributes */
273 static const value_string SUBA_Attributes[] = {
274 { 0x0001, "Attribute (ClassPortInfo)"},
275 { 0x0002, "Attribute (Notice)"},
276 { 0x0003, "Attribute (InformInfo)"},
277 { 0x0011, "Attribute (NodeRecord)"},
278 { 0x0012, "Attribute (PortInfoRecord)"},
279 { 0x0013, "Attribute (SLtoVLMappingTableRecord)"},
280 { 0x0014, "Attribute (SwitchInfoRecord)"},
281 { 0x0015, "Attribute (LinearForwardingTableRecord)"},
282 { 0x0016, "Attribute (RandomForwardingTableRecord)"},
283 { 0x0017, "Attribute (MulticastForwardingTableRecord)"},
284 { 0x0018, "Attribute (SMInfoRecord)"},
285 { 0x0019, "Attribute (LinkSpeedWidthPairsTableRecord)"},
286 { 0x00F3, "Attribute (InformInfoRecord)"},
287 { 0x0020, "Attribute (LinkRecord)"},
288 { 0x0030, "Attribute (GuidInfoRecord)"},
289 { 0x0031, "Attribute (ServiceRecord)"},
290 { 0x0033, "Attribute (P_KeyTableRecord)"},
291 { 0x0035, "Attribute (PathRecord)"},
292 { 0x0036, "Attribute (VLArbitrationTableRecord)"},
293 { 0x0038, "Attribute (MCMemberRecord)"},
294 { 0x0039, "Attribute (TraceRecord)"},
295 { 0x003A, "Attribute (MultiPathRecord)"},
296 { 0x003B, "Attribute (ServiceAssociationRecord)"},
297 { 0, NULL}
300 /* CM Attributes */
301 static const value_string CM_Attributes[] = {
302 { 0x0001, "ClassPortInfo"},
303 { ATTR_CM_REQ, "ConnectRequest"},
304 { 0x0011, "MsgRcptAck"},
305 { ATTR_CM_REJ, "ConnectReject"},
306 { ATTR_CM_REP, "ConnectReply"},
307 { ATTR_CM_RTU, "ReadyToUse"},
308 { ATTR_CM_DREQ, "DisconnectRequest"},
309 { ATTR_CM_DRSP, "DisconnectReply"},
310 { 0x0017, "ServiceIDResReq"},
311 { 0x0018, "ServiceIDResReqResp"},
312 { 0x0019, "LoadAlternatePath"},
313 { 0x001A, "AlternatePathResponse"},
314 { 0, NULL}
317 /* RMPP Types */
318 #define RMPP_NOT_USED 0
319 #define RMPP_DATA 1
320 #define RMPP_ACK 2
321 #define RMPP_STOP 3
322 #define RMPP_ABORT 4
324 static const value_string RMPP_Packet_Types[] = {
325 { RMPP_NOT_USED, " Not an RMPP Packet " },
326 { RMPP_DATA, "RMPP (DATA)" },
327 { RMPP_ACK, "RMPP (ACK)" },
328 { RMPP_STOP, "RMPP (STOP)" },
329 { RMPP_ABORT, "RMPP (ABORT)" },
330 { 0, NULL}
333 static const value_string RMPP_Flags[] = {
334 { 3, " (Transmission Sequence - First Packet)"},
335 { 5, " (Transmission Sequence - Last Packet)"},
336 { 7, " (Transmission Sequence - First and Last Packet)"},
337 { 1, " (Transmission Sequence) " },
338 { 0, NULL}
341 static const value_string RMPP_Status[]= {
342 { 0, " (Normal)"},
343 { 1, " (Resources Exhausted)"},
344 { 118, " (Total Time Too Long)"},
345 { 119, " (Inconsistent Last and PayloadLength)"},
346 { 120, " (Inconsistent First and Segment Number)"},
347 { 121, " (Bad RMPPType)"},
348 { 122, " (NewWindowLast Too Small)"},
349 { 123, " (SegmentNumber Too Big)"},
350 { 124, " (Illegal Status)"},
351 { 125, " (Unsupported Version)"},
352 { 126, " (Too Many Retries)"},
353 { 127, " (Unspecified - Unknown Error Code on ABORT)"},
354 { 0, NULL}
357 static const value_string DiagCode[]= {
358 {0x0000, "Function Ready"},
359 {0x0001, "Performing Self Test"},
360 {0x0002, "Initializing"},
361 {0x0003, "Soft Error - Function has non-fatal error"},
362 {0x0004, "Hard Error - Function has fatal error"},
363 { 0, NULL}
365 static const value_string LinkWidthEnabled[]= {
366 {0x0000, "No State Change"},
367 {0x0001, "1x"},
368 {0x0002, "4x"},
369 {0x0003, "1x or 4x"},
370 {0x0004, "8x"},
371 {0x0005, "1x or 8x"},
372 {0x0006, "4x or 8x"},
373 {0x0007, "1x or 4x or 8x"},
374 {0x0008, "12x"},
375 {0x0009, "1x or 12x"},
376 {0x000A, "4x or 12x"},
377 {0x000B, "1x or 4x or 12x"},
378 {0x000C, "8x or 12x"},
379 {0x000D, "1x or 8x or 12x"},
380 {0x000E, "4x or 8x or 12x"},
381 {0x000F, "1x or 4x or 8x or 12x"},
382 {0x00FF, "Set to LinkWidthSupported Value - Response contains actual LinkWidthSupported"},
383 { 0, NULL}
386 static const value_string LinkWidthSupported[]= {
387 {0x0001, "1x"},
388 {0x0003, "1x or 4x"},
389 {0x0007, "1x or 4x or 8x"},
390 {0x000B, "1x or 4x or 12x"},
391 {0x000F, "1x or 4x or 8x or 12x"},
392 { 0, NULL}
394 static const value_string LinkWidthActive[]= {
395 {0x0001, "1x"},
396 {0x0002, "4x"},
397 {0x0004, "8x"},
398 {0x0008, "12x"},
399 { 0, NULL}
401 static const value_string LinkSpeedSupported[]= {
402 {0x0001, "2.5 Gbps"},
403 {0x0003, "2.5 or 5.0 Gbps"},
404 {0x0005, "2.5 or 10.0 Gbps"},
405 {0x0007, "2.5 or 5.0 or 10.0 Gbps"},
406 { 0, NULL}
408 static const value_string PortState[]= {
409 {0x0000, "No State Change"},
410 {0x0001, "Down (includes failed links)"},
411 {0x0002, "Initialized"},
412 {0x0003, "Armed"},
413 {0x0004, "Active"},
414 { 0, NULL}
416 static const value_string PortPhysicalState[]= {
417 {0x0000, "No State Change"},
418 {0x0001, "Sleep"},
419 {0x0002, "Polling"},
420 {0x0003, "Disabled"},
421 {0x0004, "PortConfigurationTraining"},
422 {0x0005, "LinkUp"},
423 {0x0006, "LinkErrorRecovery"},
424 {0x0007, "Phy Test"},
425 { 0, NULL}
427 static const value_string LinkDownDefaultState[]= {
428 {0x0000, "No State Change"},
429 {0x0001, "Sleep"},
430 {0x0002, "Polling"},
431 { 0, NULL}
433 static const value_string LinkSpeedActive[]= {
434 {0x0001, "2.5 Gbps"},
435 {0x0002, "5.0 Gbps"},
436 {0x0004, "10.0 Gbps"},
437 { 0, NULL}
439 static const value_string LinkSpeedEnabled[]= {
440 {0x0000, "No State Change"},
441 {0x0001, "2.5 Gbps"},
442 {0x0003, "2.5 or 5.0 Gbps"},
443 {0x0005, "2.5 or 10.0 Gbps"},
444 {0x0007, "2.5 or 5.0 or 10.0 Gbps"},
445 {0x000F, "Set to LinkSpeedSupported value - response contains actual LinkSpeedSupported"},
446 { 0, NULL}
448 static const value_string NeighborMTU[]= {
449 {0x0001, "256"},
450 {0x0002, "512"},
451 {0x0003, "1024"},
452 {0x0004, "2048"},
453 {0x0005, "4096"},
454 { 0, NULL}
456 static const value_string VLCap[]= {
457 {0x0001, "VL0"},
458 {0x0002, "VL0, VL1"},
459 {0x0003, "VL0 - VL3"},
460 {0x0004, "VL0 - VL7"},
461 {0x0005, "VL0 - VL14"},
462 { 0, NULL}
464 static const value_string MTUCap[]= {
465 {0x0001, "256"},
466 {0x0002, "512"},
467 {0x0003, "1024"},
468 {0x0004, "2048"},
469 {0x0005, "4096"},
470 { 0, NULL}
472 static const value_string OperationalVLs[]= {
473 {0x0000, "No State Change"},
474 {0x0001, "VL0"},
475 {0x0002, "VL0, VL1"},
476 {0x0003, "VL0 - VL3"},
477 {0x0004, "VL0 - VL7"},
478 {0x0005, "VL0 - VL14"},
479 { 0, NULL}
482 /* For reserved fields in various packets */
483 static int hf_infiniband_reserved;
484 /* Local Route Header (LRH) */
485 static int hf_infiniband_LRH;
486 static int hf_infiniband_virtual_lane;
487 static int hf_infiniband_link_version;
488 static int hf_infiniband_service_level;
489 static int hf_infiniband_reserved2;
490 static int hf_infiniband_link_next_header;
491 static int hf_infiniband_destination_local_id;
492 static int hf_infiniband_reserved5;
493 static int hf_infiniband_packet_length;
494 static int hf_infiniband_source_local_id;
495 /* Global Route Header (GRH) */
496 static int hf_infiniband_GRH;
497 static int hf_infiniband_ip_version;
498 static int hf_infiniband_traffic_class;
499 static int hf_infiniband_flow_label;
500 static int hf_infiniband_payload_length;
501 static int hf_infiniband_next_header;
502 static int hf_infiniband_hop_limit;
503 static int hf_infiniband_source_gid;
504 static int hf_infiniband_destination_gid;
505 /* Base Transport Header (BTH) */
506 static int hf_infiniband_BTH;
507 static int hf_infiniband_opcode;
508 static int hf_infiniband_solicited_event;
509 static int hf_infiniband_migreq;
510 static int hf_infiniband_pad_count;
511 static int hf_infiniband_transport_header_version;
512 static int hf_infiniband_partition_key;
513 static int hf_infiniband_destination_qp;
514 static int hf_infiniband_acknowledge_request;
515 static int hf_infiniband_reserved7;
516 static int hf_infiniband_packet_sequence_number;
517 /* Raw Header (RWH) */
518 static int hf_infiniband_RWH;
519 static int hf_infiniband_etype;
520 /* Reliable Datagram Extended Transport Header (RDETH) */
521 static int hf_infiniband_RDETH;
522 static int hf_infiniband_ee_context;
523 /* Datagram Extended Transport Header (DETH) */
524 static int hf_infiniband_DETH;
525 static int hf_infiniband_queue_key;
526 static int hf_infiniband_source_qp;
527 /* RDMA Extended Transport Header (RETH) */
528 static int hf_infiniband_RETH;
529 static int hf_infiniband_virtual_address;
530 static int hf_infiniband_remote_key;
531 static int hf_infiniband_dma_length;
532 /* Atomic Extended Transport Header (AtomicETH) */
533 static int hf_infiniband_AtomicETH;
534 /* static int hf_infiniband_virtual_address_AtomicETH; */
535 /* static int hf_infiniband_remote_key_AtomicETH; */
536 static int hf_infiniband_swap_or_add_data;
537 static int hf_infiniband_compare_data;
538 /* ACK Extended Transport Header (AETH) */
539 static int hf_infiniband_AETH;
540 static int hf_infiniband_syndrome;
541 static int hf_infiniband_syndrome_reserved;
542 static int hf_infiniband_syndrome_opcode;
543 static int hf_infiniband_syndrome_credit_count;
544 static int hf_infiniband_syndrome_timer;
545 static int hf_infiniband_syndrome_reserved_value;
546 static int hf_infiniband_syndrome_error_code;
547 static int hf_infiniband_message_sequence_number;
548 /* Atomic ACK Extended Transport Header (AtomicAckETH) */
549 static int hf_infiniband_AtomicAckETH;
550 static int hf_infiniband_original_remote_data;
551 /* Immediate Extended Transport Header (ImmDt) */
552 static int hf_infiniband_IMMDT;
553 /* Invalidate Extended Transport Header (IETH) */
554 static int hf_infiniband_IETH;
555 /* FLUSH Extended Transport Header (FETH) */
556 static int hf_infiniband_FETH;
557 static int hf_infiniband_reserved27;
558 static int hf_infiniband_selectivity_level;
559 static int hf_infiniband_placement_type;
561 /* Payload */
562 static int hf_infiniband_payload;
563 static int hf_infiniband_invariant_crc;
564 static int hf_infiniband_variant_crc;
565 /* Unknown or Vendor Specific */
566 static int hf_infiniband_raw_data;
567 static int hf_infiniband_vendor;
568 /* CM REQ Header */
569 static int hf_cm_req_local_comm_id;
570 static int hf_cm_req_service_id;
571 static int hf_cm_req_service_id_prefix;
572 static int hf_cm_req_service_id_protocol;
573 static int hf_cm_req_service_id_dport;
574 static int hf_cm_req_local_ca_guid;
575 static int hf_cm_req_local_qkey;
576 static int hf_cm_req_local_qpn;
577 static int hf_cm_req_respo_res;
578 static int hf_cm_req_local_eecn;
579 static int hf_cm_req_init_depth;
580 static int hf_cm_req_remote_eecn;
581 static int hf_cm_req_remote_cm_resp_to;
582 static int hf_cm_req_transp_serv_type;
583 static int hf_cm_req_e2e_flow_ctrl;
584 static int hf_cm_req_start_psn;
585 static int hf_cm_req_local_cm_resp_to;
586 static int hf_cm_req_retry_count;
587 static int hf_cm_req_pkey;
588 static int hf_cm_req_path_pp_mtu;
589 static int hf_cm_req_rdc_exists;
590 static int hf_cm_req_rnr_retry_count;
591 static int hf_cm_req_max_cm_retries;
592 static int hf_cm_req_srq;
593 static int hf_cm_req_extended_transport;
594 static int hf_cm_req_primary_local_lid;
595 static int hf_cm_req_primary_remote_lid;
596 static int hf_cm_req_primary_local_gid;
597 static int hf_cm_req_primary_remote_gid;
598 static int hf_cm_req_primary_local_gid_ipv4;
599 static int hf_cm_req_primary_remote_gid_ipv4;
600 static int hf_cm_req_primary_flow_label;
601 static int hf_cm_req_primary_reserved0;
602 static int hf_cm_req_primary_packet_rate;
603 static int hf_cm_req_primary_traffic_class;
604 static int hf_cm_req_primary_hop_limit;
605 static int hf_cm_req_primary_sl;
606 static int hf_cm_req_primary_subnet_local;
607 static int hf_cm_req_primary_reserved1;
608 static int hf_cm_req_primary_local_ack_to;
609 static int hf_cm_req_primary_reserved2;
610 static int hf_cm_req_alt_local_lid;
611 static int hf_cm_req_alt_remote_lid;
612 static int hf_cm_req_alt_local_gid;
613 static int hf_cm_req_alt_remote_gid;
614 static int hf_cm_req_flow_label;
615 static int hf_cm_req_alt_reserved0;
616 static int hf_cm_req_packet_rate;
617 static int hf_cm_req_alt_traffic_class;
618 static int hf_cm_req_alt_hop_limit;
619 static int hf_cm_req_SL;
620 static int hf_cm_req_subnet_local;
621 static int hf_cm_req_alt_reserved1;
622 static int hf_cm_req_local_ACK_timeout;
623 static int hf_cm_req_alt_reserved2;
624 static int hf_cm_req_private_data;
625 static int hf_cm_req_ip_cm_req_msg;
626 static int hf_cm_req_ip_cm_majv;
627 static int hf_cm_req_ip_cm_minv;
628 static int hf_cm_req_ip_cm_ipv;
629 static int hf_cm_req_ip_cm_res;
630 static int hf_cm_req_ip_cm_sport;
631 static int hf_cm_req_ip_cm_sip6;
632 static int hf_cm_req_ip_cm_dip6;
633 static int hf_cm_req_ip_cm_sip4;
634 static int hf_cm_req_ip_cm_dip4;
635 static int hf_ip_cm_req_consumer_private_data;
637 /* CM REP Header */
638 static int hf_cm_rep_localcommid;
639 static int hf_cm_rep_remotecommid;
640 static int hf_cm_rep_localqkey;
641 static int hf_cm_rep_localqpn;
642 static int hf_cm_rep_localeecontnum;
643 static int hf_cm_rep_startingpsn;
644 static int hf_cm_rep_responderres;
645 static int hf_cm_rep_initiatordepth;
646 static int hf_cm_rep_tgtackdelay;
647 static int hf_cm_rep_failoveracc;
648 static int hf_cm_rep_e2eflowctl;
649 static int hf_cm_rep_rnrretrycount;
650 static int hf_cm_rep_srq;
651 static int hf_cm_rep_reserved;
652 static int hf_cm_rep_localcaguid;
653 static int hf_cm_rep_privatedata;
654 /* CM RTU Header */
655 static int hf_cm_rtu_localcommid;
656 static int hf_cm_rtu_remotecommid;
657 static int hf_cm_rtu_privatedata;
658 /* CM REJ Header */
659 static int hf_cm_rej_local_commid;
660 static int hf_cm_rej_remote_commid;
661 static int hf_cm_rej_msg_rej;
662 static int hf_cm_rej_msg_reserved0;
663 static int hf_cm_rej_rej_info_len;
664 static int hf_cm_rej_msg_reserved1;
665 static int hf_cm_rej_reason;
666 static int hf_cm_rej_add_rej_info;
667 static int hf_cm_rej_private_data;
668 /* CM DREQ Header */
669 static int hf_cm_dreq_localcommid;
670 static int hf_cm_dreq_remotecommid;
671 static int hf_cm_dreq_remote_qpn;
672 static int hf_cm_dreq_privatedata;
673 /* CM DRSP Header */
674 static int hf_cm_drsp_localcommid;
675 static int hf_cm_drsp_remotecommid;
676 static int hf_cm_drsp_privatedata;
677 /* MAD Base Header */
678 static int hf_infiniband_MAD;
679 static int hf_infiniband_base_version;
680 static int hf_infiniband_mgmt_class;
681 static int hf_infiniband_class_version;
682 static int hf_infiniband_method;
683 static int hf_infiniband_status;
684 static int hf_infiniband_class_specific;
685 static int hf_infiniband_transaction_id;
686 static int hf_infiniband_attribute_id;
687 static int hf_infiniband_attribute_modifier;
688 static int hf_infiniband_data;
689 /* RMPP Header */
690 static int hf_infiniband_RMPP;
691 static int hf_infiniband_rmpp_version;
692 static int hf_infiniband_rmpp_type;
693 static int hf_infiniband_r_resp_time;
694 static int hf_infiniband_rmpp_flags;
695 static int hf_infiniband_rmpp_status;
696 static int hf_infiniband_rmpp_data1;
697 static int hf_infiniband_rmpp_data2;
698 /* RMPP Data */
699 /* static int hf_infiniband_RMPP_DATA; */
700 static int hf_infiniband_segment_number;
701 static int hf_infiniband_payload_length32;
702 static int hf_infiniband_transferred_data;
703 /* RMPP ACK */
704 static int hf_infiniband_new_window_last;
705 /* RMPP ABORT and STOP */
706 static int hf_infiniband_optional_extended_error_data;
707 /* SMP Data LID Routed */
708 static int hf_infiniband_SMP_LID;
709 static int hf_infiniband_m_key;
710 static int hf_infiniband_smp_data;
711 /* SMP Data Directed Route */
712 static int hf_infiniband_SMP_DIRECTED;
713 static int hf_infiniband_smp_status;
714 static int hf_infiniband_hop_pointer;
715 static int hf_infiniband_hop_count;
716 static int hf_infiniband_dr_slid;
717 static int hf_infiniband_dr_dlid;
718 static int hf_infiniband_d;
719 static int hf_infiniband_initial_path;
720 static int hf_infiniband_return_path;
721 /* SA MAD Header */
722 static int hf_infiniband_SA;
723 static int hf_infiniband_sm_key;
724 static int hf_infiniband_attribute_offset;
725 static int hf_infiniband_component_mask;
726 static int hf_infiniband_subnet_admin_data;
728 /* Mellanox EoIB encapsulation header */
729 static int proto_mellanox_eoib;
730 static int hf_infiniband_ver;
731 static int hf_infiniband_tcp_chk;
732 static int hf_infiniband_ip_chk;
733 static int hf_infiniband_fcs;
734 static int hf_infiniband_ms;
735 static int hf_infiniband_seg_off;
736 static int hf_infiniband_seg_id;
738 static int ett_eoib;
740 #define MELLANOX_VERSION_FLAG 0x3000
741 #define MELLANOX_TCP_CHECKSUM_FLAG 0x0C00
742 #define MELLANOX_IP_CHECKSUM_FLAG 0x0300
743 #define MELLANOX_FCS_PRESENT_FLAG 0x0040
744 #define MELLANOX_MORE_SEGMENT_FLAG 0x0020
745 #define MELLANOX_SEGMENT_FLAG 0x001F
747 /* Attributes
748 * Additional Structures for individuala attribute decoding.
749 * Since they are not headers the naming convention is slightly modified
750 * Convention: hf_infiniband_[attribute name]_[field]
751 * This was not entirely necessary but I felt the previous convention
752 * did not provide adequate readability for the granularity of attribute/attribute fields. */
754 /* NodeDescription */
755 static int hf_infiniband_NodeDescription_NodeString;
756 /* NodeInfo */
757 static int hf_infiniband_NodeInfo_BaseVersion;
758 static int hf_infiniband_NodeInfo_ClassVersion;
759 static int hf_infiniband_NodeInfo_NodeType;
760 static int hf_infiniband_NodeInfo_NumPorts;
761 static int hf_infiniband_NodeInfo_SystemImageGUID;
762 static int hf_infiniband_NodeInfo_NodeGUID;
763 static int hf_infiniband_NodeInfo_PortGUID;
764 static int hf_infiniband_NodeInfo_PartitionCap;
765 static int hf_infiniband_NodeInfo_DeviceID;
766 static int hf_infiniband_NodeInfo_Revision;
767 static int hf_infiniband_NodeInfo_LocalPortNum;
768 static int hf_infiniband_NodeInfo_VendorID;
769 /* SwitchInfo */
770 static int hf_infiniband_SwitchInfo_LinearFDBCap;
771 static int hf_infiniband_SwitchInfo_RandomFDBCap;
772 static int hf_infiniband_SwitchInfo_MulticastFDBCap;
773 static int hf_infiniband_SwitchInfo_LinearFDBTop;
774 static int hf_infiniband_SwitchInfo_DefaultPort;
775 static int hf_infiniband_SwitchInfo_DefaultMulticastPrimaryPort;
776 static int hf_infiniband_SwitchInfo_DefaultMulticastNotPrimaryPort;
777 static int hf_infiniband_SwitchInfo_LifeTimeValue;
778 static int hf_infiniband_SwitchInfo_PortStateChange;
779 static int hf_infiniband_SwitchInfo_OptimizedSLtoVLMappingProgramming;
780 static int hf_infiniband_SwitchInfo_LIDsPerPort;
781 static int hf_infiniband_SwitchInfo_PartitionEnforcementCap;
782 static int hf_infiniband_SwitchInfo_InboundEnforcementCap;
783 static int hf_infiniband_SwitchInfo_OutboundEnforcementCap;
784 static int hf_infiniband_SwitchInfo_FilterRawInboundCap;
785 static int hf_infiniband_SwitchInfo_FilterRawOutboundCap;
786 static int hf_infiniband_SwitchInfo_EnhancedPortZero;
787 /* GUIDInfo */
788 /* static int hf_infiniband_GUIDInfo_GUIDBlock; */
789 static int hf_infiniband_GUIDInfo_GUID;
790 /* PortInfo */
791 static int hf_infiniband_PortInfo_GidPrefix;
792 static int hf_infiniband_PortInfo_LID;
793 static int hf_infiniband_PortInfo_MasterSMLID;
794 static int hf_infiniband_PortInfo_CapabilityMask;
796 /* Capability Mask Flags */
797 static int hf_infiniband_PortInfo_CapabilityMask_SM;
798 static int hf_infiniband_PortInfo_CapabilityMask_NoticeSupported;
799 static int hf_infiniband_PortInfo_CapabilityMask_TrapSupported;
800 static int hf_infiniband_PortInfo_CapabilityMask_OptionalIPDSupported;
801 static int hf_infiniband_PortInfo_CapabilityMask_AutomaticMigrationSupported;
802 static int hf_infiniband_PortInfo_CapabilityMask_SLMappingSupported;
803 static int hf_infiniband_PortInfo_CapabilityMask_MKeyNVRAM;
804 static int hf_infiniband_PortInfo_CapabilityMask_PKeyNVRAM;
805 static int hf_infiniband_PortInfo_CapabilityMask_LEDInfoSupported;
806 static int hf_infiniband_PortInfo_CapabilityMask_SMdisabled;
807 static int hf_infiniband_PortInfo_CapabilityMask_SystemImageGUIDSupported;
808 static int hf_infiniband_PortInfo_CapabilityMask_PKeySwitchExternalPortTrapSupported;
809 static int hf_infiniband_PortInfo_CapabilityMask_CommunicationManagementSupported;
810 static int hf_infiniband_PortInfo_CapabilityMask_SNMPTunnelingSupported;
811 static int hf_infiniband_PortInfo_CapabilityMask_ReinitSupported;
812 static int hf_infiniband_PortInfo_CapabilityMask_DeviceManagementSupported;
813 static int hf_infiniband_PortInfo_CapabilityMask_VendorClassSupported;
814 static int hf_infiniband_PortInfo_CapabilityMask_DRNoticeSupported;
815 static int hf_infiniband_PortInfo_CapabilityMask_CapabilityMaskNoticeSupported;
816 static int hf_infiniband_PortInfo_CapabilityMask_BootManagementSupported;
817 static int hf_infiniband_PortInfo_CapabilityMask_LinkRoundTripLatencySupported;
818 static int hf_infiniband_PortInfo_CapabilityMask_ClientRegistrationSupported;
819 static int hf_infiniband_PortInfo_CapabilityMask_OtherLocalChangesNoticeSupported;
820 static int hf_infiniband_PortInfo_CapabilityMask_LinkSpeedWIdthPairsTableSupported;
821 /* End Capability Mask Flags */
824 static int hf_infiniband_PortInfo_DiagCode;
825 static int hf_infiniband_PortInfo_M_KeyLeasePeriod;
826 static int hf_infiniband_PortInfo_LocalPortNum;
827 static int hf_infiniband_PortInfo_LinkWidthEnabled;
828 static int hf_infiniband_PortInfo_LinkWidthSupported;
829 static int hf_infiniband_PortInfo_LinkWidthActive;
830 static int hf_infiniband_PortInfo_LinkSpeedSupported;
831 static int hf_infiniband_PortInfo_PortState;
832 static int hf_infiniband_PortInfo_PortPhysicalState;
833 static int hf_infiniband_PortInfo_LinkDownDefaultState;
834 static int hf_infiniband_PortInfo_M_KeyProtectBits;
835 static int hf_infiniband_PortInfo_LMC;
836 static int hf_infiniband_PortInfo_LinkSpeedActive;
837 static int hf_infiniband_PortInfo_LinkSpeedEnabled;
838 static int hf_infiniband_PortInfo_NeighborMTU;
839 static int hf_infiniband_PortInfo_MasterSMSL;
840 static int hf_infiniband_PortInfo_VLCap;
841 static int hf_infiniband_PortInfo_M_Key;
842 static int hf_infiniband_PortInfo_InitType;
843 static int hf_infiniband_PortInfo_VLHighLimit;
844 static int hf_infiniband_PortInfo_VLArbitrationHighCap;
845 static int hf_infiniband_PortInfo_VLArbitrationLowCap;
846 static int hf_infiniband_PortInfo_InitTypeReply;
847 static int hf_infiniband_PortInfo_MTUCap;
848 static int hf_infiniband_PortInfo_VLStallCount;
849 static int hf_infiniband_PortInfo_HOQLife;
850 static int hf_infiniband_PortInfo_OperationalVLs;
851 static int hf_infiniband_PortInfo_PartitionEnforcementInbound;
852 static int hf_infiniband_PortInfo_PartitionEnforcementOutbound;
853 static int hf_infiniband_PortInfo_FilterRawInbound;
854 static int hf_infiniband_PortInfo_FilterRawOutbound;
855 static int hf_infiniband_PortInfo_M_KeyViolations;
856 static int hf_infiniband_PortInfo_P_KeyViolations;
857 static int hf_infiniband_PortInfo_Q_KeyViolations;
858 static int hf_infiniband_PortInfo_GUIDCap;
859 static int hf_infiniband_PortInfo_ClientReregister;
860 static int hf_infiniband_PortInfo_SubnetTimeOut;
861 static int hf_infiniband_PortInfo_RespTimeValue;
862 static int hf_infiniband_PortInfo_LocalPhyErrors;
863 static int hf_infiniband_PortInfo_OverrunErrors;
864 static int hf_infiniband_PortInfo_MaxCreditHint;
865 static int hf_infiniband_PortInfo_LinkRoundTripLatency;
867 /* P_KeyTable */
868 static int hf_infiniband_P_KeyTable_P_KeyTableBlock;
869 static int hf_infiniband_P_KeyTable_MembershipType;
870 static int hf_infiniband_P_KeyTable_P_KeyBase;
872 /* SLtoVLMappingTable */
873 static int hf_infiniband_SLtoVLMappingTable_SLtoVL_HighBits;
874 static int hf_infiniband_SLtoVLMappingTable_SLtoVL_LowBits;
876 /* VLArbitrationTable */
877 /* static int hf_infiniband_VLArbitrationTable_VLWeightPairs; */
878 static int hf_infiniband_VLArbitrationTable_VL;
879 static int hf_infiniband_VLArbitrationTable_Weight;
881 /* LinearForwardingTable */
882 /* static int hf_infiniband_LinearForwardingTable_LinearForwardingTableBlock; */
883 static int hf_infiniband_LinearForwardingTable_Port;
885 /* RandomForwardingTable */
886 /* static int hf_infiniband_RandomForwardingTable_RandomForwardingTableBlock; */
887 static int hf_infiniband_RandomForwardingTable_LID;
888 static int hf_infiniband_RandomForwardingTable_Valid;
889 static int hf_infiniband_RandomForwardingTable_LMC;
890 static int hf_infiniband_RandomForwardingTable_Port;
892 /* MulticastForwardingTable */
893 /* static int hf_infiniband_MulticastForwardingTable_MulticastForwardingTableBlock; */
894 static int hf_infiniband_MulticastForwardingTable_PortMask;
896 /* SMInfo */
897 static int hf_infiniband_SMInfo_GUID;
898 static int hf_infiniband_SMInfo_SM_Key;
899 static int hf_infiniband_SMInfo_ActCount;
900 static int hf_infiniband_SMInfo_Priority;
901 static int hf_infiniband_SMInfo_SMState;
903 /* VendorDiag */
904 static int hf_infiniband_VendorDiag_NextIndex;
905 static int hf_infiniband_VendorDiag_DiagData;
907 /* LedInfo */
908 static int hf_infiniband_LedInfo_LedMask;
910 /* LinkSpeedWidthPairsTable */
911 static int hf_infiniband_LinkSpeedWidthPairsTable_NumTables;
912 static int hf_infiniband_LinkSpeedWidthPairsTable_PortMask;
913 static int hf_infiniband_LinkSpeedWidthPairsTable_SpeedTwoFive;
914 static int hf_infiniband_LinkSpeedWidthPairsTable_SpeedFive;
915 static int hf_infiniband_LinkSpeedWidthPairsTable_SpeedTen;
917 /* Attributes for Subnet Administration.
918 * Mostly we have "Records" here which are just structures of SM attributes.
919 * There are some unique attributes though that we will want to have a structure for. */
921 /* NodeRecord */
922 /* PortInfoRecord */
923 /* SLtoVLMappingTableRecord */
924 /* SwitchInfoRecord */
925 /* LinearForwardingTableRecord */
926 /* RandomForwardingTableRecord */
927 /* MulticastForwardingTableRecord */
928 /* VLArbitrationTableRecord */
930 static int hf_infiniband_SA_LID;
931 static int hf_infiniband_SA_EndportLID;
932 static int hf_infiniband_SA_PortNum;
933 static int hf_infiniband_SA_InputPortNum;
934 static int hf_infiniband_SA_OutputPortNum;
935 static int hf_infiniband_SA_BlockNum_EightBit;
936 static int hf_infiniband_SA_BlockNum_NineBit;
937 static int hf_infiniband_SA_BlockNum_SixteenBit;
938 static int hf_infiniband_SA_Position;
939 /* static int hf_infiniband_SA_Index; */
941 /* InformInfoRecord */
942 static int hf_infiniband_InformInfoRecord_SubscriberGID;
943 static int hf_infiniband_InformInfoRecord_Enum;
945 /* InformInfo */
946 static int hf_infiniband_InformInfo_GID;
947 static int hf_infiniband_InformInfo_LIDRangeBegin;
948 static int hf_infiniband_InformInfo_LIDRangeEnd;
949 static int hf_infiniband_InformInfo_IsGeneric;
950 static int hf_infiniband_InformInfo_Subscribe;
951 static int hf_infiniband_InformInfo_Type;
952 static int hf_infiniband_InformInfo_TrapNumberDeviceID;
953 static int hf_infiniband_InformInfo_QPN;
954 static int hf_infiniband_InformInfo_RespTimeValue;
955 static int hf_infiniband_InformInfo_ProducerTypeVendorID;
957 /* LinkRecord */
958 static int hf_infiniband_LinkRecord_FromLID;
959 static int hf_infiniband_LinkRecord_FromPort;
960 static int hf_infiniband_LinkRecord_ToPort;
961 static int hf_infiniband_LinkRecord_ToLID;
963 /* ServiceRecord */
964 static int hf_infiniband_ServiceRecord_ServiceID;
965 static int hf_infiniband_ServiceRecord_ServiceGID;
966 static int hf_infiniband_ServiceRecord_ServiceP_Key;
967 static int hf_infiniband_ServiceRecord_ServiceLease;
968 static int hf_infiniband_ServiceRecord_ServiceKey;
969 static int hf_infiniband_ServiceRecord_ServiceName;
970 static int hf_infiniband_ServiceRecord_ServiceData;
972 /* ServiceAssociationRecord */
973 static int hf_infiniband_ServiceAssociationRecord_ServiceKey;
974 static int hf_infiniband_ServiceAssociationRecord_ServiceName;
976 /* PathRecord */
977 static int hf_infiniband_PathRecord_DGID;
978 static int hf_infiniband_PathRecord_SGID;
979 static int hf_infiniband_PathRecord_DLID;
980 static int hf_infiniband_PathRecord_SLID;
981 static int hf_infiniband_PathRecord_RawTraffic;
982 static int hf_infiniband_PathRecord_FlowLabel;
983 static int hf_infiniband_PathRecord_HopLimit;
984 static int hf_infiniband_PathRecord_TClass;
985 static int hf_infiniband_PathRecord_Reversible;
986 static int hf_infiniband_PathRecord_NumbPath;
987 static int hf_infiniband_PathRecord_P_Key;
988 static int hf_infiniband_PathRecord_SL;
989 static int hf_infiniband_PathRecord_MTUSelector;
990 static int hf_infiniband_PathRecord_MTU;
991 static int hf_infiniband_PathRecord_RateSelector;
992 static int hf_infiniband_PathRecord_Rate;
993 static int hf_infiniband_PathRecord_PacketLifeTimeSelector;
994 static int hf_infiniband_PathRecord_PacketLifeTime;
995 static int hf_infiniband_PathRecord_Preference;
997 /* MCMemberRecord */
998 static int hf_infiniband_MCMemberRecord_MGID;
999 static int hf_infiniband_MCMemberRecord_PortGID;
1000 static int hf_infiniband_MCMemberRecord_Q_Key;
1001 static int hf_infiniband_MCMemberRecord_MLID;
1002 static int hf_infiniband_MCMemberRecord_MTUSelector;
1003 static int hf_infiniband_MCMemberRecord_MTU;
1004 static int hf_infiniband_MCMemberRecord_TClass;
1005 static int hf_infiniband_MCMemberRecord_P_Key;
1006 static int hf_infiniband_MCMemberRecord_RateSelector;
1007 static int hf_infiniband_MCMemberRecord_Rate;
1008 static int hf_infiniband_MCMemberRecord_PacketLifeTimeSelector;
1009 static int hf_infiniband_MCMemberRecord_PacketLifeTime;
1010 static int hf_infiniband_MCMemberRecord_SL;
1011 static int hf_infiniband_MCMemberRecord_FlowLabel;
1012 static int hf_infiniband_MCMemberRecord_HopLimit;
1013 static int hf_infiniband_MCMemberRecord_Scope;
1014 static int hf_infiniband_MCMemberRecord_JoinState;
1015 static int hf_infiniband_MCMemberRecord_ProxyJoin;
1017 /* TraceRecord */
1018 static int hf_infiniband_TraceRecord_GIDPrefix;
1019 static int hf_infiniband_TraceRecord_IDGeneration;
1020 static int hf_infiniband_TraceRecord_NodeType;
1021 static int hf_infiniband_TraceRecord_NodeID;
1022 static int hf_infiniband_TraceRecord_ChassisID;
1023 static int hf_infiniband_TraceRecord_EntryPortID;
1024 static int hf_infiniband_TraceRecord_ExitPortID;
1025 static int hf_infiniband_TraceRecord_EntryPort;
1026 static int hf_infiniband_TraceRecord_ExitPort;
1028 /* MultiPathRecord */
1029 static int hf_infiniband_MultiPathRecord_RawTraffic;
1030 static int hf_infiniband_MultiPathRecord_FlowLabel;
1031 static int hf_infiniband_MultiPathRecord_HopLimit;
1032 static int hf_infiniband_MultiPathRecord_TClass;
1033 static int hf_infiniband_MultiPathRecord_Reversible;
1034 static int hf_infiniband_MultiPathRecord_NumbPath;
1035 static int hf_infiniband_MultiPathRecord_P_Key;
1036 static int hf_infiniband_MultiPathRecord_SL;
1037 static int hf_infiniband_MultiPathRecord_MTUSelector;
1038 static int hf_infiniband_MultiPathRecord_MTU;
1039 static int hf_infiniband_MultiPathRecord_RateSelector;
1040 static int hf_infiniband_MultiPathRecord_Rate;
1041 static int hf_infiniband_MultiPathRecord_PacketLifeTimeSelector;
1042 static int hf_infiniband_MultiPathRecord_PacketLifeTime;
1043 static int hf_infiniband_MultiPathRecord_IndependenceSelector;
1044 static int hf_infiniband_MultiPathRecord_GIDScope;
1045 static int hf_infiniband_MultiPathRecord_SGIDCount;
1046 static int hf_infiniband_MultiPathRecord_DGIDCount;
1047 static int hf_infiniband_MultiPathRecord_SDGID;
1049 /* ClassPortInfo */
1050 static int hf_infiniband_ClassPortInfo_BaseVersion;
1051 static int hf_infiniband_ClassPortInfo_ClassVersion;
1052 static int hf_infiniband_ClassPortInfo_CapabilityMask;
1053 static int hf_infiniband_ClassPortInfo_CapabilityMask2;
1054 static int hf_infiniband_ClassPortInfo_RespTimeValue;
1055 static int hf_infiniband_ClassPortInfo_RedirectGID;
1056 static int hf_infiniband_ClassPortInfo_RedirectTC;
1057 static int hf_infiniband_ClassPortInfo_RedirectSL;
1058 static int hf_infiniband_ClassPortInfo_RedirectFL;
1059 static int hf_infiniband_ClassPortInfo_RedirectLID;
1060 static int hf_infiniband_ClassPortInfo_RedirectP_Key;
1061 static int hf_infiniband_ClassPortInfo_Reserved;
1062 static int hf_infiniband_ClassPortInfo_RedirectQP;
1063 static int hf_infiniband_ClassPortInfo_RedirectQ_Key;
1064 static int hf_infiniband_ClassPortInfo_TrapGID;
1065 static int hf_infiniband_ClassPortInfo_TrapTC;
1066 static int hf_infiniband_ClassPortInfo_TrapSL;
1067 static int hf_infiniband_ClassPortInfo_TrapFL;
1068 static int hf_infiniband_ClassPortInfo_TrapLID;
1069 static int hf_infiniband_ClassPortInfo_TrapP_Key;
1070 static int hf_infiniband_ClassPortInfo_TrapQP;
1071 static int hf_infiniband_ClassPortInfo_TrapQ_Key;
1073 /* Notice */
1074 static int hf_infiniband_Notice_IsGeneric;
1075 static int hf_infiniband_Notice_Type;
1076 static int hf_infiniband_Notice_ProducerTypeVendorID;
1077 static int hf_infiniband_Notice_TrapNumberDeviceID;
1078 static int hf_infiniband_Notice_IssuerLID;
1079 static int hf_infiniband_Notice_NoticeToggle;
1080 static int hf_infiniband_Notice_NoticeCount;
1081 static int hf_infiniband_Notice_DataDetails;
1082 /* static int hf_infiniband_Notice_IssuerGID; */
1083 /* static int hf_infiniband_Notice_ClassTrapSpecificData; */
1085 /* ClassPortInfo attribute in Performance class */
1086 static int hf_infiniband_PerfMgt_ClassPortInfo;
1088 /* PortCounters attribute in Performance class */
1089 static int hf_infiniband_PortCounters;
1090 static int hf_infiniband_PortCounters_PortSelect;
1091 static int hf_infiniband_PortCounters_CounterSelect;
1092 static int hf_infiniband_PortCounters_SymbolErrorCounter;
1093 static int hf_infiniband_PortCounters_LinkErrorRecoveryCounter;
1094 static int hf_infiniband_PortCounters_LinkDownedCounter;
1095 static int hf_infiniband_PortCounters_PortRcvErrors;
1096 static int hf_infiniband_PortCounters_PortRcvRemotePhysicalErrors;
1097 static int hf_infiniband_PortCounters_PortRcvSwitchRelayErrors;
1098 static int hf_infiniband_PortCounters_PortXmitDiscards;
1099 static int hf_infiniband_PortCounters_PortXmitConstraintErrors;
1100 static int hf_infiniband_PortCounters_PortRcvConstraintErrors;
1101 static int hf_infiniband_PortCounters_LocalLinkIntegrityErrors;
1102 static int hf_infiniband_PortCounters_ExcessiveBufferOverrunErrors;
1103 static int hf_infiniband_PortCounters_VL15Dropped;
1104 static int hf_infiniband_PortCounters_PortXmitData;
1105 static int hf_infiniband_PortCounters_PortRcvData;
1106 static int hf_infiniband_PortCounters_PortXmitPkts;
1107 static int hf_infiniband_PortCounters_PortRcvPkts;
1109 /* Extended PortCounters attribute in Performance class */
1110 static int hf_infiniband_PortCountersExt;
1111 static int hf_infiniband_PortCountersExt_PortSelect;
1112 static int hf_infiniband_PortCountersExt_CounterSelect;
1113 static int hf_infiniband_PortCountersExt_PortXmitData;
1114 static int hf_infiniband_PortCountersExt_PortRcvData;
1115 static int hf_infiniband_PortCountersExt_PortXmitPkts;
1116 static int hf_infiniband_PortCountersExt_PortRcvPkts;
1117 static int hf_infiniband_PortCountersExt_PortUnicastXmitPkts;
1118 static int hf_infiniband_PortCountersExt_PortUnicastRcvPkts;
1119 static int hf_infiniband_PortCountersExt_PortMulticastXmitPkts;
1120 static int hf_infiniband_PortCountersExt_PortMulticastRcvPkts;
1122 /* Notice DataDetails and ClassTrapSpecific Data for certain traps
1123 * Note that traps reuse many fields, so they are only declared once under the first trap that they appear.
1124 * There is no need to redeclare them for specific Traps (as with other SA Attributes) because they are uniform between Traps. */
1126 /* Parse DataDetails for a given Trap */
1127 static int parse_NoticeDataDetails(proto_tree*, tvbuff_t*, int *offset, uint16_t trapNumber);
1129 /* Traps 64,65,66,67 */
1130 static int hf_infiniband_Trap_GIDADDR;
1132 /* Traps 68,69 */
1133 /* DataDetails */
1134 static int hf_infiniband_Trap_COMP_MASK;
1135 static int hf_infiniband_Trap_WAIT_FOR_REPATH;
1136 /* ClassTrapSpecificData */
1137 /* static int hf_infiniband_Trap_PATH_REC; */
1139 /* Trap 128 */
1140 static int hf_infiniband_Trap_LIDADDR;
1142 /* Trap 129, 130, 131 */
1143 static int hf_infiniband_Trap_PORTNO;
1145 /* Trap 144 */
1146 static int hf_infiniband_Trap_OtherLocalChanges;
1147 static int hf_infiniband_Trap_CAPABILITYMASK;
1148 static int hf_infiniband_Trap_LinkSpeecEnabledChange;
1149 static int hf_infiniband_Trap_LinkWidthEnabledChange;
1150 static int hf_infiniband_Trap_NodeDescriptionChange;
1152 /* Trap 145 */
1153 static int hf_infiniband_Trap_SYSTEMIMAGEGUID;
1155 /* Trap 256 */
1156 static int hf_infiniband_Trap_DRSLID;
1157 static int hf_infiniband_Trap_METHOD;
1158 static int hf_infiniband_Trap_ATTRIBUTEID;
1159 static int hf_infiniband_Trap_ATTRIBUTEMODIFIER;
1160 static int hf_infiniband_Trap_MKEY;
1161 static int hf_infiniband_Trap_DRNotice;
1162 static int hf_infiniband_Trap_DRPathTruncated;
1163 static int hf_infiniband_Trap_DRHopCount;
1164 static int hf_infiniband_Trap_DRNoticeReturnPath;
1166 /* Trap 257, 258 */
1167 static int hf_infiniband_Trap_LIDADDR1;
1168 static int hf_infiniband_Trap_LIDADDR2;
1169 static int hf_infiniband_Trap_KEY;
1170 static int hf_infiniband_Trap_SL;
1171 static int hf_infiniband_Trap_QP1;
1172 static int hf_infiniband_Trap_QP2;
1173 static int hf_infiniband_Trap_GIDADDR1;
1174 static int hf_infiniband_Trap_GIDADDR2;
1176 /* Trap 259 */
1177 static int hf_infiniband_Trap_DataValid;
1178 static int hf_infiniband_Trap_PKEY;
1179 static int hf_infiniband_Trap_SWLIDADDR;
1181 /* Infiniband Link */
1182 static int hf_infiniband_link_op;
1183 static int hf_infiniband_link_fctbs;
1184 static int hf_infiniband_link_vl;
1185 static int hf_infiniband_link_fccl;
1186 static int hf_infiniband_link_lpcrc;
1188 /* Trap Type/Descriptions for dissection */
1189 static const value_string Operand_Description[]= {
1190 { 0, " Normal Flow Control"},
1191 { 1, " Flow Control Init"},
1192 { 0, NULL}
1195 /* Trap Type/Descriptions for dissection */
1196 static const value_string Trap_Description[]= {
1197 { 64, " (Informational) <GIDADDR> is now in service"},
1198 { 65, " (Informational) <GIDADDR> is out of service"},
1199 { 66, " (Informational) New Multicast Group with multicast address <GIDADDR> is now created"},
1200 { 67, " (Informational) Multicast Group with multicast address <GIDADDR> is now deleted"},
1201 { 68, " (Informational) Paths indicated by <PATH_REC> and <COMP_MASK> are no longer valid"},
1202 { 69, " (Informational) Paths indicated by <PATH_REC> and <COMP_MASK> have been recomputed"},
1203 { 128, " (Urgent) Link State of at least one port of switch at <LIDADDR> has changed"},
1204 { 129, " (Urgent) Local Link Integrity threshold reached at <LIDADDR><PORTNO>"},
1205 { 130, " (Urgent) Excessive Buffer OVerrun threshold reached at <LIDADDR><PORTNO>"},
1206 { 131, " (Urgent) Flow Control Update watchdog timer expired at <LIDADDR><PORTNO>"},
1207 { 144, " (Informational) CapMask, NodeDesc, LinkWidthEnabled or LinkSpeedEnabled at <LIDADDR> has been modified"},
1208 { 145, " (Informational) SystemImageGUID at <LIDADDR> has been modified. New value is <SYSTEMIMAGEGUID>"},
1209 { 256, " (Security) Bad M_Key, <M_KEY> from <LIDADDR> attempted <METHOD> with <ATTRIBUTEID> and <ATTRIBUTEMODIFIER>"},
1210 { 257, " (Security) Bad P_Key, <KEY> from <LIDADDR1><GIDADDR1><QP1> to <LIDADDR2><GIDADDR2><QP2> on <SL>"},
1211 { 258, " (Security) Bad Q_Key, <KEY> from <LIDADDR1><GIDADDR1><QP1> to <LIDADDR2><GIDADDR2><QP2> on <SL>"},
1212 { 259, " (Security) Bad P_Key, <KEY> from <LIDADDR1><GIDADDR1><QP1> to <LIDADDR2><GIDADDR2><QP2> on <SL> at switch <LIDADDR><PORTNO>"},
1213 { 0, NULL}
1217 static const value_string bth_opcode_tbl[] = {
1218 { 0x0, "Reliable Connection (RC) - SEND First" },
1219 { 0x1, "Reliable Connection (RC) - SEND Middle" },
1220 { 0x2, "Reliable Connection (RC) - SEND Last" },
1221 { 0x3, "Reliable Connection (RC) - SEND Last with Immediate" },
1222 { 0x4, "Reliable Connection (RC) - SEND Only" },
1223 { 0x5, "Reliable Connection (RC) - SEND Only with Immediate" },
1224 { 0x6, "Reliable Connection (RC) - RDMA WRITE First" },
1225 { 0x7, "Reliable Connection (RC) - RDMA WRITE Middle" },
1226 { 0x8, "Reliable Connection (RC) - RDMA WRITE Last" },
1227 { 0x9, "Reliable Connection (RC) - RDMA WRITE Last with Immediate" },
1228 { 0xA, "Reliable Connection (RC) - RDMA WRITE Only" },
1229 { 0xB, "Reliable Connection (RC) - RDMA WRITE Only with Immediate" },
1230 { 0xC, "Reliable Connection (RC) - RDMA READ Request" },
1231 { 0xD, "Reliable Connection (RC) - RDMA READ response First" },
1232 { 0xE, "Reliable Connection (RC) - RDMA READ response Middle" },
1233 { 0xF, "Reliable Connection (RC) - RDMA READ response Last" },
1234 { 0x10, "Reliable Connection (RC) - RDMA READ response Only" },
1235 { 0x11, "Reliable Connection (RC) - Acknowledge" },
1236 { 0x12, "Reliable Connection (RC) - ATOMIC Acknowledge" },
1237 { 0x13, "Reliable Connection (RC) - CmpSwap" },
1238 { 0x14, "Reliable Connection (RC) - FetchAdd" },
1239 { 0x15, "Reliable Connection (RC) - Reserved" },
1240 { 0x16, "Reliable Connection (RC) - SEND Last with Invalidate" },
1241 { 0x17, "Reliable Connection (RC) - SEND Only with Invalidate" },
1242 { 0x1C, "Reliable Connection (RC) - FLUSH" },
1243 { 0x1D, "Reliable Connection (RC) - ATOMIC WRITE" },
1244 { 0x20, "Unreliable Connection (UC) - SEND First" },
1245 { 0x21, "Unreliable Connection (UC) - SEND Middle" },
1246 { 0x22, "Unreliable Connection (UC) - SEND Last" },
1247 { 0x23, "Unreliable Connection (UC) - SEND Last with Immediate" },
1248 { 0x24, "Unreliable Connection (UC) - SEND Only" },
1249 { 0x25, "Unreliable Connection (UC) - SEND Only with Immediate" },
1250 { 0x26, "Unreliable Connection (UC) - RDMA WRITE First" },
1251 { 0x27, "Unreliable Connection (UC) - RDMA WRITE Middle" },
1252 { 0x28, "Unreliable Connection (UC) - RDMA WRITE Last" },
1253 { 0x29, "Unreliable Connection (UC) - RDMA WRITE Last with Immediate" },
1254 { 0x2A, "Unreliable Connection (UC) - RDMA WRITE Only" },
1255 { 0x2B, "Unreliable Connection (UC) - RDMA WRITE Only with Immediate" },
1256 { 0x40, "Reliable Datagram (RD) - SEND First" },
1257 { 0x41, "Reliable Datagram (RD) - SEND Middle" },
1258 { 0x42, "Reliable Datagram (RD) - SEND Last" },
1259 { 0x43, "Reliable Datagram (RD) - SEND Last with Immediate" },
1260 { 0x44, "Reliable Datagram (RD) - SEND Only" },
1261 { 0x45, "Reliable Datagram (RD) - SEND Only with Immediate" },
1262 { 0x46, "Reliable Datagram (RD) - RDMA WRITE First" },
1263 { 0x47, "Reliable Datagram (RD) - RDMA WRITE Middle" },
1264 { 0x48, "Reliable Datagram (RD) - RDMA WRITE Last" },
1265 { 0x49, "Reliable Datagram (RD) - RDMA WRITE Last with Immediate" },
1266 { 0x4A, "Reliable Datagram (RD) - RDMA WRITE Only" },
1267 { 0x4B, "Reliable Datagram (RD) - RDMA WRITE Only with Immediate" },
1268 { 0x4C, "Reliable Datagram (RD) - RDMA READ Request" },
1269 { 0x4D, "Reliable Datagram (RD) - RDMA READ response First" },
1270 { 0x4E, "Reliable Datagram (RD) - RDMA READ response Middle" },
1271 { 0x4F, "Reliable Datagram (RD) - RDMA READ response Last" },
1272 { 0x50, "Reliable Datagram (RD) - RDMA READ response Only" },
1273 { 0x51, "Reliable Datagram (RD) - Acknowledge" },
1274 { 0x52, "Reliable Datagram (RD) - ATOMIC Acknowledge" },
1275 { 0x53, "Reliable Datagram (RD) - CmpSwap" },
1276 { 0x54, "Reliable Datagram (RD) - FetchAdd" },
1277 { 0x55, "Reliable Datagram (RD) - RESYNC" },
1278 { 0x5C, "Reliable Datagram (RD) - FLUSH" },
1279 { 0x5D, "Reliable Datagram (RD) - ATOMIC WRITE" },
1280 { 0x64, "Unreliable Datagram (UD) - SEND only" },
1281 { 0x65, "Unreliable Datagram (UD) - SEND only with Immediate" },
1282 { 0x80, "CNP" },
1283 { 0xA0, "Extended Reliable Connection (XRC) - SEND First" },
1284 { 0xA1, "Extended Reliable Connection (XRC) - SEND Middle" },
1285 { 0xA2, "Extended Reliable Connection (XRC) - SEND Last" },
1286 { 0xA3, "Extended Reliable Connection (XRC) - SEND Last with Immediate" },
1287 { 0xA4, "Extended Reliable Connection (XRC) - SEND Only" },
1288 { 0xA5, "Extended Reliable Connection (XRC) - SEND Only with Immediate" },
1289 { 0xA6, "Extended Reliable Connection (XRC) - RDMA WRITE First" },
1290 { 0xA7, "Extended Reliable Connection (XRC) - RDMA WRITE Middle" },
1291 { 0xA8, "Extended Reliable Connection (XRC) - RDMA WRITE Last" },
1292 { 0xA9, "Extended Reliable Connection (XRC) - RDMA WRITE Last with Immediate" },
1293 { 0xAA, "Extended Reliable Connection (XRC) - RDMA WRITE Only" },
1294 { 0xAB, "Extended Reliable Connection (XRC) - RDMA WRITE Only with Immediate" },
1295 { 0xAC, "Extended Reliable Connection (XRC) - RDMA READ Request" },
1296 { 0xAD, "Extended Reliable Connection (XRC) - RDMA READ response First" },
1297 { 0xAE, "Extended Reliable Connection (XRC) - RDMA READ response Middle" },
1298 { 0xAF, "Extended Reliable Connection (XRC) - RDMA READ response Last" },
1299 { 0xB0, "Extended Reliable Connection (XRC) - RDMA READ response Only" },
1300 { 0xB1, "Extended Reliable Connection (XRC) - Acknowledge" },
1301 { 0xB2, "Extended Reliable Connection (XRC) - ATOMIC Acknowledge" },
1302 { 0xB3, "Extended Reliable Connection (XRC) - CmpSwap" },
1303 { 0xB4, "Extended Reliable Connection (XRC) - FetchAdd" },
1304 { 0xB6, "Extended Reliable Connection (XRC) - SEND Last with Invalidate" },
1305 { 0xB7, "Extended Reliable Connection (XRC) - SEND Only with Invalidate" },
1306 { 0xBC, "Extended Reliable Connection (XRC) - FLUSH" },
1307 { 0xBD, "Extended Reliable Connection (XRC) - ATOMIC WRITE" },
1308 { 0, NULL}
1311 #define AETH_SYNDROME_OPCODE_ACK 0
1312 #define AETH_SYNDROME_OPCODE_RNR_NAK 1
1313 #define AETH_SYNDROME_OPCODE_RES 2
1314 #define AETH_SYNDROME_OPCODE_NAK 3
1316 static const value_string aeth_syndrome_opcode_vals[]= {
1317 { AETH_SYNDROME_OPCODE_ACK, "Ack"},
1318 { AETH_SYNDROME_OPCODE_RNR_NAK, "RNR Nak"},
1319 { AETH_SYNDROME_OPCODE_RES, "Reserved"},
1320 { AETH_SYNDROME_OPCODE_NAK, "Nak"},
1321 { 0, NULL}
1324 static const value_string aeth_syndrome_nak_error_code_vals[]= {
1325 { 0, "PSN Sequence Error"},
1326 { 1, "Invalid Request"},
1327 { 2, "Remote Access Error"},
1328 { 3, "Remote Operational Error"},
1329 { 4, "Invalid RD Request"},
1330 { 0, NULL}
1333 static const value_string aeth_syndrome_timer_code_vals[]= {
1334 { 0, "655.36 ms"},
1335 { 1, "0.01 ms"},
1336 { 2, "0.02 ms"},
1337 { 3, "0.03 ms"},
1338 { 4, "0.04 ms"},
1339 { 5, "0.06 ms"},
1340 { 6, "0.08 ms"},
1341 { 7, "0.12 ms"},
1342 { 8, "0.16 ms"},
1343 { 9, "0.24 ms"},
1344 { 10, "0.32 ms"},
1345 { 11, "0.48 ms"},
1346 { 12, "0.64 ms"},
1347 { 13, "0.96 ms"},
1348 { 14, "1.28 ms"},
1349 { 15, "1.92 ms"},
1350 { 16, "2.56 ms"},
1351 { 17, "3.84 ms"},
1352 { 18, "5.12 ms"},
1353 { 19, "7.68 ms"},
1354 { 20, "10.24 ms"},
1355 { 21, "15.36 ms"},
1356 { 22, "20.48 ms"},
1357 { 23, "30.72 ms"},
1358 { 24, "40.96 ms"},
1359 { 25, "61.44 ms"},
1360 { 26, "81.92 ms"},
1361 { 27, "122.88 ms"},
1362 { 28, "163.84 ms"},
1363 { 29, "245.76 ms"},
1364 { 30, "327.68 ms"},
1365 { 31, "491.52 ms"},
1366 { 0, NULL}
1369 /* MAD Management Classes
1370 * Classes from the Common MAD Header
1372 * Management Class Name Class Description
1373 * ------------------------------------------------------------------------------------------------------------ */
1374 #define SUBN_LID_ROUTED 0x01 /* Subnet Management LID Route */
1375 #define SUBN_DIRECTED_ROUTE 0x81 /* Subnet Management Directed Route */
1376 #define SUBNADMN 0x03 /* Subnet Administration */
1377 #define PERF 0x04 /* Performance Management */
1378 #define BM 0x05 /* Baseboard Management (Tunneling of IB-ML commands through the IBA subnet) */
1379 #define DEV_MGT 0x06 /* Device Management */
1380 #define COM_MGT 0x07 /* Communication Management */
1381 #define SNMP 0x08 /* SNMP Tunneling (tunneling of the SNMP protocol through the IBA fabric) */
1382 #define VENDOR_1_START 0x09 /* Start of first Vendor Specific Range */
1383 #define VENDOR_1_END 0x0F /* End of first Vendor Specific Range */
1384 #define VENDOR_2_START 0x30 /* Start of second Vendor Specific Range */
1385 #define VENDOR_2_END 0x4F /* End of the second Vendor Specific Range */
1386 #define APPLICATION_START 0x10 /* Start of Application Specific Range */
1387 #define APPLICATION_END 0x2F /* End of Application Specific Range */
1389 /* Performance class Attributes */
1390 #define ATTR_PORT_COUNTERS 0x0012
1391 #define ATTR_PORT_COUNTERS_EXT 0x001D
1393 /* Link Next Header Values */
1394 #define IBA_GLOBAL 3
1395 #define IBA_LOCAL 2
1396 #define IP_NON_IBA 1
1397 #define RAW 0
1399 static const value_string OpCodeMap[] =
1401 { RC_SEND_FIRST, "RC Send First " },
1402 { RC_SEND_MIDDLE, "RC Send Middle "},
1403 { RC_SEND_LAST, "RC Send Last " },
1404 { RC_SEND_LAST_IMM, "RC Send Last Immediate "},
1405 { RC_SEND_ONLY, "RC Send Only "},
1406 { RC_SEND_ONLY_IMM, "RC Send Only Immediate "},
1407 { RC_RDMA_WRITE_FIRST, "RC RDMA Write First " },
1408 { RC_RDMA_WRITE_MIDDLE, "RC RDMA Write Middle "},
1409 { RC_RDMA_WRITE_LAST, "RC RDMA Write Last "},
1410 { RC_RDMA_WRITE_LAST_IMM, "RC RDMA Write Last Immediate " },
1411 { RC_RDMA_WRITE_ONLY, "RC RDMA Write Only " },
1412 { RC_RDMA_WRITE_ONLY_IMM, "RC RDMA Write Only Immediate "},
1413 { RC_RDMA_READ_REQUEST, "RC RDMA Read Request " },
1414 { RC_RDMA_READ_RESPONSE_FIRST, "RC RDMA Read Response First " },
1415 { RC_RDMA_READ_RESPONSE_MIDDLE, "RC RDMA Read Response Middle "},
1416 { RC_RDMA_READ_RESPONSE_LAST, "RC RDMA Read Response Last " },
1417 { RC_RDMA_READ_RESPONSE_ONLY, "RC RDMA Read Response Only "},
1418 { RC_ACKNOWLEDGE, "RC Acknowledge " },
1419 { RC_ATOMIC_ACKNOWLEDGE, "RC Atomic Acknowledge " },
1420 { RC_CMP_SWAP, "RC Compare Swap " },
1421 { RC_FETCH_ADD, "RC Fetch Add "},
1422 { RC_SEND_LAST_INVAL, "RC Send Last Invalidate "},
1423 { RC_SEND_ONLY_INVAL, "RC Send Only Invalidate " },
1424 { RC_FLUSH, "RC Flush " },
1425 { RC_ATOMIC_WRITE, "RC Atomic Write " },
1427 { RD_SEND_FIRST, "RD Send First "},
1428 { RD_SEND_MIDDLE, "RD Send Middle " },
1429 { RD_SEND_LAST, "RD Send Last "},
1430 { RD_SEND_LAST_IMM, "RD Last Immediate " },
1431 { RD_SEND_ONLY, "RD Send Only "},
1432 { RD_SEND_ONLY_IMM, "RD Send Only Immediate "},
1433 { RD_RDMA_WRITE_FIRST, "RD RDMA Write First "},
1434 { RD_RDMA_WRITE_MIDDLE, "RD RDMA Write Middle "},
1435 { RD_RDMA_WRITE_LAST, "RD RDMA Write Last "},
1436 { RD_RDMA_WRITE_LAST_IMM, "RD RDMA Write Last Immediate "},
1437 { RD_RDMA_WRITE_ONLY, "RD RDMA Write Only "},
1438 { RD_RDMA_WRITE_ONLY_IMM, "RD RDMA Write Only Immediate "},
1439 { RD_RDMA_READ_REQUEST, "RD RDMA Read Request "},
1440 { RD_RDMA_READ_RESPONSE_FIRST, "RD RDMA Read Response First "},
1441 { RD_RDMA_READ_RESPONSE_MIDDLE, "RD RDMA Read Response Middle "},
1442 { RD_RDMA_READ_RESPONSE_LAST, "RD RDMA Read Response Last "},
1443 { RD_RDMA_READ_RESPONSE_ONLY, "RD RDMA Read Response Only "},
1444 { RD_ACKNOWLEDGE, "RD Acknowledge "},
1445 { RD_ATOMIC_ACKNOWLEDGE, "RD Atomic Acknowledge "},
1446 { RD_CMP_SWAP, "RD Compare Swap "},
1447 { RD_FETCH_ADD, "RD Fetch Add "},
1448 { RD_RESYNC, "RD RESYNC "},
1449 { RD_FLUSH, "RD Flush "},
1450 { RD_ATOMIC_WRITE, "RD Atomic Write " },
1452 { UD_SEND_ONLY, "UD Send Only "},
1453 { UD_SEND_ONLY_IMM, "UD Send Only Immediate "},
1455 { UC_SEND_FIRST, "UC Send First "},
1456 { UC_SEND_MIDDLE, "UC Send Middle "},
1457 { UC_SEND_LAST, "UC Send Last "},
1458 { UC_SEND_LAST_IMM, "UC Send Last Immediate "},
1459 { UC_SEND_ONLY, "UC Send Only "},
1460 { UC_SEND_ONLY_IMM, "UC Send Only Immediate "},
1461 { UC_RDMA_WRITE_FIRST, "UC RDMA Write First"},
1462 { UC_RDMA_WRITE_MIDDLE, "UC RDMA Write Middle "},
1463 { UC_RDMA_WRITE_LAST, "UC RDMA Write Last "},
1464 { UC_RDMA_WRITE_LAST_IMM, "UC RDMA Write Last Immediate "},
1465 { UC_RDMA_WRITE_ONLY, "UC RDMA Write Only "},
1466 { UC_RDMA_WRITE_ONLY_IMM, "UC RDMA Write Only Immediate "},
1467 { 0, NULL}
1470 /* Mellanox DCT has the same opcodes as RD so will use the same RD macros */
1471 static const value_string DctOpCodeMap[] =
1473 { RD_SEND_FIRST, "DC Send First "},
1474 { RD_SEND_MIDDLE, "DC Send Middle " },
1475 { RD_SEND_LAST, "DC Send Last "},
1476 { RD_SEND_LAST_IMM, "DC Last Immediate " },
1477 { RD_SEND_ONLY, "DC Send Only "},
1478 { RD_SEND_ONLY_IMM, "DC Send Only Immediate "},
1479 { RD_RDMA_WRITE_FIRST, "DC RDMA Write First "},
1480 { RD_RDMA_WRITE_MIDDLE, "DC RDMA Write Middle "},
1481 { RD_RDMA_WRITE_LAST, "DC RDMA Write Last "},
1482 { RD_RDMA_WRITE_LAST_IMM, "DC RDMA Write Last Immediate "},
1483 { RD_RDMA_WRITE_ONLY, "DC RDMA Write Only "},
1484 { RD_RDMA_WRITE_ONLY_IMM, "DC RDMA Write Only Immediate "},
1485 { RD_RDMA_READ_REQUEST, "DC RDMA Read Request "},
1486 { RD_RDMA_READ_RESPONSE_FIRST, "DC RDMA Read Response First "},
1487 { RD_RDMA_READ_RESPONSE_MIDDLE, "DC RDMA Read Response Middle "},
1488 { RD_RDMA_READ_RESPONSE_LAST, "DC RDMA Read Response Last "},
1489 { RD_RDMA_READ_RESPONSE_ONLY, "DC RDMA Read Response Only "},
1490 { RD_ACKNOWLEDGE, "DC Acknowledge "},
1491 { RD_ATOMIC_ACKNOWLEDGE, "DC Atomic Acknowledge "},
1492 { RD_CMP_SWAP, "DC Compare Swap "},
1493 { RD_FETCH_ADD, "DC Fetch Add "},
1494 { RD_RESYNC, "DC Unknown Opcode "},
1495 { 0, NULL}
1498 /* Header Ordering Based on OPCODES
1499 * These are simply an enumeration of the possible header combinations defined by the IB Spec.
1500 * These enumerations
1501 * #DEFINE [HEADER_ORDER] [ENUM]
1502 * __________________________________ */
1503 #define RDETH_DETH_PAYLD 0
1504 /* __________________________________ */
1505 #define RDETH_DETH_RETH_PAYLD 1
1506 /* __________________________________ */
1507 #define RDETH_DETH_IMMDT_PAYLD 2
1508 /* __________________________________ */
1509 #define RDETH_DETH_RETH_IMMDT_PAYLD 3
1510 /* __________________________________ */
1511 #define RDETH_DETH_RETH 4
1512 /* __________________________________ */
1513 #define RDETH_AETH_PAYLD 5
1514 /* __________________________________ */
1515 #define RDETH_PAYLD 6
1516 /* __________________________________ */
1517 #define RDETH_AETH 7
1518 /* __________________________________ */
1519 #define RDETH_AETH_ATOMICACKETH 8
1520 /* __________________________________ */
1521 #define RDETH_DETH_ATOMICETH 9
1522 /* ___________________________________ */
1523 #define RDETH_DETH 10
1524 /* ___________________________________ */
1525 #define DETH_PAYLD 11
1526 /* ___________________________________ */
1527 #define DETH_IMMDT_PAYLD 12
1528 /* ___________________________________ */
1529 #define PAYLD 13
1530 /* ___________________________________ */
1531 #define IMMDT_PAYLD 14
1532 /* ___________________________________ */
1533 #define RETH_PAYLD 15
1534 /* ___________________________________ */
1535 #define RETH_IMMDT_PAYLD 16
1536 /* ___________________________________ */
1537 #define RETH 17
1538 /* ___________________________________ */
1539 #define AETH_PAYLD 18
1540 /* ___________________________________ */
1541 #define AETH 19
1542 /* ___________________________________ */
1543 #define AETH_ATOMICACKETH 20
1544 /* ___________________________________ */
1545 #define ATOMICETH 21
1546 /* ___________________________________ */
1547 #define IETH_PAYLD 22
1548 /* ___________________________________ */
1549 #define DCCETH 23
1550 /* ___________________________________ */
1551 #define FETH_RETH 24
1552 /* ___________________________________ */
1553 #define RDETH_FETH_RETH 25
1554 /* ___________________________________ */
1555 #define RDETH_RETH_PAYLD 26
1556 /* ___________________________________ */
1559 /* Infiniband transport services
1560 These are an enumeration of the transport services over which an IB packet
1561 might be sent. The values match the corresponding 3 bits of the opCode field
1562 in the BTH */
1563 #define TRANSPORT_RC 0
1564 #define TRANSPORT_UC 1
1565 #define TRANSPORT_RD 2
1566 #define TRANSPORT_UD 3
1568 #define AETH_SYNDROME_RES 0x80
1569 #define AETH_SYNDROME_OPCODE 0x60
1570 #define AETH_SYNDROME_VALUE 0x1F
1573 /* Array of all availavle OpCodes to make matching a bit easier.
1574 * The OpCodes dictate the header sequence following in the packet.
1575 * These arrays tell the dissector which headers must be decoded for the given OpCode. */
1576 static uint32_t opCode_RDETH_DETH_ATOMICETH[] = {
1577 RD_CMP_SWAP,
1578 RD_FETCH_ADD
1580 static uint32_t opCode_IETH_PAYLD[] = {
1581 RC_SEND_LAST_INVAL,
1582 RC_SEND_ONLY_INVAL
1584 static uint32_t opCode_ATOMICETH[] = {
1585 RC_CMP_SWAP,
1586 RC_FETCH_ADD
1588 static uint32_t opCode_RDETH_DETH_RETH_PAYLD[] = {
1589 RD_RDMA_WRITE_FIRST,
1590 RD_RDMA_WRITE_ONLY
1592 static uint32_t opCode_RETH_IMMDT_PAYLD[] = {
1593 RC_RDMA_WRITE_ONLY_IMM,
1594 UC_RDMA_WRITE_ONLY_IMM
1596 static uint32_t opCode_RDETH_DETH_IMMDT_PAYLD[] = {
1597 RD_SEND_LAST_IMM,
1598 RD_SEND_ONLY_IMM,
1599 RD_RDMA_WRITE_LAST_IMM
1602 static uint32_t opCode_RDETH_AETH_PAYLD[] = {
1603 RD_RDMA_READ_RESPONSE_FIRST,
1604 RD_RDMA_READ_RESPONSE_LAST,
1605 RD_RDMA_READ_RESPONSE_ONLY
1607 static uint32_t opCode_AETH_PAYLD[] = {
1608 RC_RDMA_READ_RESPONSE_FIRST,
1609 RC_RDMA_READ_RESPONSE_LAST,
1610 RC_RDMA_READ_RESPONSE_ONLY
1612 static uint32_t opCode_RETH_PAYLD[] = {
1613 RC_RDMA_WRITE_FIRST,
1614 RC_RDMA_WRITE_ONLY,
1615 UC_RDMA_WRITE_FIRST,
1616 UC_RDMA_WRITE_ONLY
1619 static uint32_t opCode_RDETH_DETH_PAYLD[] = {
1620 RD_SEND_FIRST,
1621 RD_SEND_MIDDLE,
1622 RD_SEND_LAST,
1623 RD_SEND_ONLY,
1624 RD_RDMA_WRITE_MIDDLE,
1625 RD_RDMA_WRITE_LAST
1628 static uint32_t opCode_IMMDT_PAYLD[] = {
1629 RC_SEND_LAST_IMM,
1630 RC_SEND_ONLY_IMM,
1631 RC_RDMA_WRITE_LAST_IMM,
1632 UC_SEND_LAST_IMM,
1633 UC_SEND_ONLY_IMM,
1634 UC_RDMA_WRITE_LAST_IMM
1637 static uint32_t opCode_PAYLD[] = {
1638 RC_SEND_FIRST,
1639 RC_SEND_MIDDLE,
1640 RC_SEND_LAST,
1641 RC_SEND_ONLY,
1642 RC_RDMA_WRITE_MIDDLE,
1643 RC_RDMA_WRITE_LAST,
1644 RC_RDMA_READ_RESPONSE_MIDDLE,
1645 UC_SEND_FIRST,
1646 UC_SEND_MIDDLE,
1647 UC_SEND_LAST,
1648 UC_SEND_ONLY,
1649 UC_RDMA_WRITE_MIDDLE,
1650 UC_RDMA_WRITE_LAST
1653 /* It is not necessary to create arrays for these OpCodes since they indicate only one further header.
1654 * We can just decode it directly
1656 * static uint32_t opCode_DETH_IMMDT_PAYLD[] = {
1657 * UD_SEND_ONLY_IMM
1658 * };
1659 * static uint32_t opCode_DETH_PAYLD[] = {
1660 * UD_SEND_ONLY
1661 * };
1662 * static uint32_t opCode_RDETH_DETH[] = {
1663 * RD_RESYNC
1664 * };
1665 * static uint32_t opCode_RDETH_DETH_RETH[] = {
1666 * RD_RDMA_READ_REQUEST
1667 * };
1668 * static uint32_t opCode_RDETH_DETH_RETH_IMMDT_PAYLD[] = {
1669 * RD_RDMA_WRITE_ONLY_IMM
1670 * };
1671 * static uint32_t opCode_RDETH_AETH_ATOMICACKETH[] = {
1672 * RD_ATOMIC_ACKNOWLEDGE
1673 * };
1674 * static uint32_t opCode_RDETH_AETH[] = {
1675 * RD_ACKNOWLEDGE
1676 * };
1677 * static uint32_t opCode_RDETH_PAYLD[] = {
1678 * RD_RDMA_READ_RESPONSE_MIDDLE
1679 * };
1680 * static uint32_t opCode_AETH_ATOMICACKETH[] = {
1681 * RC_ATOMIC_ACKNOWLEDGE
1682 * };
1683 * static uint32_t opCode_RETH[] = {
1684 * RC_RDMA_READ_REQUEST
1685 * };
1686 * static uint32_t opCode_AETH[] = {
1687 * RC_ACKNOWLEDGE
1688 * }; */
1690 /* settings to be set by the user via the preferences dialog */
1691 static unsigned pref_rroce_udp_port = DEFAULT_RROCE_UDP_PORT;
1692 static bool try_heuristic_first = true;
1694 /* saves information about connections that have been/are in the process of being
1695 negotiated via ConnectionManagement packets */
1696 typedef struct {
1697 uint8_t req_gid[GID_SIZE],
1698 resp_gid[GID_SIZE]; /* GID of requester/responder, respectively */
1699 uint16_t req_lid,
1700 resp_lid; /* LID of requester/responder, respectively */
1701 uint32_t req_qp,
1702 resp_qp; /* QP number of requester/responder, respectively */
1703 uint64_t service_id; /* service id for this connection */
1704 } connection_context;
1706 /* holds a table of connection contexts being negotiated by CM. the key is a obtained
1707 using add_address_to_hash64(initiator address, TransactionID) */
1708 static GHashTable *CM_context_table;
1710 /* heuristics sub-dissectors list for dissecting the data payload of IB packets */
1711 static heur_dissector_list_t heur_dissectors_payload;
1712 /* heuristics sub-dissectors list for dissecting the PrivateData of CM packets */
1713 static heur_dissector_list_t heur_dissectors_cm_private;
1715 /* ----- This sections contains various utility functions indirectly related to Infiniband dissection ---- */
1716 static void infiniband_payload_prompt(packet_info *pinfo _U_, char* result)
1718 snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect Infiniband payload as");
1721 static void table_destroy_notify(void *data) {
1722 g_free(data);
1725 /* --------------------------------------------------------------------------------------------------------*/
1726 /* Helper dissector for correctly dissecting RRoCE packets (encapsulated within an IP */
1727 /* frame). The only difference from regular IB packets is that RRoCE packets do not contain */
1728 /* a LRH, and always start with a BTH. */
1729 static int
1730 dissect_rroce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1732 /* this is a RRoCE packet, so signal the IB dissector not to look for LRH/GRH */
1733 dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_BTH);
1734 return tvb_captured_length(tvb);
1737 /* Helper dissector for correctly dissecting RoCE packets (encapsulated within an Ethernet */
1738 /* frame). The only difference from regular IB packets is that RoCE packets do not contain */
1739 /* a LRH, and always start with a GRH. */
1740 static int
1741 dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1743 /* this is a RoCE packet, so signal the IB dissector not to look for LRH */
1744 dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_GRH);
1745 return tvb_captured_length(tvb);
1748 static int
1749 dissect_infiniband(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1751 dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_LRH);
1752 return tvb_captured_length(tvb);
1755 /* Common Dissector for both InfiniBand and RoCE packets
1756 * IN:
1757 * tvb - The tvbbuff of packet data
1758 * pinfo - The packet info structure with column information
1759 * tree - The tree structure under which field nodes are to be added
1760 * starts_with - regular IB packet starts with LRH, ROCE starts with GRH and RROCE starts with BTH,
1761 * this tells the parser what headers of (LRH/GRH) to skip.
1762 * Notes:
1763 * 1.) Floating "offset+=" statements should probably be "functionized" but they are inline
1764 * Offset is only passed by reference in specific places, so do not be confused when following code
1765 * In any code path, adding up "offset+=" statements will tell you what byte you are at */
1766 static void
1767 dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ib_packet_start_header starts_with)
1769 /* Top Level Item */
1770 proto_item *infiniband_packet;
1772 /* The Headers Subtree */
1773 proto_tree *all_headers_tree;
1775 /* BTH - Base Transport Header */
1776 bool dctBthHeader = false;
1777 int bthSize = 12;
1779 /* LRH - Local Route Header */
1780 proto_item *local_route_header_item;
1781 proto_tree *local_route_header_tree;
1783 /* Raw Data */
1784 proto_item *RAWDATA_header_item;
1785 uint8_t lnh_val; /* Link Next Header Value */
1786 int offset = 0; /* Current Offset */
1788 /* General Variables */
1789 bool bthFollows = false; /* Tracks if we are parsing a BTH. This is a significant decision point */
1790 struct infinibandinfo info = { NULL, 0, 0, 0, 0, 0, 0, 0, false};
1791 int32_t nextHeaderSequence = -1; /* defined by this dissector. #define which indicates the upcoming header sequence from OpCode */
1792 uint8_t nxtHdr = 0; /* Keyed off for header dissection order */
1793 uint16_t packetLength = 0; /* Packet Length. We track this as tvb_length - offset. */
1794 /* It provides the parsing methods a known size */
1795 /* that must be available for that header. */
1796 int crc_length = 0;
1797 int crclen = 6;
1799 void *src_addr, /* the address to be displayed in the source/destination columns */
1800 *dst_addr; /* (lid/gid number) will be stored here */
1802 pinfo->srcport = pinfo->destport = 0xffffffff; /* set the src/dest QPN to something impossible instead of the default 0,
1803 so we don't mistake it for a MAD. (QP is only 24bit, so can't be 0xffffffff)*/
1805 pinfo->ptype = PT_IBQP; /* set the port-type for this packet to be Infiniband QP number */
1807 /* Mark the Packet type as Infiniband in the wireshark UI */
1808 /* Clear other columns */
1809 col_set_str(pinfo->cinfo, COL_PROTOCOL, "InfiniBand");
1810 col_clear(pinfo->cinfo, COL_INFO);
1812 /* Top Level Packet */
1813 infiniband_packet = proto_tree_add_item(tree, proto_infiniband, tvb, offset, -1, ENC_NA);
1815 /* Headers Level Tree */
1816 all_headers_tree = proto_item_add_subtree(infiniband_packet, ett_all_headers);
1818 if (starts_with == IB_PACKET_STARTS_WITH_GRH) {
1819 /* this is a RoCE packet, skip LRH parsing */
1820 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RoCE");
1821 lnh_val = IBA_GLOBAL;
1822 packetLength = tvb_reported_length_remaining(tvb, offset);
1823 crclen = 4;
1824 goto skip_lrh;
1826 else if (starts_with == IB_PACKET_STARTS_WITH_BTH) {
1827 /* this is a RRoCE packet, skip LRH/GRH parsing and go directly to BTH */
1828 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRoCE");
1829 lnh_val = IBA_LOCAL;
1830 packetLength = tvb_reported_length_remaining(tvb, offset);
1831 crclen = 4;
1832 goto skip_lrh;
1835 /* Local Route Header Subtree */
1836 local_route_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_LRH, tvb, offset, 8, ENC_NA);
1837 proto_item_set_text(local_route_header_item, "%s", "Local Route Header");
1838 local_route_header_tree = proto_item_add_subtree(local_route_header_item, ett_lrh);
1840 proto_tree_add_item(local_route_header_tree, hf_infiniband_virtual_lane, tvb, offset, 1, ENC_BIG_ENDIAN);
1842 proto_tree_add_item(local_route_header_tree, hf_infiniband_link_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1843 offset += 1;
1844 proto_tree_add_item(local_route_header_tree, hf_infiniband_service_level, tvb, offset, 1, ENC_BIG_ENDIAN);
1846 proto_tree_add_item(local_route_header_tree, hf_infiniband_reserved2, tvb, offset, 1, ENC_NA);
1847 proto_tree_add_item(local_route_header_tree, hf_infiniband_link_next_header, tvb, offset, 1, ENC_BIG_ENDIAN);
1850 /* Save Link Next Header... This tells us what the next header is. */
1851 lnh_val = tvb_get_uint8(tvb, offset);
1852 lnh_val = lnh_val & 0x03;
1853 offset += 1;
1856 proto_tree_add_item(local_route_header_tree, hf_infiniband_destination_local_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1859 /* Set destination in packet view. */
1860 dst_addr = wmem_alloc(pinfo->pool, sizeof(uint16_t));
1861 *((uint16_t*) dst_addr) = tvb_get_ntohs(tvb, offset);
1862 set_address(&pinfo->dst, AT_IB, sizeof(uint16_t), dst_addr);
1864 offset += 2;
1866 proto_tree_add_item(local_route_header_tree, hf_infiniband_reserved5, tvb, offset, 2, ENC_BIG_ENDIAN);
1868 packetLength = tvb_get_ntohs(tvb, offset); /* Get the Packet Length. This will determine payload size later on. */
1869 packetLength = packetLength & 0x07FF; /* Mask off top 5 bits, they are reserved */
1870 packetLength = packetLength * 4; /* Multiply by 4 to get true byte length. This is by specification. */
1871 /* PktLen is size in 4 byte words (byteSize /4). */
1873 proto_tree_add_item(local_route_header_tree, hf_infiniband_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1874 offset += 2;
1875 proto_tree_add_item(local_route_header_tree, hf_infiniband_source_local_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1877 /* Set Source in packet view. */
1878 src_addr = wmem_alloc(pinfo->pool, sizeof(uint16_t));
1879 *((uint16_t*) src_addr) = tvb_get_ntohs(tvb, offset);
1880 set_address(&pinfo->src, AT_IB, sizeof(uint16_t), src_addr);
1882 offset += 2;
1883 packetLength -= 8; /* Shave 8 bytes for the LRH. */
1885 skip_lrh:
1887 /* Key off Link Next Header. This tells us what High Level Data Format we have */
1888 switch (lnh_val)
1890 case IBA_GLOBAL: {
1891 proto_item *global_route_header_item;
1892 proto_tree *global_route_header_tree;
1894 global_route_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_GRH, tvb, offset, 40, ENC_NA);
1895 proto_item_set_text(global_route_header_item, "%s", "Global Route Header");
1896 global_route_header_tree = proto_item_add_subtree(global_route_header_item, ett_grh);
1898 proto_tree_add_item(global_route_header_tree, hf_infiniband_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1899 proto_tree_add_item(global_route_header_tree, hf_infiniband_traffic_class, tvb, offset, 2, ENC_BIG_ENDIAN);
1900 proto_tree_add_item(global_route_header_tree, hf_infiniband_flow_label, tvb, offset, 4, ENC_BIG_ENDIAN);
1901 offset += 4;
1903 proto_tree_add_item(global_route_header_tree, hf_infiniband_payload_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1904 offset += 2;
1906 nxtHdr = tvb_get_uint8(tvb, offset);
1908 proto_tree_add_item(global_route_header_tree, hf_infiniband_next_header, tvb, offset, 1, ENC_BIG_ENDIAN);
1909 offset += 1;
1910 proto_tree_add_item(global_route_header_tree, hf_infiniband_hop_limit, tvb, offset, 1, ENC_BIG_ENDIAN);
1911 offset += 1;
1912 proto_tree_add_item(global_route_header_tree, hf_infiniband_source_gid, tvb, offset, 16, ENC_NA);
1914 /* set source GID in packet view*/
1915 set_address_tvb(&pinfo->src, AT_IB, GID_SIZE, tvb, offset);
1916 offset += 16;
1918 proto_tree_add_item(global_route_header_tree, hf_infiniband_destination_gid, tvb, offset, 16, ENC_NA);
1919 /* set destination GID in packet view*/
1920 set_address_tvb(&pinfo->dst, AT_IB, GID_SIZE, tvb, offset);
1922 offset += 16;
1923 packetLength -= 40; /* Shave 40 bytes for GRH */
1925 if (nxtHdr != 0x1B)
1927 /* Some kind of packet being transported globally with IBA, but locally it is not IBA - no BTH following. */
1928 break;
1931 /* otherwise fall through and start parsing BTH */
1932 /* FALL THROUGH */
1933 case IBA_LOCAL: {
1934 proto_item *base_transport_header_item;
1935 proto_tree *base_transport_header_tree;
1936 bthFollows = true;
1937 /* Get the OpCode - this tells us what headers are following */
1938 info.opCode = tvb_get_uint8(tvb, offset);
1939 info.pad_count = (tvb_get_uint8(tvb, offset+1) & 0x30) >> 4;
1941 if ((info.opCode >> 5) == 0x2) {
1942 info.dctConnect = !(tvb_get_uint8(tvb, offset + 1) & 0x80);
1943 dctBthHeader = true;
1944 bthSize += 8;
1947 base_transport_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_BTH, tvb, offset, bthSize, ENC_NA);
1948 proto_item_set_text(base_transport_header_item, "%s", "Base Transport Header");
1949 base_transport_header_tree = proto_item_add_subtree(base_transport_header_item, ett_bth);
1950 proto_tree_add_item(base_transport_header_tree, hf_infiniband_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1952 if (dctBthHeader) {
1953 /* since DCT uses the same opcodes as RD we will use another name mapping */
1954 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const((uint32_t)info.opCode, DctOpCodeMap, "Unknown OpCode "));
1956 else {
1957 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const((uint32_t)info.opCode, OpCodeMap, "Unknown OpCode "));
1959 offset += 1;
1961 proto_tree_add_item(base_transport_header_tree, hf_infiniband_solicited_event, tvb, offset, 1, ENC_BIG_ENDIAN);
1962 proto_tree_add_item(base_transport_header_tree, hf_infiniband_migreq, tvb, offset, 1, ENC_BIG_ENDIAN);
1963 proto_tree_add_item(base_transport_header_tree, hf_infiniband_pad_count, tvb, offset, 1, ENC_BIG_ENDIAN);
1964 proto_tree_add_item(base_transport_header_tree, hf_infiniband_transport_header_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1965 offset += 1;
1966 proto_tree_add_item(base_transport_header_tree, hf_infiniband_partition_key, tvb, offset, 2, ENC_BIG_ENDIAN);
1967 offset += 2;
1968 proto_tree_add_item(base_transport_header_tree, hf_infiniband_reserved, tvb, offset, 1, ENC_NA);
1969 offset += 1;
1970 proto_tree_add_item_ret_uint(base_transport_header_tree, hf_infiniband_destination_qp, tvb, offset, 3, ENC_BIG_ENDIAN, &pinfo->destport);
1971 col_append_fstr(pinfo->cinfo, COL_INFO, "QP=0x%06x ", pinfo->destport);
1972 offset += 3;
1973 proto_tree_add_item(base_transport_header_tree, hf_infiniband_acknowledge_request, tvb, offset, 1, ENC_BIG_ENDIAN);
1974 proto_tree_add_item(base_transport_header_tree, hf_infiniband_reserved7, tvb, offset, 1, ENC_BIG_ENDIAN);
1975 offset += 1;
1976 proto_tree_add_item_ret_uint(base_transport_header_tree, hf_infiniband_packet_sequence_number, tvb, offset, 3, ENC_BIG_ENDIAN, &info.packet_seq_num);
1977 offset += 3;
1978 offset += bthSize - 12;
1979 packetLength -= bthSize; /* Shave bthSize for Base Transport Header */
1981 break;
1982 case IP_NON_IBA:
1983 /* Raw IPv6 Packet */
1984 dst_addr = wmem_strdup(pinfo->pool, "IPv6 over IB Packet");
1985 set_address(&pinfo->dst, AT_STRINGZ, (int)strlen((char *)dst_addr)+1, dst_addr);
1987 parse_IPvSix(all_headers_tree, tvb, &offset, pinfo);
1988 break;
1989 case RAW:
1990 parse_RWH(all_headers_tree, tvb, &offset, pinfo, tree);
1991 break;
1992 default:
1993 /* Unknown Packet */
1994 RAWDATA_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_raw_data, tvb, offset, -1, ENC_NA);
1995 proto_item_set_text(RAWDATA_header_item, "%s", "Unknown Raw Data - IB Encapsulated");
1996 break;
1999 /* Base Transport header is hit quite often, however it is alone since it is the exception not the rule */
2000 /* Only IBA Local packets use it */
2001 if (bthFollows)
2003 /* Find our next header sequence based on the Opcode
2004 * Each case decrements the packetLength by the amount of bytes consumed by each header.
2005 * The find_next_header_sequence method could be used to automate this.
2006 * We need to keep track of this so we know much data to mark as payload/ICRC/VCRC values. */
2008 nextHeaderSequence = find_next_header_sequence(&info);
2010 /* find_next_header_sequence gives us the DEFINE value corresponding to the header order following */
2011 /* Enumerations are named intuitively, e.g. RDETH DETH PAYLOAD means there is an RDETH Header, DETH Header, and a packet payload */
2012 switch (nextHeaderSequence)
2014 case RDETH_DETH_PAYLD:
2015 parse_RDETH(all_headers_tree, tvb, &offset);
2016 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2018 packetLength -= 4; /* RDETH */
2019 packetLength -= 8; /* DETH */
2021 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2022 break;
2023 case RDETH_DETH_RETH_PAYLD:
2024 parse_RDETH(all_headers_tree, tvb, &offset);
2025 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2026 parse_RETH(all_headers_tree, tvb, &offset, &info);
2028 packetLength -= 4; /* RDETH */
2029 packetLength -= 8; /* DETH */
2030 packetLength -= 16; /* RETH */
2032 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2033 break;
2034 case RDETH_DETH_IMMDT_PAYLD:
2035 parse_RDETH(all_headers_tree, tvb, &offset);
2036 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2037 parse_IMMDT(all_headers_tree, tvb, &offset);
2039 packetLength -= 4; /* RDETH */
2040 packetLength -= 8; /* DETH */
2041 packetLength -= 4; /* IMMDT */
2043 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2044 break;
2045 case RDETH_DETH_RETH_IMMDT_PAYLD:
2046 parse_RDETH(all_headers_tree, tvb, &offset);
2047 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2048 parse_RETH(all_headers_tree, tvb, &offset, &info);
2049 parse_IMMDT(all_headers_tree, tvb, &offset);
2051 packetLength -= 4; /* RDETH */
2052 packetLength -= 8; /* DETH */
2053 packetLength -= 16; /* RETH */
2054 packetLength -= 4; /* IMMDT */
2056 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2057 break;
2058 case RDETH_DETH_RETH:
2059 parse_RDETH(all_headers_tree, tvb, &offset);
2060 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2061 parse_RETH(all_headers_tree, tvb, &offset, &info);
2063 /*packetLength -= 4;*/ /* RDETH */
2064 /*packetLength -= 8;*/ /* DETH */
2065 /*packetLength -= 16;*/ /* RETH */
2067 break;
2068 case RDETH_AETH_PAYLD:
2069 parse_RDETH(all_headers_tree, tvb, &offset);
2070 parse_AETH(all_headers_tree, tvb, &offset, pinfo);
2072 packetLength -= 4; /* RDETH */
2073 packetLength -= 4; /* AETH */
2075 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2076 break;
2077 case RDETH_PAYLD:
2078 parse_RDETH(all_headers_tree, tvb, &offset);
2080 packetLength -= 4; /* RDETH */
2082 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2083 break;
2084 case RDETH_AETH:
2085 parse_AETH(all_headers_tree, tvb, &offset, pinfo);
2087 /*packetLength -= 4;*/ /* RDETH */
2088 /*packetLength -= 4;*/ /* AETH */
2091 break;
2092 case RDETH_AETH_ATOMICACKETH:
2093 parse_RDETH(all_headers_tree, tvb, &offset);
2094 parse_AETH(all_headers_tree, tvb, &offset, pinfo);
2095 parse_ATOMICACKETH(all_headers_tree, tvb, &offset);
2097 /*packetLength -= 4;*/ /* RDETH */
2098 /*packetLength -= 4;*/ /* AETH */
2099 /*packetLength -= 8;*/ /* AtomicAckETH */
2102 break;
2103 case RDETH_DETH_ATOMICETH:
2104 parse_RDETH(all_headers_tree, tvb, &offset);
2105 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2106 parse_ATOMICETH(all_headers_tree, tvb, &offset);
2108 /*packetLength -= 4;*/ /* RDETH */
2109 /*packetLength -= 8;*/ /* DETH */
2110 /*packetLength -= 28;*/ /* AtomicETH */
2112 break;
2113 case RDETH_DETH:
2114 parse_RDETH(all_headers_tree, tvb, &offset);
2115 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2117 /*packetLength -= 4;*/ /* RDETH */
2118 /*packetLength -= 8;*/ /* DETH */
2120 break;
2121 case DETH_PAYLD:
2122 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2124 packetLength -= 8; /* DETH */
2126 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2127 break;
2128 case PAYLD:
2130 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2131 break;
2132 case IMMDT_PAYLD:
2133 parse_IMMDT(all_headers_tree, tvb, &offset);
2135 packetLength -= 4; /* IMMDT */
2137 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2138 break;
2139 case RETH_IMMDT_PAYLD:
2140 parse_RETH(all_headers_tree, tvb, &offset, &info);
2141 parse_IMMDT(all_headers_tree, tvb, &offset);
2143 packetLength -= 16; /* RETH */
2144 packetLength -= 4; /* IMMDT */
2146 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2147 break;
2148 case RETH_PAYLD:
2149 parse_RETH(all_headers_tree, tvb, &offset, &info);
2151 packetLength -= 16; /* RETH */
2153 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2154 break;
2155 case RETH:
2156 parse_RETH(all_headers_tree, tvb, &offset, &info);
2158 packetLength -= 16; /* RETH */
2159 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2161 break;
2162 case AETH_PAYLD:
2163 parse_AETH(all_headers_tree, tvb, &offset, pinfo);
2165 packetLength -= 4; /* AETH */
2167 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2168 break;
2169 case AETH:
2170 parse_AETH(all_headers_tree, tvb, &offset, pinfo);
2172 /*packetLength -= 4;*/ /* AETH */
2174 break;
2175 case AETH_ATOMICACKETH:
2176 parse_AETH(all_headers_tree, tvb, &offset, pinfo);
2177 parse_ATOMICACKETH(all_headers_tree, tvb, &offset);
2179 /*packetLength -= 4;*/ /* AETH */
2180 /*packetLength -= 8;*/ /* AtomicAckETH */
2182 break;
2183 case ATOMICETH:
2184 parse_ATOMICETH(all_headers_tree, tvb, &offset);
2186 /*packetLength -= 28;*/ /* AtomicETH */
2188 break;
2189 case IETH_PAYLD:
2190 parse_IETH(all_headers_tree, tvb, &offset);
2192 packetLength -= 4; /* IETH */
2194 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2195 break;
2196 case DETH_IMMDT_PAYLD:
2197 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2198 parse_IMMDT(all_headers_tree, tvb, &offset);
2200 packetLength -= 8; /* DETH */
2201 packetLength -= 4; /* IMMDT */
2203 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2204 break;
2205 case DCCETH:
2206 parse_DCCETH(all_headers_tree, tvb, &offset);
2207 packetLength -= 16; /* DCCETH */
2209 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2210 break;
2211 case FETH_RETH:
2212 parse_FETH(all_headers_tree, tvb, &offset);
2213 parse_RETH(all_headers_tree, tvb, &offset, &info);
2215 /*packetLength -= 4;*/ /* FETH */
2216 /*packetLength -= 16;*/ /* RETH */
2217 break;
2218 case RDETH_FETH_RETH:
2219 parse_RDETH(all_headers_tree, tvb, &offset);
2220 parse_FETH(all_headers_tree, tvb, &offset);
2221 parse_RETH(all_headers_tree, tvb, &offset, &info);
2223 /*packetLength -= 4;*/ /* RDETH */
2224 /*packetLength -= 4;*/ /* FETH */
2225 /*packetLength -= 16;*/ /* RETH */
2226 break;
2227 case RDETH_RETH_PAYLD:
2228 parse_RDETH(all_headers_tree, tvb, &offset);
2229 parse_RETH(all_headers_tree, tvb, &offset, &info);
2231 packetLength -= 4;
2232 packetLength -= 16;
2234 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2235 break;
2236 default:
2237 parse_VENDOR(all_headers_tree, tvb, &offset);
2238 break;
2243 /* Display the ICRC/VCRC */
2244 /* Doing it this way rather than in a variety of places according to the specific packet */
2245 /* If we've already displayed it crc_length comes out 0 */
2246 crc_length = tvb_reported_length_remaining(tvb, offset);
2247 if (crc_length == 6)
2249 proto_tree_add_item(all_headers_tree, hf_infiniband_invariant_crc, tvb, offset, 4, ENC_BIG_ENDIAN);
2250 offset += 4;
2251 proto_tree_add_item(all_headers_tree, hf_infiniband_variant_crc, tvb, offset, 2, ENC_BIG_ENDIAN);
2252 offset += 2;
2254 else if (crc_length == 4)
2256 proto_tree_add_item(all_headers_tree, hf_infiniband_invariant_crc, tvb, offset, 4, ENC_BIG_ENDIAN);
2257 offset += 4;
2259 else if (crc_length == 2)
2261 proto_tree_add_item(all_headers_tree, hf_infiniband_variant_crc, tvb, offset, 2, ENC_BIG_ENDIAN);
2262 offset += 2;
2267 static int
2268 dissect_infiniband_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2270 /* Top Level Item */
2271 proto_item *infiniband_link_packet;
2273 /* The Link Subtree */
2274 proto_tree *link_tree;
2276 proto_item *operand_item;
2277 int offset = 0; /* Current Offset */
2278 uint8_t operand; /* Link packet Operand */
2280 operand = tvb_get_uint8(tvb, offset);
2281 operand = (operand & 0xF0) >> 4;
2283 /* Mark the Packet type as Infiniband in the wireshark UI */
2284 /* Clear other columns */
2285 col_set_str(pinfo->cinfo, COL_PROTOCOL, "InfiniBand Link");
2286 col_add_str(pinfo->cinfo, COL_INFO,
2287 val_to_str(operand, Operand_Description, "Unknown (0x%1x)"));
2289 /* Assigns column values */
2290 dissect_general_info(tvb, offset, pinfo, IB_PACKET_STARTS_WITH_LRH);
2292 /* Top Level Packet */
2293 infiniband_link_packet = proto_tree_add_item(tree, proto_infiniband_link, tvb, offset, -1, ENC_NA);
2295 /* Headers Level Tree */
2296 link_tree = proto_item_add_subtree(infiniband_link_packet, ett_link);
2298 operand_item = proto_tree_add_item(link_tree, hf_infiniband_link_op, tvb, offset, 2, ENC_BIG_ENDIAN);
2300 if (operand > 1) {
2301 proto_item_set_text(operand_item, "%s", "Reserved");
2302 call_data_dissector(tvb, pinfo, link_tree);
2303 } else {
2304 proto_tree_add_item(link_tree, hf_infiniband_link_fctbs, tvb, offset, 2, ENC_BIG_ENDIAN);
2305 offset += 2;
2307 proto_tree_add_item(link_tree, hf_infiniband_link_vl, tvb, offset, 2, ENC_BIG_ENDIAN);
2308 proto_tree_add_item(link_tree, hf_infiniband_link_fccl, tvb, offset, 2, ENC_BIG_ENDIAN);
2309 offset += 2;
2311 proto_tree_add_item(link_tree, hf_infiniband_link_lpcrc, tvb, offset, 2, ENC_BIG_ENDIAN);
2314 return tvb_captured_length(tvb);
2318 /* Description: Finds the header sequence that follows the Base Transport Header.
2319 * Somwhat inefficient (should be using a single key,value pair data structure)
2320 * But uses pure probablity to take a stab at better efficiency.
2321 * Searches largest header sequence groups first, and then finally resorts to single matches for unique header sequences
2322 * IN: OpCode: The OpCode from the Base Transport Header.
2323 * OUT: The Header Sequence enumeration. See Declarations for #defines from (0-22) */
2324 static int32_t
2325 find_next_header_sequence(struct infinibandinfo* ibInfo)
2327 if (ibInfo->opCode == 0x55)
2328 return ibInfo->dctConnect ? DCCETH : PAYLD;
2330 if (contains(ibInfo->opCode, &opCode_PAYLD[0], (int32_t)array_length(opCode_PAYLD)))
2331 return PAYLD;
2333 if (contains(ibInfo->opCode, &opCode_IMMDT_PAYLD[0], (int32_t)array_length(opCode_IMMDT_PAYLD)))
2334 return IMMDT_PAYLD;
2336 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_PAYLD[0], (int32_t)array_length(opCode_RDETH_DETH_PAYLD)))
2337 return RDETH_DETH_PAYLD;
2339 if (contains(ibInfo->opCode, &opCode_RETH_PAYLD[0], (int32_t)array_length(opCode_RETH_PAYLD)))
2340 return RETH_PAYLD;
2342 if (contains(ibInfo->opCode, &opCode_RDETH_AETH_PAYLD[0], (int32_t)array_length(opCode_RDETH_AETH_PAYLD)))
2343 return RDETH_AETH_PAYLD;
2345 if (contains(ibInfo->opCode, &opCode_AETH_PAYLD[0], (int32_t)array_length(opCode_AETH_PAYLD)))
2346 return AETH_PAYLD;
2348 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_IMMDT_PAYLD[0], (int32_t)array_length(opCode_RDETH_DETH_IMMDT_PAYLD)))
2349 return RDETH_DETH_IMMDT_PAYLD;
2351 if (contains(ibInfo->opCode, &opCode_RETH_IMMDT_PAYLD[0], (int32_t)array_length(opCode_RETH_IMMDT_PAYLD)))
2352 return RETH_IMMDT_PAYLD;
2354 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_RETH_PAYLD[0], (int32_t)array_length(opCode_RDETH_DETH_RETH_PAYLD)))
2355 return RDETH_DETH_RETH_PAYLD;
2357 if (contains(ibInfo->opCode, &opCode_ATOMICETH[0], (int32_t)array_length(opCode_ATOMICETH)))
2358 return ATOMICETH;
2360 if (contains(ibInfo->opCode, &opCode_IETH_PAYLD[0], (int32_t)array_length(opCode_IETH_PAYLD)))
2361 return IETH_PAYLD;
2363 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_ATOMICETH[0], (int32_t)array_length(opCode_RDETH_DETH_ATOMICETH)))
2364 return RDETH_DETH_ATOMICETH;
2366 if ((ibInfo->opCode ^ RC_ACKNOWLEDGE) == 0)
2367 return AETH;
2369 if ((ibInfo->opCode ^ RC_RDMA_READ_REQUEST) == 0)
2370 return RETH;
2372 if ((ibInfo->opCode ^ RC_ATOMIC_ACKNOWLEDGE) == 0)
2373 return AETH_ATOMICACKETH;
2375 if ((ibInfo->opCode ^ RD_RDMA_READ_RESPONSE_MIDDLE) == 0)
2376 return RDETH_PAYLD;
2378 if ((ibInfo->opCode ^ RD_ACKNOWLEDGE) == 0)
2379 return RDETH_AETH;
2381 if ((ibInfo->opCode ^ RD_ATOMIC_ACKNOWLEDGE) == 0)
2382 return RDETH_AETH_ATOMICACKETH;
2384 if ((ibInfo->opCode ^ RD_RDMA_WRITE_ONLY_IMM) == 0)
2385 return RDETH_DETH_RETH_IMMDT_PAYLD;
2387 if ((ibInfo->opCode ^ RD_RDMA_READ_REQUEST) == 0)
2388 return RDETH_DETH_RETH;
2390 if ((ibInfo->opCode ^ RD_RESYNC) == 0)
2391 return RDETH_DETH;
2393 if ((ibInfo->opCode ^ UD_SEND_ONLY) == 0)
2394 return DETH_PAYLD;
2396 if ((ibInfo->opCode ^ UD_SEND_ONLY_IMM) == 0)
2397 return DETH_IMMDT_PAYLD;
2399 if ((ibInfo->opCode ^ RC_FLUSH) == 0)
2400 return FETH_RETH;
2402 if ((ibInfo->opCode ^ RD_FLUSH) == 0)
2403 return RDETH_FETH_RETH;
2405 if ((ibInfo->opCode ^ RC_ATOMIC_WRITE) == 0)
2406 return RETH_PAYLD;
2408 if ((ibInfo->opCode ^ RD_ATOMIC_WRITE) == 0)
2409 return RDETH_RETH_PAYLD;
2411 return -1;
2414 /* Description: Finds if a given value is present in an array. This is probably in a standard library somewhere,
2415 * But I'd rather define my own.
2416 * IN: OpCode: The OpCode you are looking for
2417 * IN: Codes: The organized array of OpCodes to look through
2418 * IN: Array length, because we're in C++...
2419 * OUT: Boolean indicating if that OpCode was found in OpCodes */
2420 static bool
2421 contains(uint32_t OpCode, uint32_t* Codes, int32_t length)
2423 int32_t i;
2424 for (i = 0; i < length; i++)
2426 if ((OpCode ^ Codes[i]) == 0)
2427 return true;
2429 return false;
2432 /* Parse RDETH - Reliable Datagram Extended Transport Header
2433 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2434 * IN: tvb - the data buffer from wireshark
2435 * IN/OUT: The current and updated offset */
2436 static void
2437 parse_RDETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2439 int local_offset = *offset;
2440 /* RDETH - Reliable Datagram Extended Transport Header */
2441 proto_item *RDETH_header_item;
2442 proto_tree *RDETH_header_tree;
2444 RDETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_RDETH, tvb, local_offset, 4, ENC_NA);
2445 proto_item_set_text(RDETH_header_item, "%s", "RDETH - Reliable Datagram Extended Transport Header");
2446 RDETH_header_tree = proto_item_add_subtree(RDETH_header_item, ett_rdeth);
2448 proto_tree_add_item(RDETH_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
2449 local_offset += 1;
2450 proto_tree_add_item(RDETH_header_tree, hf_infiniband_ee_context, tvb, local_offset, 3, ENC_BIG_ENDIAN);
2451 local_offset += 3;
2452 *offset = local_offset;
2455 /* Parse DETH - Datagram Extended Transport Header
2456 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2457 * IN: tvb - the data buffer from wireshark
2458 * IN/OUT: The current and updated offset */
2459 static void
2460 parse_DETH(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, int *offset)
2462 int local_offset = *offset;
2463 /* DETH - Datagram Extended Transport Header */
2464 proto_item *DETH_header_item;
2465 proto_tree *DETH_header_tree;
2467 DETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_DETH, tvb, local_offset, 8, ENC_NA);
2468 proto_item_set_text(DETH_header_item, "%s", "DETH - Datagram Extended Transport Header");
2469 DETH_header_tree = proto_item_add_subtree(DETH_header_item, ett_deth);
2471 proto_tree_add_item(DETH_header_tree, hf_infiniband_queue_key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2472 local_offset += 4;
2473 proto_tree_add_item(DETH_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
2474 local_offset += 1;
2475 proto_tree_add_item(DETH_header_tree, hf_infiniband_source_qp, tvb, local_offset, 3, ENC_BIG_ENDIAN);
2476 pinfo->srcport = tvb_get_ntoh24(tvb, local_offset);
2477 local_offset += 3;
2479 *offset = local_offset;
2482 /* Parse DCCETH - DC Connected Extended Transport Header
2483 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2484 * IN: dctConnect - True if this is a DCT-Connect packet.
2485 * IN: tvb - the data buffer from wireshark
2486 * IN/OUT: The current and updated offset */
2487 static void
2488 parse_DCCETH(proto_tree *parentTree _U_, tvbuff_t *tvb _U_, int *offset)
2490 /* Do nothing just skip the header size */
2491 *offset += 16;
2494 /* Parse RETH - RDMA Extended Transport Header
2495 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2496 * IN: tvb - the data buffer from wireshark
2497 * IN/OUT: The current and updated offset
2498 * OUT: Updated info->reth_remote_key
2499 * OUT: Updated info->reth_dma_length */
2500 static void
2501 parse_RETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset,
2502 struct infinibandinfo *info)
2504 int local_offset = *offset;
2505 /* RETH - RDMA Extended Transport Header */
2506 proto_item *RETH_header_item;
2507 proto_tree *RETH_header_tree;
2509 RETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_RETH, tvb, local_offset, 16, ENC_NA);
2510 proto_item_set_text(RETH_header_item, "%s", "RETH - RDMA Extended Transport Header");
2511 RETH_header_tree = proto_item_add_subtree(RETH_header_item, ett_reth);
2513 proto_tree_add_item_ret_uint64(RETH_header_tree, hf_infiniband_virtual_address, tvb, local_offset, 8, ENC_BIG_ENDIAN, &info->reth_remote_address);
2514 local_offset += 8;
2515 proto_tree_add_item_ret_uint(RETH_header_tree, hf_infiniband_remote_key, tvb, local_offset, 4, ENC_BIG_ENDIAN, &info->reth_remote_key);
2516 local_offset += 4;
2517 proto_tree_add_item_ret_uint(RETH_header_tree, hf_infiniband_dma_length, tvb, local_offset, 4, ENC_BIG_ENDIAN, &info->reth_dma_length);
2518 local_offset += 4;
2520 *offset = local_offset;
2523 /* Parse AtomicETH - Atomic Extended Transport Header
2524 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2525 * IN: tvb - the data buffer from wireshark
2526 * IN/OUT: The current and updated offset */
2527 static void
2528 parse_ATOMICETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2530 int local_offset = *offset;
2531 /* AtomicETH - Atomic Extended Transport Header */
2532 proto_item *ATOMICETH_header_item;
2533 proto_tree *ATOMICETH_header_tree;
2535 ATOMICETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_AtomicETH, tvb, local_offset, 28, ENC_NA);
2536 proto_item_set_text(ATOMICETH_header_item, "%s", "AtomicETH - Atomic Extended Transport Header");
2537 ATOMICETH_header_tree = proto_item_add_subtree(ATOMICETH_header_item, ett_atomiceth);
2539 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_virtual_address, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2540 local_offset += 8;
2541 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_remote_key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2542 local_offset += 4;
2543 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_swap_or_add_data, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2544 local_offset += 8;
2545 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_compare_data, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2546 local_offset += 8;
2547 *offset = local_offset;
2550 /* Parse AETH - ACK Extended Transport Header
2551 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2552 * IN: tvb - the data buffer from wireshark
2553 * IN/OUT: The current and updated offset */
2554 static void
2555 parse_AETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset, packet_info *pinfo)
2557 int local_offset = *offset;
2558 /* AETH - ACK Extended Transport Header */
2559 proto_item *AETH_header_item;
2560 proto_tree *AETH_header_tree;
2561 proto_item *AETH_syndrome_item;
2562 proto_tree *AETH_syndrome_tree;
2563 uint8_t opcode;
2564 uint32_t nak_error;
2566 AETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_AETH, tvb, local_offset, 4, ENC_NA);
2567 proto_item_set_text(AETH_header_item, "%s", "AETH - ACK Extended Transport Header");
2568 AETH_header_tree = proto_item_add_subtree(AETH_header_item, ett_aeth);
2570 AETH_syndrome_item = proto_tree_add_item(AETH_header_tree, hf_infiniband_syndrome, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2571 AETH_syndrome_tree = proto_item_add_subtree(AETH_syndrome_item, ett_aeth_syndrome);
2572 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2573 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_opcode, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2574 opcode = ((tvb_get_uint8(tvb, local_offset) & AETH_SYNDROME_OPCODE) >> 5);
2575 proto_item_append_text(AETH_syndrome_item, ", %s", val_to_str_const(opcode, aeth_syndrome_opcode_vals, "Unknown"));
2576 switch (opcode)
2578 case AETH_SYNDROME_OPCODE_ACK:
2579 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_credit_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2580 break;
2581 case AETH_SYNDROME_OPCODE_RNR_NAK:
2582 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_timer, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2583 break;
2584 case AETH_SYNDROME_OPCODE_RES:
2585 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_reserved_value, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2586 break;
2587 case AETH_SYNDROME_OPCODE_NAK:
2588 proto_tree_add_item_ret_uint(AETH_syndrome_tree, hf_infiniband_syndrome_error_code, tvb, local_offset, 1, ENC_BIG_ENDIAN, &nak_error);
2589 col_append_fstr(pinfo->cinfo, COL_INFO, "[%s] ", val_to_str(nak_error, aeth_syndrome_nak_error_code_vals, "Unknown (%d)"));
2590 break;
2593 local_offset += 1;
2594 proto_tree_add_item(AETH_header_tree, hf_infiniband_message_sequence_number, tvb, local_offset, 3, ENC_BIG_ENDIAN);
2595 local_offset += 3;
2597 *offset = local_offset;
2600 /* Parse AtomicAckEth - Atomic ACK Extended Transport Header
2601 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2602 * IN: tvb - the data buffer from wireshark
2603 * IN/OUT: The current and updated offset */
2604 static void
2605 parse_ATOMICACKETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2607 int local_offset = *offset;
2608 /* AtomicAckEth - Atomic ACK Extended Transport Header */
2609 proto_item *ATOMICACKETH_header_item;
2610 proto_tree *ATOMICACKETH_header_tree;
2612 ATOMICACKETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_AtomicAckETH, tvb, local_offset, 8, ENC_NA);
2613 proto_item_set_text(ATOMICACKETH_header_item, "%s", "ATOMICACKETH - Atomic ACK Extended Transport Header");
2614 ATOMICACKETH_header_tree = proto_item_add_subtree(ATOMICACKETH_header_item, ett_atomicacketh);
2615 proto_tree_add_item(ATOMICACKETH_header_tree, hf_infiniband_original_remote_data, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2616 local_offset += 8;
2617 *offset = local_offset;
2620 /* Parse IMMDT - Immediate Data Extended Transport Header
2621 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2622 * IN: tvb - the data buffer from wireshark
2623 * IN/OUT: The current and updated offset */
2624 static void
2625 parse_IMMDT(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2627 int local_offset = *offset;
2628 /* IMMDT - Immediate Data Extended Transport Header */
2629 proto_item *IMMDT_header_item;
2630 proto_tree *IMMDT_header_tree;
2632 IMMDT_header_item = proto_tree_add_item(parentTree, hf_infiniband_IMMDT, tvb, local_offset, 4, ENC_NA);
2633 proto_item_set_text(IMMDT_header_item, "%s", "IMMDT - Immediate Data Extended Transport Header");
2634 IMMDT_header_tree = proto_item_add_subtree(IMMDT_header_item, ett_immdt);
2635 proto_tree_add_item(IMMDT_header_tree, hf_infiniband_IMMDT, tvb, local_offset, 4, ENC_NA);
2636 local_offset += 4;
2637 *offset = local_offset;
2640 /* Parse IETH - Invalidate Extended Transport Header
2641 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2642 * IN: tvb - the data buffer from wireshark
2643 * IN/OUT: The current and updated offset */
2644 static void
2645 parse_IETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2647 int local_offset = *offset;
2648 /* IETH - Invalidate Extended Transport Header */
2649 proto_item *IETH_header_item;
2650 proto_tree *IETH_header_tree;
2652 IETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_IETH, tvb, local_offset, 4, ENC_NA);
2653 proto_item_set_text(IETH_header_item, "%s", "IETH - Invalidate Extended Transport Header");
2654 IETH_header_tree = proto_item_add_subtree(IETH_header_item, ett_ieth);
2656 proto_tree_add_item(IETH_header_tree, hf_infiniband_IETH, tvb, local_offset, 4, ENC_NA);
2657 local_offset += 4;
2659 *offset = local_offset;
2662 /* Parse FETH - FLUSH extended transport header
2663 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2664 * IN: tvb - the data buffer from wireshark
2665 * IN/OUT: The current and updated offset */
2666 static void
2667 parse_FETH(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2669 int local_offset = *offset;
2670 /* FETH - FLUSH Extended Transport Header */
2671 proto_item *FETH_header_item;
2672 proto_tree *FETH_header_tree;
2674 FETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_FETH, tvb, local_offset, 4, ENC_NA);
2675 proto_item_set_text(FETH_header_item, "%s", "FETH - FLUSH Extended Transport Header");
2676 FETH_header_tree = proto_item_add_subtree(FETH_header_item, ett_ieth);
2678 proto_tree_add_item(FETH_header_tree, hf_infiniband_reserved27, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2679 local_offset += 3;
2680 proto_tree_add_item(FETH_header_tree, hf_infiniband_selectivity_level, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2681 proto_tree_add_item(FETH_header_tree, hf_infiniband_placement_type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2683 local_offset += 1;
2684 *offset = local_offset;
2687 static void update_sport(packet_info *pinfo)
2689 conversation_t *conv;
2690 conversation_infiniband_data *conv_data;
2692 conv = find_conversation(pinfo->num, &pinfo->dst, &pinfo->dst,
2693 CONVERSATION_IBQP, pinfo->destport, pinfo->destport, NO_ADDR_B|NO_PORT_B);
2694 if (!conv)
2695 return;
2697 conv_data = (conversation_infiniband_data *)conversation_get_proto_data(conv, proto_infiniband);
2698 if (!conv_data)
2699 return;
2701 pinfo->srcport = conv_data->src_qp;
2704 /* Parse Payload - Packet Payload / Invariant CRC / maybe Variant CRC
2705 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2706 * IN: pinfo - packet info from wireshark
2707 * IN: info - infiniband info passed to subdissectors
2708 * IN: tvb - the data buffer from wireshark
2709 * IN/OUT: offset - The current and updated offset
2710 * IN: length - Length of Payload
2711 * IN: top_tree - parent tree of Infiniband dissector */
2712 static void parse_PAYLOAD(proto_tree *parentTree,
2713 packet_info *pinfo, struct infinibandinfo *info,
2714 tvbuff_t *tvb, int *offset, int length, int crclen, proto_tree *top_tree)
2716 int local_offset = *offset;
2717 /* Payload - Packet Payload */
2718 uint8_t management_class;
2719 tvbuff_t *volatile next_tvb;
2720 int reported_length;
2721 heur_dtbl_entry_t *hdtbl_entry;
2722 bool dissector_found = false;
2724 if (!tvb_bytes_exist(tvb, *offset, length)) /* previously consumed bytes + offset was all the data - none or corrupt payload */
2726 col_set_str(pinfo->cinfo, COL_INFO, "Invalid Packet Length from LRH! [Malformed Packet]");
2727 col_set_fence(pinfo->cinfo, COL_INFO);
2728 return;
2731 /* management datagrams are determined by the source/destination QPs */
2732 if (pinfo->srcport == 0 || pinfo->srcport == 1 || pinfo->destport == 0 || pinfo->destport == 1) /* management datagram */
2734 management_class = tvb_get_uint8(tvb, (*offset) + 1);
2736 if (((management_class >= (uint8_t)VENDOR_1_START) && (management_class <= (uint8_t)VENDOR_1_END))
2737 || ((management_class >= (uint8_t)VENDOR_2_START) && (management_class <= (uint8_t)VENDOR_2_END)))
2739 /* parse vendor specific */
2740 col_set_str(pinfo->cinfo, COL_INFO, "VENDOR (Unknown Attribute)");
2741 parse_VENDOR_MANAGEMENT(parentTree, tvb, offset);
2743 else if ((management_class >= (uint8_t)APPLICATION_START) && (management_class <= (uint8_t)APPLICATION_END))
2745 /* parse application specific */
2746 col_set_str(pinfo->cinfo, COL_INFO, "APP (Unknown Attribute)");
2747 parse_APPLICATION_MANAGEMENT(parentTree, tvb, offset);
2749 else if (((management_class == (uint8_t)0x00) || (management_class == (uint8_t)0x02))
2750 || ((management_class >= (uint8_t)0x50) && (management_class <= (uint8_t)0x80))
2751 || ((management_class >= (uint8_t)0x82)))
2753 /* parse reserved classes */
2754 col_set_str(pinfo->cinfo, COL_INFO, "RESERVED (Unknown Attribute)");
2755 parse_RESERVED_MANAGEMENT(parentTree, tvb, offset);
2757 else /* we have a normal management_class */
2759 switch (management_class)
2761 case SUBN_LID_ROUTED:
2762 /* parse subn man lid routed */
2763 parse_SUBN_LID_ROUTED(parentTree, pinfo, tvb, &local_offset);
2764 break;
2765 case SUBN_DIRECTED_ROUTE:
2766 /* parse subn directed route */
2767 parse_SUBN_DIRECTED_ROUTE(parentTree, pinfo, tvb, &local_offset);
2768 break;
2769 case SUBNADMN:
2770 /* parse sub admin */
2771 parse_SUBNADMN(parentTree, pinfo, tvb, &local_offset);
2772 break;
2773 case PERF:
2774 /* parse performance */
2775 parse_PERF(parentTree, tvb, pinfo, &local_offset);
2776 break;
2777 case BM:
2778 /* parse baseboard mgmt */
2779 col_set_str(pinfo->cinfo, COL_INFO, "BM (Unknown Attribute)");
2780 parse_BM(parentTree, tvb, &local_offset);
2781 break;
2782 case DEV_MGT:
2783 /* parse device management */
2784 col_set_str(pinfo->cinfo, COL_INFO, "DEV_MGT (Unknown Attribute)");
2785 parse_DEV_MGT(parentTree, tvb, &local_offset);
2786 break;
2787 case COM_MGT:
2788 /* parse communication management */
2789 parse_COM_MGT(parentTree, pinfo, tvb, &local_offset, top_tree);
2790 break;
2791 case SNMP:
2792 /* parse snmp tunneling */
2793 col_set_str(pinfo->cinfo, COL_INFO, "SNMP (Unknown Attribute)");
2794 parse_SNMP(parentTree, tvb, &local_offset);
2795 break;
2796 default:
2797 break;
2801 else /* Normal Data Packet - Parse as such */
2803 /* update sport for the packet, for dissectors that performs
2804 * exact match on saddr, dadr, sport, dport tuple.
2806 update_sport(pinfo);
2808 info->payload_tree = parentTree;
2810 /* Calculation for Payload:
2811 * (tvb_length) Length of entire packet - (local_offset) Starting byte of Payload Data
2812 * offset addition is more complex for the payload.
2813 * We need the total length of the packet, - length of previous headers, + offset where payload started.
2814 * We also need to reserve 6 bytes for the CRCs which are not actually part of the payload. */
2815 reported_length = tvb_reported_length_remaining(tvb, local_offset);
2816 if (reported_length >= crclen)
2817 reported_length -= crclen;
2818 next_tvb = tvb_new_subset_length(tvb, local_offset, reported_length);
2820 if (try_heuristic_first)
2822 if (dissector_try_heuristic(heur_dissectors_payload, next_tvb, pinfo, top_tree, &hdtbl_entry, info))
2823 dissector_found = true;
2826 if (dissector_found == false)
2828 if (dissector_try_payload_with_data(subdissector_table, next_tvb, pinfo, top_tree, true, info))
2830 dissector_found = true;
2832 else
2834 if (!try_heuristic_first)
2836 if (dissector_try_heuristic(heur_dissectors_payload, next_tvb, pinfo, top_tree, &hdtbl_entry, info))
2837 dissector_found = true;
2842 if (dissector_found == false)
2844 /* No sub-dissector found.
2845 Label rest of packet as "Data" */
2846 call_data_dissector(next_tvb, pinfo, top_tree);
2849 /* Will contain ICRC <and maybe VCRC> = 4 or 4+2 (crclen) */
2850 local_offset = tvb_reported_length(tvb) - crclen;
2853 *offset = local_offset;
2856 /* Parse VENDOR - Parse a vendor specific or unknown header sequence
2857 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2858 * IN: tvb - the data buffer from wireshark
2859 * IN/OUT: The current and updated offset */
2860 static void parse_VENDOR(proto_tree * parentTree, tvbuff_t *tvb, int *offset)
2862 int local_offset = *offset;
2863 proto_item *VENDOR_header_item;
2864 proto_tree *VENDOR_header_tree;
2865 int VENDOR_header_length;
2867 VENDOR_header_item = proto_tree_add_item(parentTree, hf_infiniband_vendor, tvb, local_offset, 4, ENC_NA);
2868 proto_item_set_text(VENDOR_header_item, "%s", "Vendor Specific or Unknown Header Sequence");
2869 VENDOR_header_tree = proto_item_add_subtree(VENDOR_header_item, ett_vendor);
2870 proto_tree_add_item_ret_length(VENDOR_header_tree, hf_infiniband_vendor, tvb, local_offset, -1, ENC_NA, &VENDOR_header_length);
2871 local_offset += VENDOR_header_length;
2872 *offset = local_offset;
2875 /* Parse IPv6 - Parse an IPv6 Packet
2876 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2877 * IN: tvb - the data buffer from wireshark
2878 * IN/OUT: The current and updated offset
2879 * IN: pinfo - packet info from wireshark */
2880 static void parse_IPvSix(proto_tree *parentTree, tvbuff_t *tvb, int *offset, packet_info *pinfo)
2882 tvbuff_t *ipv6_tvb;
2884 /* (- 2) for VCRC which lives at the end of the packet */
2885 ipv6_tvb = tvb_new_subset_length(tvb, *offset,
2886 tvb_reported_length_remaining(tvb, *offset) - 2);
2887 call_dissector(ipv6_handle, ipv6_tvb, pinfo, parentTree);
2888 *offset = tvb_reported_length(tvb) - 2;
2890 /* Display the VCRC */
2891 proto_tree_add_item(parentTree, hf_infiniband_variant_crc, tvb, *offset, 2, ENC_BIG_ENDIAN);
2894 /* Parse EtherType - Parse a generic IP packaet with an EtherType of IP or ARP
2895 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2896 * IN: tvb - the data buffer from wireshark
2897 * IN/OUT: The current and updated offset
2898 * IN: pinfo - packet info from wireshark
2899 * IN: top_tree - parent tree of Infiniband dissector */
2900 static void parse_RWH(proto_tree *ah_tree, tvbuff_t *tvb, int *offset, packet_info *pinfo, proto_tree *top_tree)
2902 uint16_t ether_type;
2903 tvbuff_t *next_tvb;
2905 /* RWH - Raw Header */
2906 proto_item *RWH_header_item;
2907 proto_tree *RWH_header_tree;
2909 int captured_length, reported_length;
2911 RWH_header_item = proto_tree_add_item(ah_tree, hf_infiniband_RWH, tvb, *offset, 4, ENC_NA);
2912 proto_item_set_text(RWH_header_item, "%s", "RWH - Raw Header");
2913 RWH_header_tree = proto_item_add_subtree(RWH_header_item, ett_rwh);
2915 proto_tree_add_item(RWH_header_tree, hf_infiniband_reserved, tvb,
2916 *offset, 2, ENC_NA);
2918 *offset += 2;
2920 ether_type = tvb_get_ntohs(tvb, *offset);
2921 proto_tree_add_uint(RWH_header_tree, hf_infiniband_etype, tvb, *offset, 2,
2922 ether_type);
2923 *offset += 2;
2925 /* Get the captured length and reported length of the data
2926 * after the Ethernet type. */
2927 captured_length = tvb_captured_length_remaining(tvb, *offset);
2928 reported_length = tvb_reported_length_remaining(tvb, *offset);
2930 /* Construct a tvbuff for the payload after the Ethernet type,
2931 * not including the FCS. */
2932 if ((captured_length >= 0) && (reported_length >= 0)) {
2933 if (reported_length >= 2)
2934 reported_length -= 2;
2937 next_tvb = tvb_new_subset_length(tvb, *offset, reported_length);
2938 if (!dissector_try_uint(ethertype_dissector_table, ether_type,
2939 next_tvb, pinfo, top_tree))
2940 call_data_dissector(next_tvb, pinfo, top_tree);
2942 *offset = tvb_reported_length(tvb) - 2;
2943 /* Display the VCRC */
2944 proto_tree_add_item(ah_tree, hf_infiniband_variant_crc, tvb, *offset, 2, ENC_BIG_ENDIAN);
2948 /* Parse a Mellanox EoIB Encapsulation Header and the associated Ethernet frame
2949 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2950 * IN: tvb - the data buffer from wireshark
2951 * IN: The current offset
2952 * IN: pinfo - packet info from wireshark
2953 * IN: top_tree - parent tree of Infiniband dissector */
2954 static bool dissect_mellanox_eoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2956 proto_item *header_item;
2957 proto_tree *header_subtree;
2958 tvbuff_t *encap_tvb;
2959 int offset = 0;
2960 bool more_segments;
2961 struct infinibandinfo *info = (struct infinibandinfo *)data;
2963 if (((info->opCode & 0xE0) >> 5) != TRANSPORT_UD)
2964 return false;
2966 if ((tvb_get_uint8(tvb, offset) & 0xF0) != 0xC0)
2967 return false;
2969 if (tvb_reported_length(tvb) < 4) {
2970 /* not even large enough to contain the eoib encap header. error! */
2971 return false;
2974 header_item = proto_tree_add_item(tree, proto_mellanox_eoib, tvb, offset, 4, ENC_NA);
2975 header_subtree = proto_item_add_subtree(header_item, ett_eoib);
2977 proto_tree_add_item(header_subtree, hf_infiniband_ver, tvb, offset, 2, ENC_BIG_ENDIAN);
2978 proto_tree_add_item(header_subtree, hf_infiniband_tcp_chk, tvb, offset, 2, ENC_BIG_ENDIAN);
2979 proto_tree_add_item(header_subtree, hf_infiniband_ip_chk, tvb, offset, 2, ENC_BIG_ENDIAN);
2980 proto_tree_add_item(header_subtree, hf_infiniband_fcs, tvb, offset, 2, ENC_BIG_ENDIAN);
2981 proto_tree_add_item(header_subtree, hf_infiniband_ms, tvb, offset, 2, ENC_BIG_ENDIAN);
2982 proto_tree_add_item(header_subtree, hf_infiniband_seg_off, tvb, offset, 2, ENC_BIG_ENDIAN);
2983 more_segments = tvb_get_ntohs(tvb, offset) & (MELLANOX_MORE_SEGMENT_FLAG | MELLANOX_SEGMENT_FLAG);
2984 offset += 2;
2985 proto_tree_add_item(header_subtree, hf_infiniband_seg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2986 offset += 2;
2988 encap_tvb = tvb_new_subset_remaining(tvb, offset);
2990 if (more_segments) {
2991 /* this is a fragment of an encapsulated Ethernet jumbo frame, parse as data */
2992 call_data_dissector(encap_tvb, pinfo, tree);
2993 } else {
2994 /* non-fragmented frames can be fully parsed */
2995 call_dissector(eth_handle, encap_tvb, pinfo, tree);
2998 return true;
3001 /* IBA packet data could be anything in principle, however it is common
3002 * practice to carry non-IBA data encapsulated with an EtherType header,
3003 * similar to the RWH header. There is no way to identify these frames
3004 * positively.
3006 static bool dissect_eth_over_ib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
3008 uint16_t etype, reserved;
3009 const char *saved_proto;
3010 tvbuff_t *next_tvb;
3011 struct infinibandinfo *info = (struct infinibandinfo *)data;
3012 volatile bool dissector_found = false;
3014 if (tvb_reported_length(tvb) < 4) {
3015 /* not even large enough to contain the eoib encap header. error! */
3016 return false;
3019 etype = tvb_get_ntohs(tvb, 0);
3020 reserved = tvb_get_ntohs(tvb, 2);
3022 if (reserved != 0)
3023 return false;
3025 next_tvb = tvb_new_subset_remaining(tvb, 4);
3027 /* Look for sub-dissector, and call it if found.
3028 Catch exceptions, so that if the reported length of "next_tvb"
3029 was reduced by some dissector before an exception was thrown,
3030 we can still put in an item for the trailer. */
3031 saved_proto = pinfo->current_proto;
3033 TRY {
3034 dissector_found = (bool)dissector_try_uint(ethertype_dissector_table,
3035 etype, next_tvb, pinfo, tree);
3037 CATCH_NONFATAL_ERRORS {
3038 /* Somebody threw an exception that means that there
3039 was a problem dissecting the payload; that means
3040 that a dissector was found, so we don't need to
3041 dissect the payload as data or update the protocol
3042 or info columns.
3044 Just show the exception and then drive on to show
3045 the trailer, after noting that a dissector was found
3046 and restoring the protocol value that was in effect
3047 before we called the subdissector.
3050 show_exception(next_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
3051 dissector_found = true;
3052 pinfo->current_proto = saved_proto;
3054 ENDTRY;
3056 if (dissector_found) {
3057 proto_item *PAYLOAD_header_item;
3058 proto_tree *PAYLOAD_header_tree;
3060 /* now create payload entry to show Ethertype */
3061 PAYLOAD_header_item = proto_tree_add_item(info->payload_tree, hf_infiniband_payload, tvb, 0,
3062 tvb_reported_length(tvb) - 6, ENC_NA);
3063 proto_item_set_text(PAYLOAD_header_item, "%s", "IBA Payload - appears to be EtherType encapsulated");
3064 PAYLOAD_header_tree = proto_item_add_subtree(PAYLOAD_header_item, ett_payload);
3066 proto_tree_add_uint(PAYLOAD_header_tree, hf_infiniband_etype, tvb, 0, 2, etype);
3067 proto_tree_add_item(PAYLOAD_header_tree, hf_infiniband_reserved, tvb, 2, 2, ENC_NA);
3070 return dissector_found;
3073 /* Parse Subnet Management (LID Routed)
3074 * IN: parentTree to add the dissection to
3075 * IN: pinfo - packet info from wireshark
3076 * IN: tvb - the data buffer from wireshark
3077 * IN/OUT: The current and updated offset */
3078 static void parse_SUBN_LID_ROUTED(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, int *offset)
3080 /* Parse the Common MAD Header */
3081 MAD_Data MadData;
3082 int local_offset;
3083 proto_item *SUBN_LID_ROUTED_header_item;
3084 proto_tree *SUBN_LID_ROUTED_header_tree;
3086 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3088 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3089 return;
3092 local_offset = *offset;
3094 /* local_offset - 24 here because when we come out of parse_MAD_Common, the offset it sitting at the data section. */
3095 SUBN_LID_ROUTED_header_item = proto_tree_add_item(parentTree, hf_infiniband_SMP_LID, tvb, local_offset - 24, 256, ENC_NA);
3096 proto_item_set_text(SUBN_LID_ROUTED_header_item, "%s", "SMP (LID Routed) ");
3097 SUBN_LID_ROUTED_header_tree = proto_item_add_subtree(SUBN_LID_ROUTED_header_item, ett_subn_lid_routed);
3098 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_m_key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3099 local_offset += 8;
3100 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_reserved, tvb, local_offset, 32, ENC_NA);
3101 local_offset += 32;
3103 label_SUBM_Method(SUBN_LID_ROUTED_header_item, &MadData, pinfo);
3104 label_SUBM_Attribute(SUBN_LID_ROUTED_header_item, &MadData, pinfo);
3106 /* Try to do the detail parse of the attribute. If there is an error, or the attribute is unknown, we'll just highlight the generic data. */
3107 if (!parse_SUBM_Attribute(SUBN_LID_ROUTED_header_tree, tvb, &local_offset, &MadData))
3109 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
3110 local_offset += 64;
3113 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_reserved, tvb, local_offset, 128, ENC_NA);
3114 local_offset += 128;
3115 *offset = local_offset;
3118 /* Parse Subnet Management (Directed Route)
3119 * IN: parentTree to add the dissection to
3120 * IN: tvb - the data buffer from wireshark
3121 * IN/OUT: The current and updated offset */
3122 static void parse_SUBN_DIRECTED_ROUTE(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, int *offset)
3124 /* Parse the Common MAD Header */
3125 MAD_Data MadData;
3126 int local_offset;
3127 proto_item *SUBN_DIRECTED_ROUTE_header_item;
3128 proto_tree *SUBN_DIRECTED_ROUTE_header_tree;
3130 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3132 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3133 return;
3136 local_offset = *offset;
3138 /* local_offset - 24 here because when we come out of parse_MAD_Common, the offset it sitting at the data section.
3139 * We need to go backwards because this particular SMP uses the class specific portion of the Common MAD Header */
3140 SUBN_DIRECTED_ROUTE_header_item = proto_tree_add_item(parentTree, hf_infiniband_SMP_DIRECTED, tvb, local_offset - 24, 256, ENC_NA);
3141 proto_item_set_text(SUBN_DIRECTED_ROUTE_header_item, "%s", "SMP (Directed Route) ");
3142 SUBN_DIRECTED_ROUTE_header_tree = proto_item_add_subtree(SUBN_DIRECTED_ROUTE_header_item, ett_subn_directed_route);
3144 label_SUBM_Method(SUBN_DIRECTED_ROUTE_header_item, &MadData, pinfo);
3145 label_SUBM_Attribute(SUBN_DIRECTED_ROUTE_header_item, &MadData, pinfo);
3147 /* Place us at offset 4, the "D" Bit (Direction bit for Directed Route SMPs) */
3148 local_offset -= 20;
3149 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_d, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3150 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_smp_status, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3151 local_offset += 2;
3152 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_hop_pointer, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3153 local_offset += 1;
3154 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_hop_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3155 local_offset += 1;
3156 local_offset += 16; /* Skip over the rest of the Common MAD Header... It's already dissected by parse_MAD_Common */
3157 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_m_key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3158 local_offset += 8;
3159 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_dr_slid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3160 local_offset += 2;
3161 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_dr_dlid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3162 local_offset += 2;
3163 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_reserved, tvb, local_offset, 28, ENC_NA);
3164 local_offset += 28;
3166 /* Try to do the detail parse of the attribute. If there is an error, or the attribute is unknown, we'll just highlight the generic data. */
3167 if (!parse_SUBM_Attribute(SUBN_DIRECTED_ROUTE_header_tree, tvb, &local_offset, &MadData))
3169 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
3170 local_offset += 64;
3173 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_initial_path, tvb, local_offset, 64, ENC_NA);
3174 local_offset += 64;
3175 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_return_path, tvb, local_offset, 64, ENC_NA);
3176 local_offset += 64;
3177 *offset = local_offset;
3180 /* Parse Subnet Administration
3181 * IN: parentTree to add the dissection to
3182 * IN: pinfo - packet info from wireshark
3183 * IN: tvb - the data buffer from wireshark
3184 * IN/OUT: The current and updated offset */
3185 static void parse_SUBNADMN(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, int *offset)
3187 /* Parse the Common MAD Header */
3188 MAD_Data MadData;
3189 int local_offset;
3190 proto_item *SUBNADMN_header_item;
3191 proto_tree *SUBNADMN_header_tree;
3193 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3195 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3196 return;
3198 if (!parse_RMPP(parentTree, tvb, offset))
3200 /* TODO: Mark Corrupt Packet */
3201 return;
3203 local_offset = *offset;
3205 SUBNADMN_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset - 36, 256, ENC_NA);
3206 proto_item_set_text(SUBNADMN_header_item, "%s", "SA ");
3207 SUBNADMN_header_tree = proto_item_add_subtree(SUBNADMN_header_item, ett_subnadmin);
3209 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_sm_key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3210 local_offset += 8;
3211 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_attribute_offset, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3212 local_offset += 2;
3213 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
3214 local_offset += 2;
3215 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_component_mask, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3216 local_offset += 8;
3218 label_SUBA_Method(SUBNADMN_header_item, &MadData, pinfo);
3219 label_SUBA_Attribute(SUBNADMN_header_item, &MadData, pinfo);
3221 if (!parse_SUBA_Attribute(SUBNADMN_header_tree, tvb, &local_offset, &MadData))
3223 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_subnet_admin_data, tvb, local_offset, 200, ENC_NA);
3224 local_offset += 200;
3226 *offset = local_offset;
3229 /* Parse Performance Management
3230 * IN: parentTree to add the dissection to
3231 * IN: tvb - the data buffer from wireshark
3232 * IN: pinfo - the pinfo struct from wireshark
3233 * IN/OUT: The current and updated offset */
3234 static void parse_PERF(proto_tree *parentTree, tvbuff_t *tvb, packet_info *pinfo, int *offset)
3236 /* Parse the Common MAD Header */
3237 MAD_Data MadData;
3238 int local_offset;
3239 proto_item *PERF_header_item;
3241 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3243 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3244 return;
3247 local_offset = *offset; /* offset now points to the start of the MAD data field */
3249 switch (MadData.attributeID) {
3250 case 0x0001: /* (ClassPortInfo) */
3251 col_set_str(pinfo->cinfo, COL_INFO, "PERF (ClassPortInfo)");
3252 proto_tree_add_item(parentTree, hf_infiniband_PerfMgt_ClassPortInfo, tvb, local_offset, 40, ENC_NA);
3253 local_offset += 40;
3254 *offset = local_offset;
3255 parse_ClassPortInfo(parentTree, tvb, offset);
3256 break;
3257 case ATTR_PORT_COUNTERS:
3258 parse_PERF_PortCounters(parentTree, tvb, pinfo, &local_offset);
3259 break;
3260 case ATTR_PORT_COUNTERS_EXT:
3261 parse_PERF_PortCountersExtended(parentTree, tvb, pinfo, &local_offset);
3262 break;
3263 default:
3264 col_set_str(pinfo->cinfo, COL_INFO, "PERF (Unknown Attribute)");
3265 PERF_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3266 local_offset += MAD_DATA_SIZE;
3267 proto_item_set_text(PERF_header_item, "%s", "PERF - Performance Management MAD (Dissector Not Implemented)");
3268 break;
3271 *offset = local_offset;
3274 /* Parse Baseboard Management
3275 * IN: parentTree to add the dissection to
3276 * IN: tvb - the data buffer from wireshark
3277 * IN/OUT: The current and updated offset */
3278 static void parse_BM(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
3280 /* Parse the Common MAD Header */
3281 MAD_Data MadData;
3282 int local_offset;
3283 proto_item *BM_header_item;
3285 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3287 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3288 return;
3290 local_offset = *offset;
3292 BM_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3293 local_offset += MAD_DATA_SIZE;
3294 proto_item_set_text(BM_header_item, "%s", "BM - Baseboard Management MAD (Dissector Not Implemented)");
3295 *offset = local_offset;
3298 /* Parse Device Management
3299 * IN: parentTree to add the dissection to
3300 * IN: tvb - the data buffer from wireshark
3301 * IN/OUT: The current and updated offset */
3302 static void parse_DEV_MGT(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
3304 /* Parse the Common MAD Header */
3305 MAD_Data MadData;
3306 int local_offset;
3307 proto_item *DEVM_header_item;
3309 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3311 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3312 return;
3314 local_offset = *offset;
3315 DEVM_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3316 local_offset += MAD_DATA_SIZE;
3317 proto_item_set_text(DEVM_header_item, "%s", "DEV_MGT - Device Management MAD (Dissector Not Implemented)");
3318 *offset = local_offset;
3321 static bool parse_CM_Req_ServiceID(proto_tree *parent_tree, tvbuff_t *tvb, int *offset, uint64_t serviceid)
3323 proto_item *service_id_item;
3324 proto_tree *service_id_tree;
3325 int local_offset = *offset;
3326 bool ip_cm_sid;
3328 if ((serviceid & RDMA_IP_CM_SID_PREFIX_MASK) == RDMA_IP_CM_SID_PREFIX) {
3329 service_id_item = proto_tree_add_item(parent_tree, hf_cm_req_service_id, tvb, local_offset, 8, ENC_NA);
3330 proto_item_set_text(service_id_item, "%s", "IP CM ServiceID");
3331 service_id_tree = proto_item_add_subtree(service_id_item, ett_cm_sid);
3333 proto_tree_add_item(service_id_tree, hf_cm_req_service_id_prefix, tvb, local_offset, 5, ENC_NA);
3334 local_offset += 5;
3335 proto_tree_add_item(service_id_tree, hf_cm_req_service_id_protocol, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3336 local_offset += 1;
3337 proto_tree_add_item(service_id_tree, hf_cm_req_service_id_dport, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3338 local_offset += 2;
3339 ip_cm_sid = true;
3340 } else {
3341 proto_tree_add_item(parent_tree, hf_cm_req_service_id, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3342 local_offset += 8;
3343 ip_cm_sid = false;
3345 *offset = local_offset;
3346 return ip_cm_sid;
3349 static uint64_t make_hash_key(uint64_t transcationID, address *addr)
3351 uint64_t hash_key;
3353 hash_key = transcationID;
3354 hash_key = add_address_to_hash64(hash_key, addr);
3355 return hash_key;
3358 static connection_context* lookup_connection(uint64_t transcationID, address *addr)
3360 connection_context *connection;
3361 uint64_t hash_key;
3363 hash_key = make_hash_key(transcationID, addr);
3365 connection = (connection_context *)g_hash_table_lookup(CM_context_table, &hash_key);
3366 return connection;
3369 static void remove_connection(uint64_t transcationID, address *addr)
3371 uint64_t hash_key;
3373 hash_key = make_hash_key(transcationID, addr);
3375 g_hash_table_remove(CM_context_table, &hash_key);
3378 static void
3379 create_conv_and_add_proto_data(packet_info *pinfo, uint64_t service_id,
3380 bool client_to_server,
3381 address *addr, const uint16_t lid,
3382 const uint32_t port, const uint32_t src_port,
3383 const unsigned options, uint8_t *mad_data)
3385 conversation_t *conv;
3386 conversation_infiniband_data *proto_data;
3388 proto_data = wmem_new(wmem_file_scope(), conversation_infiniband_data);
3389 proto_data->service_id = service_id;
3390 proto_data->client_to_server = client_to_server;
3391 proto_data->src_qp = src_port;
3392 memcpy(&proto_data->mad_private_data[0], mad_data, MAD_DATA_SIZE);
3393 conv = conversation_new(pinfo->num, addr, addr,
3394 CONVERSATION_IBQP, port, port, options);
3395 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3397 /* next, register the conversation using the LIDs */
3398 set_address(addr, AT_IB, sizeof(uint16_t), wmem_memdup(pinfo->pool, &lid, sizeof lid));
3399 conv = conversation_new(pinfo->num, addr, addr,
3400 CONVERSATION_IBQP, port, port, options);
3401 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3404 static void save_conversation_info(packet_info *pinfo, uint8_t *local_gid, uint8_t *remote_gid,
3405 uint32_t local_qpn, uint32_t local_lid, uint32_t remote_lid,
3406 uint64_t serviceid, MAD_Data *MadData)
3408 /* the following saves information about the conversation this packet defines,
3409 so there's no point in doing it more than once per packet */
3410 if (!pinfo->fd->visited)
3412 connection_context *connection;
3413 conversation_infiniband_data *proto_data;
3414 conversation_t *conv;
3415 uint64_t *hash_key = g_new(uint64_t, 1);
3417 /* create a new connection context and store it in the hash table */
3418 connection = g_new(connection_context, 1);
3420 if (pinfo->dst.type == AT_IPv4) {
3421 memcpy(&(connection->req_gid), local_gid, 4);
3422 memcpy(&(connection->resp_gid), remote_gid, 4);
3423 } else {
3424 memcpy(&(connection->req_gid), local_gid, GID_SIZE);
3425 memcpy(&(connection->resp_gid), remote_gid, GID_SIZE);
3427 connection->req_lid = local_lid;
3428 connection->resp_lid = remote_lid;
3429 connection->req_qp = local_qpn;
3430 connection->resp_qp = 0; /* not currently known. we'll fill this in later */
3431 connection->service_id = serviceid;
3433 /* save the context to the context hash table, for retrieval when the corresponding
3434 CM REP message arrives */
3435 *hash_key = make_hash_key(MadData->transactionID, &pinfo->src);
3436 g_hash_table_replace(CM_context_table, hash_key, connection);
3438 /* Now we create a conversation for the CM exchange. This uses both
3439 sides of the conversation since CM packets also include the source
3440 QPN */
3441 proto_data = wmem_new(wmem_file_scope(), conversation_infiniband_data);
3442 proto_data->service_id = connection->service_id;
3443 proto_data->client_to_server = true;
3445 conv = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
3446 CONVERSATION_IBQP, pinfo->srcport, pinfo->destport, 0);
3447 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3449 /* create unidirection conversation for packets that will flow from
3450 * server to client.
3452 create_conv_and_add_proto_data(pinfo, connection->service_id, false,
3453 &pinfo->src, connection->req_lid,
3454 connection->req_qp, 0, NO_ADDR2|NO_PORT2,
3455 &MadData->data[0]);
3459 static void parse_IP_CM_Req_Msg(proto_tree *parent_tree, tvbuff_t *tvb, int local_offset)
3461 proto_item *private_data_item;
3462 proto_tree *private_data_tree;
3463 uint8_t ipv;
3465 private_data_item = proto_tree_add_item(parent_tree, hf_cm_req_ip_cm_req_msg, tvb, local_offset, 92, ENC_NA);
3466 proto_item_set_text(private_data_item, "%s", "IP CM Private Data");
3467 private_data_tree = proto_item_add_subtree(private_data_item, ett_cm_ipcm);
3469 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_majv, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3470 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_minv, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3471 local_offset += 1;
3473 ipv = (tvb_get_uint8(tvb, local_offset) & 0xf0) >> 4;
3475 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_ipv, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3476 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_res, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3477 local_offset += 1;
3478 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sport, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3479 local_offset += 2;
3481 if (ipv == 4) {
3482 /* skip first 12 bytes of zero for sip */
3483 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sip4, tvb, local_offset + 12, 4, ENC_NA);
3484 local_offset += 16;
3485 /* skip first 12 bytes of zero for dip */
3486 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip4, tvb, local_offset + 12, 4, ENC_NA);
3487 } else {
3488 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sip6, tvb, local_offset, 16, ENC_NA);
3489 local_offset += 16;
3490 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip6, tvb, local_offset, 16, ENC_NA);
3492 local_offset += 16;
3494 /* finally add the consumer specific private data as undecoded data */
3495 proto_tree_add_item(private_data_tree, hf_ip_cm_req_consumer_private_data,
3496 tvb, local_offset, 56, ENC_NA);
3499 static void parse_CM_Req(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset,
3500 MAD_Data *MadData, proto_tree *CM_header_tree, struct infinibandinfo *info)
3502 tvbuff_t *next_tvb;
3503 heur_dtbl_entry_t *hdtbl_entry;
3504 uint8_t *local_gid, *remote_gid;
3505 uint64_t serviceid;
3506 int local_offset;
3507 uint32_t local_qpn;
3508 uint32_t local_lid;
3509 uint32_t remote_lid;
3510 bool ip_cm_sid;
3512 local_offset = *offset;
3514 proto_tree_add_item(CM_header_tree, hf_cm_req_local_comm_id, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3515 local_offset += 4;
3516 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
3517 local_offset += 4;
3519 serviceid = tvb_get_ntoh64(tvb, local_offset);
3520 ip_cm_sid = parse_CM_Req_ServiceID(CM_header_tree, tvb, &local_offset, serviceid);
3522 proto_tree_add_item(CM_header_tree, hf_cm_req_local_ca_guid, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3523 local_offset += 8;
3524 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
3525 local_offset += 4;
3526 proto_tree_add_item(CM_header_tree, hf_cm_req_local_qkey, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3527 local_offset += 4;
3528 proto_tree_add_item(CM_header_tree, hf_cm_req_local_qpn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3529 local_qpn = tvb_get_ntoh24(tvb, local_offset);
3530 local_offset += 3;
3531 proto_tree_add_item(CM_header_tree, hf_cm_req_respo_res, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3532 local_offset += 1;
3533 proto_tree_add_item(CM_header_tree, hf_cm_req_local_eecn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3534 local_offset += 3;
3535 proto_tree_add_item(CM_header_tree, hf_cm_req_init_depth, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3536 local_offset += 1;
3537 proto_tree_add_item(CM_header_tree, hf_cm_req_remote_eecn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3538 local_offset += 3;
3539 proto_tree_add_item(CM_header_tree, hf_cm_req_remote_cm_resp_to, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3540 proto_tree_add_item(CM_header_tree, hf_cm_req_transp_serv_type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3541 proto_tree_add_item(CM_header_tree, hf_cm_req_e2e_flow_ctrl, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3542 local_offset += 1;
3543 proto_tree_add_item(CM_header_tree, hf_cm_req_start_psn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3544 local_offset += 3;
3545 proto_tree_add_item(CM_header_tree, hf_cm_req_local_cm_resp_to, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3546 proto_tree_add_item(CM_header_tree, hf_cm_req_retry_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3547 local_offset += 1;
3548 proto_tree_add_item(CM_header_tree, hf_cm_req_pkey, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3549 local_offset += 2;
3550 proto_tree_add_item(CM_header_tree, hf_cm_req_path_pp_mtu, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3551 proto_tree_add_item(CM_header_tree, hf_cm_req_rdc_exists, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3552 proto_tree_add_item(CM_header_tree, hf_cm_req_rnr_retry_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3553 local_offset += 1;
3554 proto_tree_add_item(CM_header_tree, hf_cm_req_max_cm_retries, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3555 proto_tree_add_item(CM_header_tree, hf_cm_req_srq, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3556 proto_tree_add_item(CM_header_tree, hf_cm_req_extended_transport, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3557 local_offset += 1;
3558 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3559 local_lid = tvb_get_ntohs(tvb, local_offset);
3560 local_offset += 2;
3561 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3562 remote_lid = tvb_get_ntohs(tvb, local_offset);
3563 local_offset += 2;
3565 if (pinfo->dst.type == AT_IPv4) {
3566 local_gid = (uint8_t *)wmem_alloc(pinfo->pool, 4);
3567 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_gid_ipv4, tvb, local_offset + 12, 4, ENC_NA);
3568 (*(uint32_t*)local_gid) = tvb_get_ipv4(tvb, local_offset + 12);
3569 local_offset += 16;
3571 remote_gid = (uint8_t *)wmem_alloc(pinfo->pool, 4);
3572 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_gid_ipv4, tvb, local_offset + 12, 4, ENC_NA);
3573 (*(uint32_t*)remote_gid) = tvb_get_ipv4(tvb, local_offset + 12);
3574 } else {
3575 local_gid = (uint8_t *)wmem_alloc(pinfo->pool, GID_SIZE);
3576 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_gid, tvb, local_offset, 16, ENC_NA);
3577 tvb_get_ipv6(tvb, local_offset, (ws_in6_addr*)local_gid);
3578 local_offset += 16;
3580 remote_gid = (uint8_t *)wmem_alloc(pinfo->pool, GID_SIZE);
3581 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_gid, tvb, local_offset, 16, ENC_NA);
3582 tvb_get_ipv6(tvb, local_offset, (ws_in6_addr*)remote_gid);
3584 local_offset += 16;
3586 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_flow_label, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3587 local_offset += 2;
3588 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_reserved0, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3589 local_offset += 1;
3590 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_packet_rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3591 local_offset += 1;
3592 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_traffic_class, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3593 local_offset += 1;
3594 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_hop_limit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3595 local_offset += 1;
3596 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_sl, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3597 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_subnet_local, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3598 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_reserved1, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3599 local_offset += 1;
3600 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_ack_to, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3601 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_reserved2, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3602 local_offset += 1;
3603 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_local_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3604 local_offset += 2;
3605 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_remote_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3606 local_offset += 2;
3607 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_local_gid, tvb, local_offset, 16, ENC_NA);
3608 local_offset += 16;
3609 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_remote_gid, tvb, local_offset, 16, ENC_NA);
3610 local_offset += 16;
3611 proto_tree_add_item(CM_header_tree, hf_cm_req_flow_label, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3612 local_offset += 2;
3613 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_reserved0, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3614 local_offset += 1;
3615 proto_tree_add_item(CM_header_tree, hf_cm_req_packet_rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3616 local_offset += 1;
3617 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_traffic_class, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3618 local_offset += 1;
3619 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_hop_limit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3620 local_offset += 1;
3621 proto_tree_add_item(CM_header_tree, hf_cm_req_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3622 proto_tree_add_item(CM_header_tree, hf_cm_req_subnet_local, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3623 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_reserved1, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3624 local_offset += 1;
3625 proto_tree_add_item(CM_header_tree, hf_cm_req_local_ACK_timeout, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3626 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_reserved2, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3627 local_offset += 1;
3629 save_conversation_info(pinfo, local_gid, remote_gid, local_qpn, local_lid, remote_lid, serviceid, MadData);
3631 if (ip_cm_sid) {
3632 /* decode IP CM service specific private data */
3633 parse_IP_CM_Req_Msg(CM_header_tree, tvb, local_offset);
3634 /* ip_cm.req is 36 in length */
3635 next_tvb = tvb_new_subset_length(tvb, local_offset+36, 56);
3636 } else {
3637 /* Add the undecoded private data anyway as RDMA CM private data */
3638 proto_tree_add_item(CM_header_tree, hf_cm_req_private_data, tvb, local_offset, 92, ENC_NA);
3639 next_tvb = tvb_new_subset_length(tvb, local_offset, 92);
3642 /* give a chance for subdissectors to analyze the private data */
3643 dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, top_tree, &hdtbl_entry, info);
3645 local_offset += 92;
3646 *offset = local_offset;
3649 static void create_bidi_conv(packet_info *pinfo, connection_context *connection)
3651 conversation_t *conv;
3652 conversation_infiniband_data *proto_data;
3654 proto_data = wmem_new(wmem_file_scope(), conversation_infiniband_data);
3655 proto_data->service_id = connection->service_id;
3656 proto_data->client_to_server = false;
3657 memset(&proto_data->mad_private_data[0], 0, MAD_DATA_SIZE);
3658 conv = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
3659 CONVERSATION_IBQP, connection->resp_qp,
3660 connection->req_qp, 0);
3661 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3664 static void
3665 attach_connection_to_pinfo(packet_info *pinfo, connection_context *connection,
3666 MAD_Data *MadData)
3668 address req_addr,
3669 resp_addr; /* we'll fill these in and pass them to conversation_new */
3671 /* RC traffic never(?) includes a field indicating the source QPN, so
3672 the destination host knows it only from previous context (a single
3673 QPN on the host that is part of an RC can only receive traffic from
3674 that RC). For this reason we do not register conversations with both
3675 sides, but rather we register the same conversation twice - once for
3676 each side of the Reliable Connection. */
3678 if (pinfo->dst.type == AT_IPv4) {
3679 set_address(&req_addr, AT_IPv4, 4, connection->req_gid);
3680 set_address(&resp_addr, AT_IPv4, 4, connection->resp_gid);
3681 } else if (pinfo->dst.type == AT_IPv6) {
3682 set_address(&req_addr, AT_IPv6, GID_SIZE, connection->req_gid);
3683 set_address(&resp_addr, AT_IPv6, GID_SIZE, connection->resp_gid);
3684 } else {
3685 set_address(&req_addr, AT_IB, GID_SIZE, connection->req_gid);
3686 set_address(&resp_addr, AT_IB, GID_SIZE, connection->resp_gid);
3689 /* create conversations:
3690 * first for client to server direction so that upper level protocols
3691 * can do appropriate dissection depending on the message direction.
3693 create_conv_and_add_proto_data(pinfo, connection->service_id, true,
3694 &resp_addr, connection->resp_lid,
3695 connection->resp_qp, connection->req_qp,
3696 NO_ADDR2|NO_PORT2, &MadData->data[0]);
3697 /* now create bidirectional connection that can be looked upon
3698 * by ULP for stateful context in both directions.
3700 create_bidi_conv(pinfo, connection);
3703 static void update_passive_conv_info(packet_info *pinfo,
3704 connection_context *connection)
3706 conversation_t *conv;
3707 conversation_infiniband_data *conv_data;
3709 conv = find_conversation(pinfo->num, &pinfo->dst, &pinfo->dst,
3710 CONVERSATION_IBQP, connection->req_qp, connection->req_qp,
3711 NO_ADDR_B|NO_PORT_B);
3712 if (!conv)
3713 return; /* nothing to do with no conversation context */
3715 conv_data = (conversation_infiniband_data *)conversation_get_proto_data(conv, proto_infiniband);
3716 if (!conv_data)
3717 return;
3718 conv_data->src_qp = connection->resp_qp;
3721 static void update_conversation_info(packet_info *pinfo,
3722 uint32_t remote_qpn,
3723 MAD_Data *MadData)
3725 /* the following saves information about the conversation this packet defines,
3726 so there's no point in doing it more than once per packet */
3727 if (!pinfo->fd->visited) {
3728 /* get the previously saved context for this connection */
3729 connection_context *connection;
3731 connection = lookup_connection(MadData->transactionID, &pinfo->dst);
3733 /* if an appropriate connection was not found there's something wrong, but nothing we can
3734 do about it here - so just skip saving the context */
3735 if (connection) {
3736 connection->resp_qp = remote_qpn;
3737 update_passive_conv_info(pinfo, connection);
3738 attach_connection_to_pinfo(pinfo, connection, MadData);
3743 static void parse_CM_Rsp(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset,
3744 MAD_Data *MadData, proto_tree *CM_header_tree, struct infinibandinfo *info)
3746 tvbuff_t *next_tvb;
3747 heur_dtbl_entry_t *hdtbl_entry;
3748 uint32_t remote_qpn;
3749 int local_offset;
3751 local_offset = *offset;
3753 proto_tree_add_item(CM_header_tree, hf_cm_rep_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3754 local_offset += 4;
3755 proto_tree_add_item(CM_header_tree, hf_cm_rep_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3756 local_offset += 4;
3757 proto_tree_add_item(CM_header_tree, hf_cm_rep_localqkey, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3758 local_offset += 4;
3759 proto_tree_add_item(CM_header_tree, hf_cm_rep_localqpn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3760 remote_qpn = tvb_get_ntoh24(tvb, local_offset);
3761 local_offset += 3;
3762 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3763 local_offset += 1;
3764 proto_tree_add_item(CM_header_tree, hf_cm_rep_localeecontnum, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3765 local_offset += 3;
3766 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3767 local_offset += 1;
3768 proto_tree_add_item(CM_header_tree, hf_cm_rep_startingpsn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3769 local_offset += 3;
3770 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3771 local_offset += 1;
3772 proto_tree_add_item(CM_header_tree, hf_cm_rep_responderres, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3773 local_offset += 1;
3774 proto_tree_add_item(CM_header_tree, hf_cm_rep_initiatordepth, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3775 local_offset += 1;
3776 proto_tree_add_item(CM_header_tree, hf_cm_rep_tgtackdelay, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3777 proto_tree_add_item(CM_header_tree, hf_cm_rep_failoveracc, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3778 proto_tree_add_item(CM_header_tree, hf_cm_rep_e2eflowctl, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3779 local_offset += 1;
3780 proto_tree_add_item(CM_header_tree, hf_cm_rep_rnrretrycount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3781 proto_tree_add_item(CM_header_tree, hf_cm_rep_srq, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3782 proto_tree_add_item(CM_header_tree, hf_cm_rep_reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3783 local_offset += 1;
3784 proto_tree_add_item(CM_header_tree, hf_cm_rep_localcaguid, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3785 local_offset += 8;
3786 proto_tree_add_item(CM_header_tree, hf_cm_rep_privatedata, tvb, local_offset, 196, ENC_NA);
3788 update_conversation_info(pinfo, remote_qpn, MadData);
3790 /* give a chance for subdissectors to get the private data */
3791 next_tvb = tvb_new_subset_length(tvb, local_offset, 196);
3792 dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, top_tree, &hdtbl_entry, info);
3794 local_offset += 196;
3795 *offset = local_offset;
3798 static connection_context*
3799 try_connection_dissectors(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb,
3800 address *addr, MAD_Data *MadData, struct infinibandinfo *info,
3801 int pdata_offset, int pdata_length)
3803 tvbuff_t *next_tvb;
3804 heur_dtbl_entry_t *hdtbl_entry;
3805 connection_context *connection;
3807 connection = lookup_connection(MadData->transactionID, addr);
3809 next_tvb = tvb_new_subset_length(tvb, pdata_offset, pdata_length);
3810 dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, top_tree,
3811 &hdtbl_entry, info);
3812 return connection;
3815 static void parse_CM_Rtu(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset,
3816 MAD_Data *MadData, proto_tree *CM_header_tree,
3817 struct infinibandinfo *info)
3819 int local_offset;
3821 local_offset = *offset;
3822 proto_tree_add_item(CM_header_tree, hf_cm_rtu_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3823 local_offset += 4;
3824 proto_tree_add_item(CM_header_tree, hf_cm_rtu_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3825 local_offset += 4;
3826 proto_tree_add_item(CM_header_tree, hf_cm_rtu_privatedata, tvb, local_offset, 224, ENC_NA);
3827 try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->src, MadData, info, local_offset, 224);
3828 local_offset += 224;
3829 *offset = local_offset;
3832 static void parse_CM_Rej(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset,
3833 MAD_Data *MadData, proto_tree *CM_header_tree,
3834 struct infinibandinfo *info)
3836 int local_offset;
3838 local_offset = *offset;
3839 proto_tree_add_item(CM_header_tree, hf_cm_rej_local_commid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3840 local_offset += 4;
3841 proto_tree_add_item(CM_header_tree, hf_cm_rej_remote_commid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3842 local_offset += 4;
3843 proto_tree_add_item(CM_header_tree, hf_cm_rej_msg_rej, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3844 proto_tree_add_item(CM_header_tree, hf_cm_rej_msg_reserved0, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3845 local_offset += 1;
3846 proto_tree_add_item(CM_header_tree, hf_cm_rej_rej_info_len, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3847 proto_tree_add_item(CM_header_tree, hf_cm_rej_msg_reserved1, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3848 local_offset += 1;
3849 proto_tree_add_item(CM_header_tree, hf_cm_rej_reason, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3850 local_offset += 2;
3851 proto_tree_add_item(CM_header_tree, hf_cm_rej_add_rej_info, tvb, local_offset, 72, ENC_NA);
3852 local_offset += 72;
3853 proto_tree_add_item(CM_header_tree, hf_cm_rej_private_data, tvb, local_offset, 148, ENC_NA);
3855 try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->dst, MadData, info, local_offset, 148);
3856 local_offset += 148;
3857 *offset = local_offset;
3860 static void parse_CM_DReq(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset,
3861 MAD_Data *MadData, proto_tree *CM_header_tree,
3862 struct infinibandinfo *info)
3864 int local_offset;
3866 local_offset = *offset;
3867 proto_tree_add_item(CM_header_tree, hf_cm_dreq_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3868 local_offset += 4;
3869 proto_tree_add_item(CM_header_tree, hf_cm_dreq_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3870 local_offset += 4;
3871 proto_tree_add_item(CM_header_tree, hf_cm_dreq_remote_qpn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3872 local_offset += 3;
3873 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3874 local_offset += 1;
3875 proto_tree_add_item(CM_header_tree, hf_cm_dreq_privatedata, tvb, local_offset, 220, ENC_NA);
3876 try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->src, MadData, info, local_offset, 220);
3877 local_offset += 220;
3878 *offset = local_offset;
3881 static void parse_CM_DRsp(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset,
3882 MAD_Data *MadData, proto_tree *CM_header_tree,
3883 struct infinibandinfo *info)
3885 connection_context *connection;
3886 int local_offset;
3888 local_offset = *offset;
3889 proto_tree_add_item(CM_header_tree, hf_cm_drsp_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3890 local_offset += 4;
3891 proto_tree_add_item(CM_header_tree, hf_cm_drsp_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3892 local_offset += 4;
3893 proto_tree_add_item(CM_header_tree, hf_cm_drsp_privatedata, tvb, local_offset, 224, ENC_NA);
3895 /* connection is closing so remove entry from the connection table */
3896 connection = try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->dst, MadData, info, local_offset, 224);
3897 if (connection)
3898 remove_connection(MadData->transactionID, &pinfo->dst);
3900 local_offset += 224;
3901 *offset = local_offset;
3904 /* Parse Communication Management
3905 * IN: parentTree to add the dissection to
3906 * IN: tvb - the data buffer from wireshark
3907 * IN/OUT: The current and updated offset */
3908 static void parse_COM_MGT(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, int *offset, proto_tree* top_tree)
3910 MAD_Data MadData;
3911 struct infinibandinfo info = { NULL, 0, 0, 0, 0, 0, 0, 0, false};
3912 int local_offset;
3913 const char *label;
3914 proto_item *CM_header_item;
3915 proto_tree *CM_header_tree;
3917 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3919 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3920 return;
3922 local_offset = *offset;
3924 CM_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3926 label = val_to_str_const(MadData.attributeID, CM_Attributes, "(Unknown CM Attribute)");
3928 proto_item_set_text(CM_header_item, "CM %s", label);
3929 col_add_fstr(pinfo->cinfo, COL_INFO, "CM: %s", label);
3931 CM_header_tree = proto_item_add_subtree(CM_header_item, ett_cm);
3933 info.payload_tree = parentTree;
3934 switch (MadData.attributeID) {
3935 case ATTR_CM_REQ:
3936 info.cm_attribute_id = ATTR_CM_REQ;
3937 parse_CM_Req(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3938 break;
3939 case ATTR_CM_REP:
3940 info.cm_attribute_id = ATTR_CM_REP;
3941 parse_CM_Rsp(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3942 break;
3943 case ATTR_CM_RTU:
3944 info.cm_attribute_id = ATTR_CM_RTU;
3945 parse_CM_Rtu(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3946 break;
3947 case ATTR_CM_REJ:
3948 info.cm_attribute_id = ATTR_CM_REJ;
3949 parse_CM_Rej(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3950 break;
3951 case ATTR_CM_DREQ:
3952 info.cm_attribute_id = ATTR_CM_DREQ;
3953 parse_CM_DReq(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3954 break;
3955 case ATTR_CM_DRSP:
3956 info.cm_attribute_id = ATTR_CM_DRSP;
3957 parse_CM_DRsp(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3958 break;
3959 default:
3960 proto_item_append_text(CM_header_item, " (Dissector Not Implemented)");
3961 local_offset += MAD_DATA_SIZE;
3962 break;
3965 *offset = local_offset;
3968 /* Parse SNMP Tunneling
3969 * IN: parentTree to add the dissection to
3970 * IN: tvb - the data buffer from wireshark
3971 * IN/OUT: The current and updated offset */
3972 static void parse_SNMP(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
3974 /* Parse the Common MAD Header */
3975 MAD_Data MadData;
3976 int local_offset;
3977 proto_item *SNMP_header_item;
3979 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3981 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3982 return;
3984 local_offset = *offset;
3986 SNMP_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3987 local_offset += MAD_DATA_SIZE;
3988 proto_item_set_text(SNMP_header_item, "%s", "SNMP - SNMP Tunneling MAD (Dissector Not Implemented)");
3989 *offset = local_offset;
3992 /* Parse Vendor Specific Management Packets
3993 * IN: parentTree to add the dissection to
3994 * IN: tvb - the data buffer from wireshark
3995 * IN/OUT: The current and updated offset */
3996 static void parse_VENDOR_MANAGEMENT(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
3998 /* Parse the Common MAD Header */
3999 MAD_Data MadData;
4000 int local_offset;
4001 proto_item *VENDOR_header_item;
4003 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
4005 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
4006 return;
4008 local_offset = *offset;
4010 VENDOR_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
4011 local_offset += MAD_DATA_SIZE;
4012 proto_item_set_text(VENDOR_header_item, "%s", "VENDOR - Vendor Specific Management MAD (Dissector Not Implemented)");
4013 *offset = local_offset;
4016 /* Parse Application Specific Management Packets
4017 * IN: parentTree to add the dissection to
4018 * IN: tvb - the data buffer from wireshark
4019 * IN/OUT: The current and updated offset */
4020 static void parse_APPLICATION_MANAGEMENT(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
4022 /* Parse the Common MAD Header */
4023 MAD_Data MadData;
4024 int local_offset;
4025 proto_item *APP_header_item;
4027 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
4029 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
4030 return;
4032 local_offset = *offset;
4033 APP_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
4034 local_offset += MAD_DATA_SIZE;
4035 proto_item_set_text(APP_header_item, "%s", "APP - Application Specific MAD (Dissector Not Implemented)");
4036 *offset = local_offset;
4039 /* Parse Reserved Management Packets.
4041 * This is an !ERROR CONDITION!
4042 * It means that the Management Class value used was defined as a reserved value for furture use.
4043 * This method is here since we will want to report this information directly to the UI without blowing up Wireshark.
4045 * IN: parentTree to add the dissection to
4046 * IN: tvb - the data buffer from wireshark
4047 * IN/OUT: The current and updated offset */
4048 static void parse_RESERVED_MANAGEMENT(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
4050 /* Parse the Common MAD Header */
4051 MAD_Data MadData;
4052 int local_offset;
4053 proto_item *RESV_header_item;
4055 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
4057 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
4058 return;
4060 local_offset = *offset;
4061 RESV_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 256, ENC_NA);
4062 local_offset += 256;
4063 proto_item_set_text(RESV_header_item, "%s", "RESERVED - Reserved MAD Type (Possible Device Error)");
4064 *offset = local_offset;
4067 /* Parse the common MAD Header
4068 * IN: parentTree to add the dissection to
4069 * IN: tvb - the data buffer from wireshark
4070 * IN/OUT: The current and updated offset
4071 * IN/OUT: MadData - the data from the MAD header */
4072 static bool parse_MAD_Common(proto_tree *parentTree, tvbuff_t *tvb, int *offset, MAD_Data* MadData)
4074 int local_offset = *offset;
4075 proto_item *MAD_header_item;
4076 proto_tree *MAD_header_tree;
4078 if (MadData == NULL)
4079 return false;
4080 if (!tvb_bytes_exist(tvb, *offset, 256))
4081 return false;
4083 /* Get the Management Class to decide between LID Routed and Direct Route */
4084 MadData->managementClass = tvb_get_uint8(tvb, local_offset + 1);
4085 MadData->classVersion = tvb_get_uint8(tvb, local_offset + 2);
4086 MadData->method = tvb_get_uint8(tvb, local_offset + 3);
4087 MadData->status = tvb_get_uint8(tvb, local_offset + 4);
4088 MadData->classSpecific = tvb_get_ntohs(tvb, local_offset + 6);
4089 MadData->transactionID = tvb_get_ntoh64(tvb, local_offset + 8);
4090 MadData->attributeID = tvb_get_ntohs(tvb, local_offset + 16);
4091 MadData->attributeModifier = tvb_get_ntohl(tvb, local_offset + 20);
4092 tvb_memcpy(tvb, MadData->data, local_offset + 24, MAD_DATA_SIZE);
4094 /* Populate the Dissector Tree */
4096 MAD_header_item = proto_tree_add_item(parentTree, hf_infiniband_MAD, tvb, local_offset, 256, ENC_NA);
4097 proto_item_set_text(MAD_header_item, "%s", "MAD Header - Common Management Datagram");
4098 MAD_header_tree = proto_item_add_subtree(MAD_header_item, ett_mad);
4100 proto_tree_add_item(MAD_header_tree, hf_infiniband_base_version, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4101 local_offset += 1;
4102 proto_tree_add_item(MAD_header_tree, hf_infiniband_mgmt_class, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4103 local_offset += 1;
4104 proto_tree_add_item(MAD_header_tree, hf_infiniband_class_version, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4105 local_offset += 1;
4106 proto_tree_add_item(MAD_header_tree, hf_infiniband_method, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4107 local_offset += 1;
4108 proto_tree_add_item(MAD_header_tree, hf_infiniband_status, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4109 local_offset += 2;
4110 proto_tree_add_item(MAD_header_tree, hf_infiniband_class_specific, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4111 local_offset += 2;
4112 proto_tree_add_item(MAD_header_tree, hf_infiniband_transaction_id, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4113 local_offset += 8;
4114 proto_tree_add_item(MAD_header_tree, hf_infiniband_attribute_id, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4115 local_offset += 2;
4116 proto_tree_add_item(MAD_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
4117 local_offset += 2;
4118 proto_tree_add_item(MAD_header_tree, hf_infiniband_attribute_modifier, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4119 local_offset += 4;
4120 proto_tree_add_item(MAD_header_tree, hf_infiniband_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
4121 *offset = local_offset; /* Move the offset to the start of the Data field - this will be where the other parsers start. */
4123 return true;
4126 /* Parse the RMPP (Reliable Multi-Packet Transaction Protocol
4127 * IN: parentTree to add the dissection to
4128 * IN: tvb - the data buffer from wireshark
4129 * IN/OUT: The current and updated offset */
4130 static bool parse_RMPP(proto_tree *parentTree, tvbuff_t *tvb, int *offset)
4132 int local_offset = *offset;
4133 uint8_t RMPP_Type = tvb_get_uint8(tvb, local_offset + 1);
4134 proto_item *RMPP_header_item;
4135 proto_tree *RMPP_header_tree;
4137 RMPP_header_item = proto_tree_add_item(parentTree, hf_infiniband_RMPP, tvb, local_offset, 12, ENC_NA);
4138 proto_item_set_text(RMPP_header_item, "%s", val_to_str(RMPP_Type, RMPP_Packet_Types, "Reserved RMPP Type! (0x%02x)"));
4139 RMPP_header_tree = proto_item_add_subtree(RMPP_header_item, ett_rmpp);
4141 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_version, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4142 local_offset += 1;
4143 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4144 local_offset += 1;
4145 proto_tree_add_item(RMPP_header_tree, hf_infiniband_r_resp_time, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4146 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_flags, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4147 local_offset += 1;
4148 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_status, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4149 local_offset += 1;
4150 switch (RMPP_Type)
4152 case RMPP_NOT_USED:
4153 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_data1, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4154 local_offset += 4;
4155 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_data2, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4156 local_offset += 4;
4157 break;
4158 case RMPP_DATA:
4159 proto_tree_add_item(RMPP_header_tree, hf_infiniband_segment_number, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4160 local_offset += 4;
4161 proto_tree_add_item(RMPP_header_tree, hf_infiniband_payload_length32, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4162 local_offset += 4;
4163 proto_tree_add_item(RMPP_header_tree, hf_infiniband_transferred_data, tvb, local_offset, 220, ENC_NA);
4164 break;
4165 case RMPP_ACK:
4166 proto_tree_add_item(RMPP_header_tree, hf_infiniband_segment_number, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4167 local_offset += 4;
4168 proto_tree_add_item(RMPP_header_tree, hf_infiniband_new_window_last, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4169 local_offset += 4;
4170 proto_tree_add_item(RMPP_header_tree, hf_infiniband_reserved, tvb, local_offset, 220, ENC_NA);
4171 break;
4172 case RMPP_STOP:
4173 case RMPP_ABORT:
4174 proto_tree_add_item(RMPP_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
4175 local_offset += 4;
4176 proto_tree_add_item(RMPP_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
4177 local_offset += 4;
4178 proto_tree_add_item(RMPP_header_tree, hf_infiniband_optional_extended_error_data, tvb, local_offset, 220, ENC_NA);
4179 break;
4180 default:
4181 break;
4183 *offset = local_offset;
4184 return true;
4187 /* Parse the Method from the MAD Common Header.
4188 * Simply used to generate the identifier.
4189 * IN: SubMItem - the item to append the method label to.
4190 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4191 * IN: pinfo - packet info from wireshark. */
4192 static void label_SUBM_Method(proto_item *SubMItem, MAD_Data *MadHeader, packet_info *pinfo)
4194 const char *label = val_to_str_const(MadHeader->method, SUBM_Methods, "(Unknown SubManagement Method!)");
4196 proto_item_append_text(SubMItem, "%s", label);
4197 col_append_str(pinfo->cinfo, COL_INFO, label);
4200 /* Parse the SA Method from the MAD Common Header.
4201 * Simply used to generate the identifier.
4202 * IN: SubAItem - the item to append the method label to.
4203 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4204 * IN: pinfo - packet info from wireshark. */
4205 static void label_SUBA_Method(proto_item *SubAItem, MAD_Data *MadHeader, packet_info *pinfo)
4207 const char *label = val_to_str_const(MadHeader->method, SUBA_Methods, "(Unknown SubAdministration Method!)");
4209 proto_item_append_text(SubAItem, "%s", label);
4210 col_append_str(pinfo->cinfo, COL_INFO, label);
4213 /* Parse the Attribute from the MAD Common Header
4214 * Simply used to generate the identifier.
4215 * IN: SubMItem - the item to append the Attribute label to.
4216 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4217 * IN: pinfo - packet info from wireshark. */
4218 static void label_SUBM_Attribute(proto_item *SubMItem, MAD_Data *MadHeader, packet_info *pinfo)
4220 const char *label = val_to_str_const(MadHeader->attributeID, SUBM_Attributes, "(Unknown SubManagement Attribute!)");
4222 proto_item_append_text(SubMItem, "%s", &label[11]);
4223 col_append_str(pinfo->cinfo, COL_INFO, &label[11]);
4226 /* Parse the SA Attribute from the MAD Common Header
4227 * Simply used to generate the identifier.
4228 * IN: SubAItem - the item to append the Attribute label to.
4229 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4230 * IN: pinfo - packet info from wireshark. */
4231 static void label_SUBA_Attribute(proto_item *SubAItem, MAD_Data *MadHeader, packet_info *pinfo)
4233 const char *label = val_to_str_const(MadHeader->attributeID, SUBA_Attributes, "(Unknown SubAdministration Attribute!)");
4235 proto_item_append_text(SubAItem, "%s", &label[11]);
4236 col_append_str(pinfo->cinfo, COL_INFO, &label[11]);
4239 /* Parse the attribute from a Subnet Management Packet.
4240 * IN: Parent Tree to add the item to in the dissection tree
4241 * IN: tvbuff, offset - the data and where it is.
4242 * IN: MAD_Data the data from the Common MAD Header that provides the information we need */
4243 static bool parse_SUBM_Attribute(proto_tree *parentTree, tvbuff_t *tvb, int *offset, MAD_Data *MadHeader)
4245 uint16_t attributeID = MadHeader->attributeID;
4246 proto_item *SUBM_Attribute_header_item;
4247 proto_tree *SUBM_Attribute_header_tree;
4249 SUBM_Attribute_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, *offset, 64, ENC_NA);
4250 proto_item_set_text(SUBM_Attribute_header_item, "%s", val_to_str(attributeID, SUBM_Attributes, "Unknown Attribute Type! (0x%02x)"));
4251 SUBM_Attribute_header_tree = proto_item_add_subtree(SUBM_Attribute_header_item, ett_subm_attribute);
4254 switch (attributeID)
4256 case 0x0002:
4257 parse_NoticesAndTraps(SUBM_Attribute_header_tree , tvb, offset);
4258 break;
4259 case 0x0010:
4260 parse_NodeDescription(SUBM_Attribute_header_tree , tvb, offset);
4261 break;
4262 case 0x0011:
4263 parse_NodeInfo(SUBM_Attribute_header_tree , tvb, offset);
4264 break;
4265 case 0x0012:
4266 parse_SwitchInfo(SUBM_Attribute_header_tree , tvb, offset);
4267 break;
4268 case 0x0014:
4269 parse_GUIDInfo(SUBM_Attribute_header_tree , tvb, offset);
4270 break;
4271 case 0x0015:
4272 parse_PortInfo(SUBM_Attribute_header_tree , tvb, offset);
4273 break;
4274 case 0x0016:
4275 parse_P_KeyTable(SUBM_Attribute_header_tree , tvb, offset);
4276 break;
4277 case 0x0017:
4278 parse_SLtoVLMappingTable(SUBM_Attribute_header_tree , tvb, offset);
4279 break;
4280 case 0x0018:
4281 parse_VLArbitrationTable(SUBM_Attribute_header_tree , tvb, offset);
4282 break;
4283 case 0x0019:
4284 parse_LinearForwardingTable(SUBM_Attribute_header_tree , tvb, offset);
4285 break;
4286 case 0x001A:
4287 parse_RandomForwardingTable(SUBM_Attribute_header_tree , tvb, offset);
4288 break;
4289 case 0x001B:
4290 parse_MulticastForwardingTable(SUBM_Attribute_header_tree , tvb, offset);
4291 break;
4292 case 0x001C:
4293 parse_LinkSpeedWidthPairsTable(SUBM_Attribute_header_tree , tvb, offset);
4294 break;
4295 case 0x0020:
4296 parse_SMInfo(SUBM_Attribute_header_tree , tvb, offset);
4297 break;
4298 case 0x0030:
4299 parse_VendorDiag(SUBM_Attribute_header_tree , tvb, offset);
4300 break;
4301 case 0x0031:
4302 parse_LedInfo(SUBM_Attribute_header_tree , tvb, offset);
4303 break;
4304 default:
4305 break;
4309 *offset += 64;
4310 return true;
4313 /* Parse the attribute from a Subnet Administration Packet.
4314 * IN: Parent Tree to add the item to in the dissection tree
4315 * IN: tvbuff, offset - the data and where it is.
4316 * IN: MAD_Data the data from the Common MAD Header that provides the information we need */
4317 static bool parse_SUBA_Attribute(proto_tree *parentTree, tvbuff_t *tvb, int *offset, MAD_Data *MadHeader)
4319 uint16_t attributeID = MadHeader->attributeID;
4320 proto_item *SUBA_Attribute_header_item;
4321 proto_tree *SUBA_Attribute_header_tree;
4323 SUBA_Attribute_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, *offset, 200, ENC_NA);
4324 proto_item_set_text(SUBA_Attribute_header_item, "%s", val_to_str(attributeID, SUBA_Attributes, "Unknown Attribute Type! (0x%02x)"));
4325 SUBA_Attribute_header_tree = proto_item_add_subtree(SUBA_Attribute_header_item, ett_suba_attribute);
4327 /* Skim off the RID fields should they be present */
4328 parse_RID(SUBA_Attribute_header_tree, tvb, offset, MadHeader);
4330 /* Parse the rest of the attributes */
4331 switch (MadHeader->attributeID)
4333 case 0x0001: /* (ClassPortInfo) */
4334 parse_ClassPortInfo(SUBA_Attribute_header_tree, tvb, offset);
4335 break;
4336 case 0x0002: /* (Notice) */
4337 parse_NoticesAndTraps(SUBA_Attribute_header_tree, tvb, offset);
4338 break;
4339 case 0x0003: /* (InformInfo) */
4340 parse_InformInfo(SUBA_Attribute_header_tree, tvb, offset);
4341 break;
4342 case 0x0011: /* (NodeRecord) */
4343 parse_NodeInfo(SUBA_Attribute_header_tree, tvb, offset);
4344 *offset += 40;
4345 parse_NodeDescription(SUBA_Attribute_header_tree, tvb, offset);
4346 break;
4347 case 0x0012: /* (PortInfoRecord) */
4348 parse_PortInfo(SUBA_Attribute_header_tree, tvb, offset);
4349 break;
4350 case 0x0013: /* (SLtoVLMappingTableRecord) */
4351 parse_SLtoVLMappingTable(SUBA_Attribute_header_tree, tvb, offset);
4352 break;
4353 case 0x0014: /* (SwitchInfoRecord) */
4354 parse_SwitchInfo(SUBA_Attribute_header_tree, tvb, offset);
4355 break;
4356 case 0x0015: /*(LinearForwardingTableRecord) */
4357 parse_LinearForwardingTable(SUBA_Attribute_header_tree, tvb, offset);
4358 break;
4359 case 0x0016: /* (RandomForwardingTableRecord) */
4360 parse_RandomForwardingTable(SUBA_Attribute_header_tree, tvb, offset);
4361 break;
4362 case 0x0017: /* (MulticastForwardingTableRecord) */
4363 parse_MulticastForwardingTable(SUBA_Attribute_header_tree, tvb, offset);
4364 break;
4365 case 0x0018: /* (SMInfoRecord) */
4366 parse_SMInfo(SUBA_Attribute_header_tree, tvb, offset);
4367 break;
4368 case 0x0019: /* (LinkSpeedWidthPairsTableRecord) */
4369 parse_LinkSpeedWidthPairsTable(SUBA_Attribute_header_tree, tvb, offset);
4370 break;
4371 case 0x00F3: /*(InformInfoRecord) */
4372 parse_InformInfo(SUBA_Attribute_header_tree, tvb, offset);
4373 break;
4374 case 0x0020: /* (LinkRecord) */
4375 parse_LinkRecord(SUBA_Attribute_header_tree, tvb, offset);
4376 break;
4377 case 0x0030: /* (GuidInfoRecord) */
4378 parse_GUIDInfo(SUBA_Attribute_header_tree, tvb, offset);
4379 break;
4380 case 0x0031: /*(ServiceRecord) */
4381 parse_ServiceRecord(SUBA_Attribute_header_tree, tvb, offset);
4382 break;
4383 case 0x0033: /* (P_KeyTableRecord) */
4384 parse_P_KeyTable(SUBA_Attribute_header_tree, tvb, offset);
4385 break;
4386 case 0x0035: /* (PathRecord) */
4387 parse_PathRecord(SUBA_Attribute_header_tree, tvb, offset);
4388 break;
4389 case 0x0036: /* (VLArbitrationTableRecord) */
4390 parse_VLArbitrationTable(SUBA_Attribute_header_tree, tvb, offset);
4391 break;
4392 case 0x0038: /* (MCMemberRecord) */
4393 parse_MCMemberRecord(SUBA_Attribute_header_tree, tvb, offset);
4394 break;
4395 case 0x0039: /* (TraceRecord) */
4396 parse_TraceRecord(SUBA_Attribute_header_tree, tvb, offset);
4397 break;
4398 case 0x003A: /* (MultiPathRecord) */
4399 parse_MultiPathRecord(SUBA_Attribute_header_tree, tvb, offset);
4400 break;
4401 case 0x003B: /* (ServiceAssociationRecord) */
4402 parse_ServiceAssociationRecord(SUBA_Attribute_header_tree, tvb, offset);
4403 break;
4404 default: /* (Unknown SubAdministration Attribute!) */
4405 /* We've already labeled as unknown in item construction */
4406 break;
4409 *offset += 200;
4410 return true;
4413 /* Subnet Management Attribute Parsing Methods.
4414 * Also Parsing for Attributes common to both SM/SA.
4415 * The Subnet Admin Parsing methods will call some of these methods when an attribute is present within an SA MAD
4419 /* Parse ClassPortInfo Attribute Field
4420 * IN: parentTree - The tree to add the dissection to
4421 * tvb - The tvbbuff of packet data
4422 * offset - The offset in TVB where the attribute begins */
4423 static int parse_ClassPortInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4425 int local_offset = *offset;
4426 proto_tree *ClassPortInfo_header_tree;
4428 if (!parentTree)
4429 return *offset;
4431 ClassPortInfo_header_tree = parentTree;
4433 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_BaseVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4434 local_offset += 1;
4435 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_ClassVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4436 local_offset += 1;
4437 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_CapabilityMask, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4438 local_offset += 2;
4439 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_CapabilityMask2, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4440 local_offset += 3;
4442 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RespTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4443 local_offset += 1;
4444 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectGID, tvb, local_offset, 16, ENC_NA);
4445 local_offset += 16;
4446 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectTC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4447 local_offset += 1;
4448 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectSL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4449 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectFL, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4450 local_offset += 3;
4451 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4452 local_offset += 2;
4453 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectP_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4454 local_offset += 2;
4455 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_Reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4456 local_offset += 1;
4457 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectQP, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4458 local_offset += 3;
4459 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectQ_Key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4460 local_offset += 4;
4462 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapGID, tvb, local_offset, 16, ENC_NA);
4463 local_offset += 16;
4464 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapTC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4465 local_offset += 1;
4466 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapSL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4467 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapFL, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4468 local_offset += 3;
4469 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4470 local_offset += 2;
4471 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapP_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4472 local_offset += 2;
4473 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_Reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4474 local_offset += 1;
4475 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapQP, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4476 local_offset += 3;
4477 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapQ_Key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4478 local_offset += 4;
4480 return local_offset;
4483 /* Parse NoticeDataDetails Attribute Field
4484 * IN: parentTree - The tree to add the dissection to
4485 * tvb - The tvbbuff of packet data
4486 * offset - The offset in TVB where the attribute begins
4487 * trapNumber - The Trap ID of the Trap Data being Dissected */
4489 static int parse_NoticeDataDetails(proto_tree* parentTree, tvbuff_t* tvb, int *offset, uint16_t trapNumber)
4491 int local_offset = *offset;
4492 proto_item *DataDetails_header_item;
4493 proto_tree *DataDetails_header_tree;
4495 if (!parentTree)
4496 return 0;
4498 DataDetails_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 54, ENC_NA);
4499 DataDetails_header_tree = proto_item_add_subtree(DataDetails_header_item, ett_datadetails);
4502 switch (trapNumber)
4504 case 64:
4505 proto_item_set_text(DataDetails_header_item, "%s", "Trap 64 DataDetails");
4506 local_offset += 6;
4507 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4508 local_offset += 16;
4509 break;
4510 case 65:
4511 proto_item_set_text(DataDetails_header_item, "%s", "Trap 65 DataDetails");
4512 local_offset += 6;
4513 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4514 local_offset += 16;
4515 break;
4516 case 66:
4517 proto_item_set_text(DataDetails_header_item, "%s", "Trap 66 DataDetails");
4518 local_offset += 6;
4519 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4520 local_offset += 16;
4521 break;
4522 case 67:
4523 proto_item_set_text(DataDetails_header_item, "%s", "Trap 67 DataDetails");
4524 local_offset += 6;
4525 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4526 local_offset += 16;
4527 break;
4528 case 68:
4529 proto_item_set_text(DataDetails_header_item, "%s", "Trap 68 DataDetails");
4530 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_COMP_MASK, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4531 local_offset += 8;
4532 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_WAIT_FOR_REPATH, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4533 break;
4534 case 69:
4535 proto_item_set_text(DataDetails_header_item, "%s", "Trap 69 DataDetails");
4536 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_COMP_MASK, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4537 local_offset += 8;
4538 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_WAIT_FOR_REPATH, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4539 break;
4540 case 128:
4541 proto_item_set_text(DataDetails_header_item, "%s", "Trap 128 DataDetails");
4542 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4543 local_offset += 2;
4544 break;
4545 case 129:
4546 proto_item_set_text(DataDetails_header_item, "%s", "Trap 129 DataDetails");
4547 local_offset += 2;
4548 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4549 local_offset += 2;
4550 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4551 local_offset += 1;
4552 break;
4553 case 130:
4554 proto_item_set_text(DataDetails_header_item, "%s", "Trap 130 DataDetails");
4555 local_offset += 2;
4556 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4557 local_offset += 2;
4558 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4559 local_offset += 1;
4560 break;
4561 case 131:
4562 proto_item_set_text(DataDetails_header_item, "%s", "Trap 131 DataDetails");
4563 local_offset += 2;
4564 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4565 local_offset += 2;
4566 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4567 local_offset += 1;
4568 break;
4569 case 144:
4570 proto_item_set_text(DataDetails_header_item, "%s", "Trap 144 DataDetails");
4571 local_offset += 2;
4572 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4573 local_offset += 2;
4574 local_offset += 1;
4575 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_OtherLocalChanges, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4576 local_offset += 1;
4577 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_CAPABILITYMASK, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4578 local_offset += 4;
4579 local_offset += 1;
4580 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LinkSpeecEnabledChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4581 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LinkWidthEnabledChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4582 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_NodeDescriptionChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4583 break;
4584 case 145:
4585 proto_item_set_text(DataDetails_header_item, "%s", "Trap 145 DataDetails");
4586 local_offset += 2;
4587 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4588 local_offset += 2;
4589 local_offset += 2;
4590 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SYSTEMIMAGEGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4591 local_offset += 8;
4592 break;
4593 case 256:
4594 proto_item_set_text(DataDetails_header_item, "%s", "Trap 256 DataDetails");
4595 local_offset += 2;
4596 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4597 local_offset += 2;
4598 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRSLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4599 local_offset += 2;
4600 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_METHOD, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4601 local_offset += 1;
4602 local_offset += 1;
4603 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_ATTRIBUTEID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4604 local_offset += 2;
4605 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_ATTRIBUTEMODIFIER, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4606 local_offset += 4;
4607 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_MKEY, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4608 local_offset += 8;
4609 local_offset += 1;
4610 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRNotice, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4611 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRPathTruncated, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4612 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRHopCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4613 local_offset += 1;
4614 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRNoticeReturnPath, tvb, local_offset, 30, ENC_NA);
4615 local_offset += 30;
4616 break;
4617 case 257:
4618 proto_item_set_text(DataDetails_header_item, "%s", "Trap 257 DataDetails");
4619 local_offset += 2;
4620 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR1, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4621 local_offset += 2;
4622 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR2, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4623 local_offset += 2;
4624 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_KEY, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4625 local_offset += 4;
4626 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4627 local_offset += 1;
4628 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP1, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4629 local_offset += 3;
4630 local_offset += 1;
4631 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP2, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4632 local_offset += 3;
4633 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR1, tvb, local_offset, 16, ENC_NA);
4634 local_offset += 16;
4635 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR2, tvb, local_offset, 16, ENC_NA);
4636 local_offset += 16;
4637 break;
4638 case 258:
4639 proto_item_set_text(DataDetails_header_item, "%s", "Trap 258 DataDetails");
4640 local_offset += 2;
4641 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR1, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4642 local_offset += 2;
4643 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR2, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4644 local_offset += 2;
4645 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_KEY, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4646 local_offset += 4;
4647 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN); local_offset += 1;
4648 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP1, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4649 local_offset += 3;
4650 local_offset += 1;
4651 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP2, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4652 local_offset += 3;
4653 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR1, tvb, local_offset, 16, ENC_NA);
4654 local_offset += 16;
4655 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR2, tvb, local_offset, 16, ENC_NA);
4656 local_offset += 16;
4657 break;
4658 case 259:
4659 proto_item_set_text(DataDetails_header_item, "%s", "Trap 259 DataDetails");
4660 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DataValid, tvb, local_offset, 2, ENC_NA);
4661 local_offset += 2;
4662 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR1, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4663 local_offset += 2;
4664 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR2, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4665 local_offset += 2;
4666 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PKEY, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4667 local_offset += 2;
4668 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4669 local_offset += 1;
4670 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP1, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4671 local_offset += 3;
4672 local_offset += 1;
4673 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP2, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4674 local_offset += 3;
4675 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR1, tvb, local_offset, 16, ENC_NA);
4676 local_offset += 16;
4677 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR2, tvb, local_offset, 16, ENC_NA);
4678 local_offset += 16;
4679 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SWLIDADDR, tvb, local_offset, 2, ENC_NA);
4680 local_offset += 2;
4681 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4682 local_offset += 1;
4683 break;
4684 default:
4685 proto_item_set_text(DataDetails_header_item, "%s", "Vendor Specific Subnet Management Trap");
4686 local_offset += 54;
4687 break;
4690 return local_offset;
4693 /* Parse NoticesAndTraps Attribute
4694 * IN: parentTree - The tree to add the dissection to
4695 * tvb - The tvbbuff of packet data
4696 * offset - The offset in TVB where the attribute begins */
4697 static void parse_NoticesAndTraps(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4699 int local_offset = *offset;
4700 proto_item *NoticesAndTraps_header_item;
4701 proto_tree *NoticesAndTraps_header_tree;
4702 uint16_t trapNumber = tvb_get_ntohs(tvb, local_offset + 4);
4704 if (!parentTree)
4705 return;
4707 NoticesAndTraps_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
4708 proto_item_set_text(NoticesAndTraps_header_item, "%s", val_to_str(trapNumber, Trap_Description, "Unknown or Vendor Specific Trap Number! (0x%02x)"));
4709 NoticesAndTraps_header_tree = proto_item_add_subtree(NoticesAndTraps_header_item, ett_noticestraps);
4711 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_IsGeneric, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4712 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_Type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4713 local_offset += 1;
4714 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_ProducerTypeVendorID, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4715 local_offset += 3;
4716 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_TrapNumberDeviceID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4717 local_offset += 2;
4718 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_IssuerLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4719 local_offset += 2;
4720 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_NoticeToggle, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4721 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_NoticeCount, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4722 local_offset += 2;
4724 parse_NoticeDataDetails(NoticesAndTraps_header_tree, tvb, &local_offset, trapNumber);
4725 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_DataDetails, tvb, local_offset, 54, ENC_NA);
4726 local_offset += 54;
4728 #if 0 /* Only Defined For GMPs not SMPs which is not part of this dissector phase */
4729 *proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_IssuerGID, tvb, local_offset, 16, ENC_NA);
4730 local_offset += 16;
4731 *proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_ClassTrapSpecificData, tvb, local_offset, 1, ENC_NA);
4732 local_offset += 1;
4733 #endif
4737 /* Parse NodeDescription Attribute
4738 * IN: parentTree - The tree to add the dissection to
4739 * tvb - The tvbbuff of packet data
4740 * offset - The offset in TVB where the attribute begins */
4741 static void parse_NodeDescription(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4743 int local_offset = *offset;
4744 proto_tree *NodeDescription_header_tree;
4746 if (!parentTree)
4747 return;
4749 NodeDescription_header_tree = parentTree;
4750 proto_tree_add_item(NodeDescription_header_tree, hf_infiniband_NodeDescription_NodeString, tvb, local_offset, 64, ENC_ASCII);
4753 /* Parse NodeInfo Attribute
4754 * IN: parentTree - The tree to add the dissection to
4755 * tvb - The tvbbuff of packet data
4756 * offset - The offset in TVB where the attribute begins */
4757 static int parse_NodeInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4759 int local_offset = *offset;
4760 proto_tree *NodeInfo_header_tree;
4762 if (!parentTree)
4763 return *offset;
4765 NodeInfo_header_tree = parentTree;
4767 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_BaseVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4768 local_offset += 1;
4769 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_ClassVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4770 local_offset += 1;
4771 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_NodeType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4772 local_offset += 1;
4773 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_NumPorts, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4774 local_offset += 1;
4775 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_SystemImageGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4776 local_offset += 8;
4777 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_NodeGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4778 local_offset += 8;
4779 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_PortGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4780 local_offset += 8;
4781 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_PartitionCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4782 local_offset += 2;
4783 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_DeviceID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4784 local_offset += 2;
4785 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_Revision, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4786 local_offset += 4;
4787 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_LocalPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4788 local_offset += 1;
4789 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_VendorID, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4790 local_offset += 3;
4792 return local_offset;
4796 /* Parse SwitchInfo Attribute
4797 * IN: parentTree - The tree to add the dissection to
4798 * tvb - The tvbbuff of packet data
4799 * offset - The offset in TVB where the attribute begins */
4800 static int parse_SwitchInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4802 int local_offset = *offset;
4803 proto_tree *SwitchInfo_header_tree;
4805 if (!parentTree)
4806 return *offset;
4808 SwitchInfo_header_tree = parentTree;
4810 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LinearFDBCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4811 local_offset += 2;
4812 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_RandomFDBCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4813 local_offset += 2;
4814 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_MulticastFDBCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4815 local_offset += 2;
4816 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LinearFDBTop, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4817 local_offset += 2;
4818 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_DefaultPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4819 local_offset += 1;
4820 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_DefaultMulticastPrimaryPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4821 local_offset += 1;
4822 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_DefaultMulticastNotPrimaryPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4823 local_offset += 1;
4824 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LifeTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4825 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_PortStateChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4826 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_OptimizedSLtoVLMappingProgramming, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4827 local_offset += 1;
4828 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LIDsPerPort, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4829 local_offset += 2;
4830 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_PartitionEnforcementCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4831 local_offset += 2;
4832 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_InboundEnforcementCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4833 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_OutboundEnforcementCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4834 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_FilterRawInboundCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4835 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_FilterRawOutboundCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4836 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_EnhancedPortZero, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4837 local_offset += 1;
4839 return local_offset;
4842 /* Parse GUIDInfo Attribute
4843 * IN: parentTree - The tree to add the dissection to
4844 * tvb - The tvbbuff of packet data
4845 * offset - The offset in TVB where the attribute begins */
4846 static int parse_GUIDInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4848 int local_offset = *offset;
4849 proto_tree *GUIDInfo_header_tree;
4850 proto_item *tempItemLow;
4851 int i;
4853 if (!parentTree)
4854 return *offset;
4856 GUIDInfo_header_tree = parentTree;
4858 for (i = 0; i < 8; i++)
4860 tempItemLow = proto_tree_add_item(GUIDInfo_header_tree, hf_infiniband_GUIDInfo_GUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4861 local_offset += 8;
4862 proto_item_append_text(tempItemLow, "(%u)", i);
4864 return local_offset;
4867 /* Parse PortInfo Attribute
4868 * IN: parentTree - The tree to add the dissection to
4869 * tvb - The tvbbuff of packet data
4870 * offset - The offset in TVB where the attribute begins */
4871 static int parse_PortInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
4873 int local_offset = *offset;
4874 proto_tree *PortInfo_header_tree;
4875 proto_item *PortInfo_CapabilityMask_item;
4876 proto_tree *PortInfo_CapabilityMask_tree;
4877 proto_item *temp_item;
4878 uint16_t temp_val;
4880 if (!parentTree)
4881 return *offset;
4883 PortInfo_header_tree = parentTree;
4885 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_Key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4886 local_offset += 8;
4887 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_GidPrefix, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4888 local_offset += 8;
4889 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4890 local_offset += 2;
4891 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MasterSMLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4892 local_offset += 2;
4894 /* Capability Mask Flags */
4895 PortInfo_CapabilityMask_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_CapabilityMask, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4896 PortInfo_CapabilityMask_tree = proto_item_add_subtree(PortInfo_CapabilityMask_item, ett_portinfo_capmask);
4898 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SM, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4899 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_NoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4900 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_TrapSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4901 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_OptionalIPDSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4902 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_AutomaticMigrationSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4903 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SLMappingSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4904 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_MKeyNVRAM, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4905 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_PKeyNVRAM, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4906 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_LEDInfoSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4907 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SMdisabled, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4908 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SystemImageGUIDSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4909 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_PKeySwitchExternalPortTrapSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4910 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_CommunicationManagementSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4911 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SNMPTunnelingSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4912 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_ReinitSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4913 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_DeviceManagementSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4914 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_VendorClassSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4915 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_DRNoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4916 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_CapabilityMaskNoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4917 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_BootManagementSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4918 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_LinkRoundTripLatencySupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4919 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_ClientRegistrationSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4920 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_OtherLocalChangesNoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4921 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_LinkSpeedWIdthPairsTableSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4922 local_offset += 4;
4923 /* End Capability Mask Flags */
4925 /* Diag Code */
4926 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_DiagCode, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4927 temp_val = tvb_get_ntohs(tvb, local_offset);
4929 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, DiagCode, "Reserved DiagCode! Possible Error"));
4930 local_offset += 2;
4931 /* End Diag Code */
4933 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_KeyLeasePeriod, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4934 local_offset += 2;
4935 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LocalPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4936 local_offset += 1;
4938 /* LinkWidthEnabled */
4939 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkWidthEnabled, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4940 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
4942 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkWidthEnabled, "Reserved LinkWidthEnabled Value! Possible Error"));
4943 local_offset += 1;
4944 /* End LinkWidthEnabled */
4946 /* LinkWidthSupported */
4947 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkWidthSupported, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4948 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
4950 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkWidthSupported, "Reserved LinkWidthSupported Value! Possible Error"));
4951 local_offset += 1;
4952 /* End LinkWidthSupported */
4954 /* LinkWidthActive */
4955 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkWidthActive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4956 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
4958 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkWidthActive, "Reserved LinkWidthActive Value! Possible Error"));
4959 local_offset += 1;
4960 /* End LinkWidthActive */
4962 /* LinkSpeedSupported */
4963 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkSpeedSupported, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4964 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
4966 /* 4 bit values = mask and shift */
4967 temp_val = temp_val & 0x00F0;
4968 temp_val = temp_val >> 4;
4970 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkSpeedSupported, "Reserved LinkWidthSupported Value! Possible Error"));
4971 /* End LinkSpeedSupported */
4973 /* PortState */
4974 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PortState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4975 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
4977 /* 4 bit values = mask and shift */
4978 temp_val = temp_val & 0x000F;
4979 /*temp_val = temp_val >> 4 */
4981 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, PortState, "Reserved PortState Value! Possible Error"));
4982 local_offset += 1;
4983 /* End PortState */
4985 /* PortPhysicalState */
4986 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PortPhysicalState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4987 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
4989 /* 4 bit values = mask and shift */
4990 temp_val = temp_val & 0x00F0;
4991 temp_val = temp_val >> 4;
4993 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, PortPhysicalState, "Reserved PortPhysicalState Value! Possible Error"));
4994 /* End PortPhysicalState */
4996 /* LinkDownDefaultState */
4997 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkDownDefaultState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4998 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5000 /* 4 bit values = mask and shift */
5001 temp_val = temp_val & 0x000F;
5002 /*temp_val = temp_val >> 4 */
5004 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkDownDefaultState, "Reserved LinkDownDefaultState Value! Possible Error"));
5005 local_offset += 1;
5006 /* End LinkDownDefaultState */
5008 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_KeyProtectBits, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5009 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LMC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5010 local_offset += 1;
5012 /* LinkSpeedActive */
5013 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkSpeedActive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5014 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5016 /* 4 bit values = mask and shift */
5017 temp_val = temp_val & 0x00F0;
5018 temp_val = temp_val >> 4;
5020 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkSpeedActive, "Reserved LinkSpeedActive Value! Possible Error"));
5021 /* End LinkSpeedActive */
5023 /* LinkSpeedEnabled */
5024 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkSpeedEnabled, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5025 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5027 /* 4 bit values = mask and shift */
5028 temp_val = temp_val & 0x000F;
5029 /*temp_val = temp_val >> 4 */
5031 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkSpeedEnabled, "Reserved LinkSpeedEnabled Value! Possible Error"));
5032 local_offset += 1;
5033 /* End LinkSpeedEnabled */
5035 /* NeighborMTU */
5036 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_NeighborMTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5037 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5039 /* 4 bit values = mask and shift */
5040 temp_val = temp_val & 0x00F0;
5041 temp_val = temp_val >> 4;
5043 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, NeighborMTU, "Reserved NeighborMTU Value! Possible Error"));
5045 /* End NeighborMTU */
5047 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MasterSMSL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5048 local_offset += 1;
5050 /* VLCap */
5051 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5052 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5054 /* 4 bit values = mask and shift */
5055 temp_val = temp_val & 0x00F0;
5056 temp_val = temp_val >> 4;
5058 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, VLCap, "Reserved VLCap Value! Possible Error"));
5060 /* End VLCap */
5062 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_InitType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5063 local_offset += 1;
5064 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLHighLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5065 local_offset += 1;
5066 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLArbitrationHighCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5067 local_offset += 1;
5068 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLArbitrationLowCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5069 local_offset += 1;
5070 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_InitTypeReply, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5072 /* MTUCap */
5073 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MTUCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5074 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5076 /* 4 bit values = mask and shift */
5077 temp_val = temp_val & 0x000F;
5078 /*temp_val = temp_val >> 4 */
5080 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, MTUCap, "Reserved MTUCap Value! Possible Error"));
5081 local_offset += 1;
5082 /* End MTUCap */
5084 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLStallCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5085 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_HOQLife, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5086 local_offset += 1;
5088 /* OperationalVLs */
5089 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_OperationalVLs, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5090 temp_val = (uint16_t)tvb_get_uint8(tvb, local_offset);
5092 /* 4 bit values = mask and shift */
5093 temp_val = temp_val & 0x00F0;
5094 temp_val = temp_val >> 4;
5096 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, OperationalVLs, "Reserved OperationalVLs Value! Possible Error"));
5097 /* End OperationalVLs */
5099 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PartitionEnforcementInbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5100 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PartitionEnforcementOutbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5101 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_FilterRawInbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5102 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_FilterRawOutbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5103 local_offset += 1;
5104 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_KeyViolations, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5105 local_offset += 2;
5106 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_P_KeyViolations, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5107 local_offset += 2;
5108 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_Q_KeyViolations, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5109 local_offset += 2;
5110 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_GUIDCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5111 local_offset += 1;
5112 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_ClientReregister, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5113 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_SubnetTimeOut, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5114 local_offset += 1;
5115 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_RespTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5116 local_offset += 1;
5117 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LocalPhyErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5118 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_OverrunErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5119 local_offset += 1;
5120 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MaxCreditHint, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5121 local_offset += 3; /* 2 + 1 Reserved */
5122 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkRoundTripLatency, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5123 local_offset += 3;
5125 return local_offset;
5128 /* Parse P_KeyTable Attribute
5129 * IN: parentTree - The tree to add the dissection to
5130 * tvb - The tvbbuff of packet data
5131 * offset - The offset in TVB where the attribute begins */
5132 static void parse_P_KeyTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5134 int local_offset = *offset;
5135 int i;
5136 proto_item *P_KeyTable_header_item;
5137 proto_tree *P_KeyTable_header_tree;
5138 proto_item *tempItemLow;
5139 proto_item *tempItemHigh;
5141 if (!parentTree)
5142 return;
5144 P_KeyTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_P_KeyTable_P_KeyTableBlock, tvb, local_offset, 64, ENC_NA);
5145 proto_item_set_text(P_KeyTable_header_item, "%s", "P_KeyTable");
5146 P_KeyTable_header_tree = proto_item_add_subtree(P_KeyTable_header_item, ett_pkeytable);
5148 for (i = 0; i < 32; i++)
5150 tempItemLow = proto_tree_add_item(P_KeyTable_header_tree, hf_infiniband_P_KeyTable_MembershipType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5151 tempItemHigh = proto_tree_add_item(P_KeyTable_header_tree, hf_infiniband_P_KeyTable_P_KeyBase, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5152 local_offset += 2;
5153 proto_item_append_text(tempItemLow, "(%u)", i);
5154 proto_item_append_text(tempItemHigh, "(%u)", i+1);
5158 /* Parse SLtoVLMappingTable Attribute
5159 * IN: parentTree - The tree to add the dissection to
5160 * tvb - The tvbbuff of packet data
5161 * offset - The offset in TVB where the attribute begins */
5162 static void parse_SLtoVLMappingTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5164 int local_offset = *offset;
5165 proto_item *SLtoVLMappingTable_header_item;
5166 proto_tree *SLtoVLMappingTable_header_tree;
5167 proto_item *tempItemLow;
5168 proto_item *tempItemHigh;
5169 int i;
5171 if (!parentTree)
5172 return;
5174 SLtoVLMappingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5175 proto_item_set_text(SLtoVLMappingTable_header_item, "%s", "SLtoVLMappingTable");
5176 SLtoVLMappingTable_header_tree = proto_item_add_subtree(SLtoVLMappingTable_header_item, ett_sltovlmapping);
5178 for (i = 0; i < 8; i++)
5180 tempItemLow = proto_tree_add_item(SLtoVLMappingTable_header_tree, hf_infiniband_SLtoVLMappingTable_SLtoVL_HighBits, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5181 tempItemHigh = proto_tree_add_item(SLtoVLMappingTable_header_tree, hf_infiniband_SLtoVLMappingTable_SLtoVL_LowBits, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5182 local_offset += 1;
5183 proto_item_append_text(tempItemLow, "(%u)", i);
5184 proto_item_append_text(tempItemHigh, "(%u)", i+1);
5188 /* Parse VLArbitrationTable Attribute
5189 * IN: parentTree - The tree to add the dissection to
5190 * tvb - The tvbbuff of packet data
5191 * offset - The offset in TVB where the attribute begins */
5192 static void parse_VLArbitrationTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5194 int local_offset = *offset;
5195 int i;
5196 proto_item *VLArbitrationTable_header_item;
5197 proto_tree *VLArbitrationTable_header_tree;
5198 proto_item *tempItemLow;
5199 proto_item *tempItemHigh;
5201 if (!parentTree)
5202 return;
5204 VLArbitrationTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5205 proto_item_set_text(VLArbitrationTable_header_item, "%s", "VLArbitrationTable");
5206 VLArbitrationTable_header_tree = proto_item_add_subtree(VLArbitrationTable_header_item, ett_vlarbitrationtable);
5208 for (i = 0; i < 32; i++)
5210 tempItemLow = proto_tree_add_item(VLArbitrationTable_header_tree, hf_infiniband_VLArbitrationTable_VL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5211 local_offset += 1;
5212 tempItemHigh = proto_tree_add_item(VLArbitrationTable_header_tree, hf_infiniband_VLArbitrationTable_Weight, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5213 local_offset += 1;
5214 proto_item_append_text(tempItemLow, "(%u)", i);
5215 proto_item_append_text(tempItemHigh, "(%u)", i);
5219 /* Parse LinearForwardingTable Attribute
5220 * IN: parentTree - The tree to add the dissection to
5221 * tvb - The tvbbuff of packet data
5222 * offset - The offset in TVB where the attribute begins */
5223 static void parse_LinearForwardingTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5225 int i;
5226 int local_offset = *offset;
5227 proto_item *LinearForwardingTable_header_item;
5228 proto_tree *LinearForwardingTable_header_tree;
5229 proto_item *tempItemLow;
5231 if (!parentTree)
5232 return;
5234 LinearForwardingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5235 proto_item_set_text(LinearForwardingTable_header_item, "%s", "LinearForwardingTable");
5236 LinearForwardingTable_header_tree = proto_item_add_subtree(LinearForwardingTable_header_item, ett_linearforwardingtable);
5238 for (i = 0; i < 64; i++)
5240 tempItemLow = proto_tree_add_item(LinearForwardingTable_header_tree, hf_infiniband_LinearForwardingTable_Port, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5241 local_offset += 1;
5242 proto_item_append_text(tempItemLow, "(%u)", i);
5246 /* Parse RandomForwardingTable Attribute
5247 * IN: parentTree - The tree to add the dissection to
5248 * tvb - The tvbbuff of packet data
5249 * offset - The offset in TVB where the attribute begins */
5250 static void parse_RandomForwardingTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5252 int i;
5253 int local_offset = *offset;
5254 proto_item *RandomForwardingTable_header_item;
5255 proto_tree *RandomForwardingTable_header_tree;
5256 proto_item *tempItemLow;
5258 if (!parentTree)
5259 return;
5261 RandomForwardingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5262 proto_item_set_text(RandomForwardingTable_header_item, "%s", "RandomForwardingTable");
5263 RandomForwardingTable_header_tree = proto_item_add_subtree(RandomForwardingTable_header_item, ett_randomforwardingtable);
5265 for (i = 0; i < 16; i++)
5267 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5268 local_offset += 2;
5269 proto_item_append_text(tempItemLow, "(%u)", i);
5270 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_Valid, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5271 proto_item_append_text(tempItemLow, "(%u)", i);
5272 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_LMC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5273 local_offset += 1;
5274 proto_item_append_text(tempItemLow, "(%u)", i);
5275 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_Port, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5276 local_offset += 1;
5277 proto_item_append_text(tempItemLow, "(%u)", i);
5281 /* Parse NoticesAndTraps Attribute
5282 * IN: parentTree - The tree to add the dissection to
5283 * tvb - The tvbbuff of packet data
5284 * offset - The offset in TVB where the attribute begins */
5285 static void parse_MulticastForwardingTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5287 int i;
5288 int local_offset = *offset;
5289 proto_item *MulticastForwardingTable_header_item;
5290 proto_tree *MulticastForwardingTable_header_tree;
5291 proto_item *tempItemLow;
5293 if (!parentTree)
5294 return;
5296 MulticastForwardingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5297 proto_item_set_text(MulticastForwardingTable_header_item, "%s", "MulticastForwardingTable");
5298 MulticastForwardingTable_header_tree = proto_item_add_subtree(MulticastForwardingTable_header_item, ett_multicastforwardingtable);
5300 for (i = 0; i < 16; i++)
5302 tempItemLow = proto_tree_add_item(MulticastForwardingTable_header_tree, hf_infiniband_MulticastForwardingTable_PortMask, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5303 local_offset += 2;
5304 proto_item_append_text(tempItemLow, "(%u)", i);
5309 /* Parse SMInfo Attribute
5310 * IN: parentTree - The tree to add the dissection to
5311 * tvb - The tvbbuff of packet data
5312 * offset - The offset in TVB where the attribute begins */
5313 static int parse_SMInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5315 int local_offset = *offset;
5316 proto_item *SMInfo_header_item;
5317 proto_tree *SMInfo_header_tree;
5319 if (!parentTree)
5320 return *offset;
5322 SMInfo_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5323 proto_item_set_text(SMInfo_header_item, "%s", "SMInfo");
5324 SMInfo_header_tree = proto_item_add_subtree(SMInfo_header_item, ett_sminfo);
5326 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_GUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5327 local_offset += 8;
5328 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_SM_Key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5329 local_offset += 8;
5330 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_ActCount, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5331 local_offset += 4;
5332 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_Priority, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5333 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_SMState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5334 local_offset += 1;
5335 return local_offset;
5338 /* Parse VendorDiag Attribute
5339 * IN: parentTree - The tree to add the dissection to
5340 * tvb - The tvbbuff of packet data
5341 * offset - The offset in TVB where the attribute begins */
5342 static int parse_VendorDiag(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5344 int local_offset = *offset;
5345 proto_item *VendorDiag_header_item;
5346 proto_tree *VendorDiag_header_tree;
5348 if (!parentTree)
5349 return *offset;
5351 VendorDiag_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5352 proto_item_set_text(VendorDiag_header_item, "%s", "VendorDiag");
5353 VendorDiag_header_tree = proto_item_add_subtree(VendorDiag_header_item, ett_vendordiag);
5355 proto_tree_add_item(VendorDiag_header_tree, hf_infiniband_VendorDiag_NextIndex, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5356 local_offset += 2;
5357 proto_tree_add_item(VendorDiag_header_tree, hf_infiniband_VendorDiag_DiagData, tvb, local_offset, 62, ENC_NA);
5358 local_offset += 62;
5360 return local_offset;
5363 /* Parse LedInfo Attribute
5364 * IN: parentTree - The tree to add the dissection to
5365 * tvb - The tvbbuff of packet data
5366 * offset - The offset in TVB where the attribute begins */
5367 static void parse_LedInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5369 int local_offset = *offset;
5370 proto_item *LedInfo_header_item;
5371 proto_tree *LedInfo_header_tree;
5373 if (!parentTree)
5374 return;
5376 LedInfo_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5377 proto_item_set_text(LedInfo_header_item, "%s", "LedInfo");
5378 LedInfo_header_tree = proto_item_add_subtree(LedInfo_header_item, ett_ledinfo);
5380 proto_tree_add_item(LedInfo_header_tree, hf_infiniband_LedInfo_LedMask, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5383 /* Parse LinkSpeedWidthPairsTable Attribute
5384 * IN: parentTree - The tree to add the dissection to
5385 * tvb - The tvbbuff of packet data
5386 * offset - The offset in TVB where the attribute begins */
5387 static int parse_LinkSpeedWidthPairsTable(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5389 int local_offset = *offset;
5390 proto_item *LinkSpeedWidthPairsTable_header_item;
5391 proto_tree *LinkSpeedWidthPairsTable_header_tree;
5393 if (!parentTree)
5394 return *offset;
5396 LinkSpeedWidthPairsTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5397 proto_item_set_text(LinkSpeedWidthPairsTable_header_item, "%s", "LinkSpeedWidthPairsTable");
5398 LinkSpeedWidthPairsTable_header_tree = proto_item_add_subtree(LinkSpeedWidthPairsTable_header_item, ett_linkspeedwidthpairs);
5400 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_NumTables, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5401 local_offset += 1;
5402 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_PortMask, tvb, local_offset, 32, ENC_NA);
5403 local_offset += 32;
5404 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_SpeedTwoFive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5405 local_offset += 1;
5406 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_SpeedFive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5407 local_offset += 1;
5408 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_SpeedTen, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5409 local_offset += 1;
5411 return local_offset;
5414 /* Parse RID Field from Subnet Administration Packets.
5415 * IN: SA_header_tree - the dissection tree of the subnet admin attribute.
5416 * tvb - the packet buffer
5417 * MadHeader - the Common MAD header from this packet.
5418 * IN/OUT: offset - the current and updated offset in the packet buffer */
5419 static void parse_RID(proto_tree* SA_header_tree, tvbuff_t* tvb, int *offset, MAD_Data* MadHeader)
5421 int local_offset = *offset;
5423 if (!SA_header_tree)
5425 return;
5427 switch (MadHeader->attributeID)
5429 case 0x0011:
5430 /* NodeRecord */
5431 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5432 local_offset += 2;
5433 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5434 local_offset += 2;
5435 break;
5436 case 0x0012:
5437 /* PortInfoRecord */
5438 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_EndportLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5439 local_offset += 2;
5440 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_PortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5441 local_offset += 1;
5442 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5443 local_offset += 1;
5444 break;
5445 case 0x0013:
5446 /* SLtoVLMappingTableRecord */
5447 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5448 local_offset += 2;
5449 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_InputPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5450 local_offset += 1;
5451 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_OutputPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5452 local_offset += 1;
5453 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5454 local_offset += 4;
5455 break;
5456 case 0x0014:
5457 /* SwitchInfoRecord */
5458 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5459 local_offset += 2;
5460 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5461 local_offset += 2;
5462 break;
5463 case 0x0015:
5464 /* LinearForwardingTableRecord */
5465 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5466 local_offset += 2;
5467 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_SixteenBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5468 local_offset += 2;
5469 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5470 local_offset += 4;
5471 break;
5472 case 0x0016:
5473 /* RandomForwardingTableRecord */
5474 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5475 local_offset += 2;
5476 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_SixteenBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5477 local_offset += 2;
5478 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5479 local_offset += 4;
5480 break;
5481 case 0x0017:
5482 /* MulticastForwardingTableRecord */
5483 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5484 local_offset += 2;
5485 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_Position, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5486 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_NineBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5487 local_offset += 2;
5488 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5489 local_offset += 4;
5490 break;
5491 case 0x0036:
5492 /* VLArbitrationTableRecord */
5493 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5494 local_offset += 2;
5495 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_OutputPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5496 local_offset += 1;
5497 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_EightBit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5498 local_offset += 1;
5499 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5500 local_offset += 4;
5501 break;
5502 case 0x0018:
5503 /* SMInfoRecord */
5504 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5505 local_offset += 2;
5506 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5507 local_offset += 2;
5508 break;
5509 case 0x0033:
5510 /* P_KeyTableRecord */
5511 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5512 local_offset += 2;
5513 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_SixteenBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5514 local_offset += 2;
5515 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_PortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5516 local_offset += 1;
5517 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 3, ENC_NA);
5518 local_offset += 3;
5519 break;
5520 case 0x00F3:
5521 /* InformInfoRecord */
5522 proto_tree_add_item(SA_header_tree, hf_infiniband_InformInfoRecord_SubscriberGID, tvb, local_offset, 16, ENC_NA);
5523 local_offset += 16;
5524 proto_tree_add_item(SA_header_tree, hf_infiniband_InformInfoRecord_Enum, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5525 local_offset += 2;
5526 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 6, ENC_NA);
5527 local_offset += 6;
5528 break;
5529 case 0x0020:
5530 /* LinkRecord */
5531 proto_tree_add_item(SA_header_tree, hf_infiniband_LinkRecord_FromLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5532 local_offset += 2;
5533 proto_tree_add_item(SA_header_tree, hf_infiniband_LinkRecord_FromPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5534 local_offset += 1;
5535 break;
5536 case 0x0031:
5537 /* ServiceRecord */
5538 proto_tree_add_item(SA_header_tree, hf_infiniband_ServiceRecord_ServiceID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5539 local_offset += 8;
5540 proto_tree_add_item(SA_header_tree, hf_infiniband_ServiceRecord_ServiceGID, tvb, local_offset, 16, ENC_NA);
5541 local_offset += 16;
5542 proto_tree_add_item(SA_header_tree, hf_infiniband_ServiceRecord_ServiceP_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5543 local_offset += 2;
5544 local_offset += 2;
5545 break;
5546 case 0x0038:
5547 /* MCMemberRecord */
5548 proto_tree_add_item(SA_header_tree, hf_infiniband_MCMemberRecord_MGID, tvb, local_offset, 16, ENC_NA);
5549 local_offset += 16;
5550 proto_tree_add_item(SA_header_tree, hf_infiniband_MCMemberRecord_PortGID, tvb, local_offset, 16, ENC_NA);
5551 local_offset += 16;
5552 break;
5553 case 0x0030:
5554 /* GuidInfoRecord */
5555 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5556 local_offset += 2;
5557 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_EightBit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5558 local_offset += 2;
5559 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5560 local_offset += 4;
5561 break;
5562 default:
5563 break;
5566 *offset = local_offset;
5569 /* Parse InformInfo Attribute
5570 * IN: parentTree - The tree to add the dissection to
5571 * tvb - The tvbbuff of packet data
5572 * offset - The offset in TVB where the attribute begins */
5573 static int parse_InformInfo(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5575 int local_offset = *offset;
5576 proto_item *InformInfo_header_item;
5577 proto_tree *InformInfo_header_tree;
5579 if (!parentTree)
5581 return *offset;
5583 InformInfo_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 36, ENC_NA);
5584 proto_item_set_text(InformInfo_header_item, "%s", "InformInfo");
5585 InformInfo_header_tree = proto_item_add_subtree(InformInfo_header_item, ett_informinfo);
5587 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_GID, tvb, local_offset, 16, ENC_NA);
5588 local_offset += 16;
5589 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_LIDRangeBegin, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5590 local_offset += 2;
5591 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_LIDRangeEnd, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5592 local_offset += 2;
5593 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5594 local_offset += 2;
5595 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_IsGeneric, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5596 local_offset += 1;
5597 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_Subscribe, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5598 local_offset += 1;
5599 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_Type, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5600 local_offset += 2;
5601 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_TrapNumberDeviceID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5602 local_offset += 2;
5603 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_QPN, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5604 local_offset += 3;
5605 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_RespTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5606 local_offset += 1;
5607 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5608 local_offset += 1;
5609 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_ProducerTypeVendorID, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5610 local_offset += 3;
5612 return local_offset;
5614 /* Parse LinkRecord Attribute
5615 * IN: parentTree - The tree to add the dissection to
5616 * tvb - The tvbbuff of packet data
5617 * offset - The offset in TVB where the attribute begins */
5618 static int parse_LinkRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5620 int local_offset = *offset;
5621 proto_item *LinkRecord_header_item;
5622 proto_tree *LinkRecord_header_tree;
5624 if (!parentTree)
5626 return *offset;
5629 LinkRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 3, ENC_NA);
5630 proto_item_set_text(LinkRecord_header_item, "%s", "LinkRecord");
5631 LinkRecord_header_tree = proto_item_add_subtree(LinkRecord_header_item, ett_linkrecord);
5633 proto_tree_add_item(LinkRecord_header_tree, hf_infiniband_LinkRecord_ToPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5634 local_offset += 1;
5635 proto_tree_add_item(LinkRecord_header_tree, hf_infiniband_LinkRecord_ToLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5636 local_offset += 2;
5638 return local_offset;
5641 /* Parse ServiceRecord Attribute
5642 * IN: parentTree - The tree to add the dissection to
5643 * tvb - The tvbbuff of packet data
5644 * offset - The offset in TVB where the attribute begins */
5645 static int parse_ServiceRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5647 int local_offset = *offset;
5648 proto_item *ServiceRecord_header_item;
5649 proto_tree *ServiceRecord_header_tree;
5650 proto_item *tempData;
5652 if (!parentTree)
5654 return *offset;
5657 ServiceRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 176, ENC_NA);
5658 proto_item_set_text(ServiceRecord_header_item, "%s", "ServiceRecord");
5659 ServiceRecord_header_tree = proto_item_add_subtree(ServiceRecord_header_item, ett_servicerecord);
5661 proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceLease, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5662 local_offset += 4;
5663 proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceKey, tvb, local_offset, 16, ENC_NA);
5664 local_offset += 16;
5665 proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceName, tvb, local_offset, 64, ENC_NA);
5666 local_offset += 64;
5668 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5669 local_offset += 16;
5670 proto_item_append_text(tempData, "%s", "(ServiceData 8.1, 8.16)");
5671 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5672 local_offset += 16;
5673 proto_item_append_text(tempData, "%s", "(ServiceData 16.1, 16.8)");
5674 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5675 local_offset += 16;
5676 proto_item_append_text(tempData, "%s", "(ServiceData 32.1, 32.4)");
5677 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5678 local_offset += 16;
5679 proto_item_append_text(tempData, "%s", "(ServiceData 64.1, 64.2)");
5681 return local_offset;
5684 /* Parse PathRecord Attribute
5685 * IN: parentTree - The tree to add the dissection to
5686 * tvb - The tvbbuff of packet data
5687 * offset - The offset in TVB where the attribute begins */
5688 static int parse_PathRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5690 int local_offset = *offset;
5691 proto_item *PathRecord_header_item;
5692 proto_tree *PathRecord_header_tree;
5694 if (!parentTree)
5696 return *offset;
5699 PathRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 64, ENC_NA);
5700 proto_item_set_text(PathRecord_header_item, "%s", "PathRecord");
5701 PathRecord_header_tree = proto_item_add_subtree(PathRecord_header_item, ett_pathrecord);
5702 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 8, ENC_NA);
5703 local_offset += 8;
5705 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_DGID, tvb, local_offset, 16, ENC_NA);
5706 local_offset += 16;
5707 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_SGID, tvb, local_offset, 16, ENC_NA);
5708 local_offset += 16;
5709 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_DLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5710 local_offset += 2;
5711 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_SLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5712 local_offset += 2;
5713 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_RawTraffic, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5714 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_FlowLabel, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5715 local_offset += 3;
5716 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_HopLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5717 local_offset += 1;
5718 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_TClass, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5719 local_offset += 1;
5720 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_Reversible, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5721 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_NumbPath, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5722 local_offset += 1;
5723 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_P_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5724 local_offset += 2;
5725 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_SL, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5726 local_offset += 2;
5727 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_MTUSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5728 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_MTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5729 local_offset += 1;
5730 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_RateSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5731 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_Rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5732 local_offset += 1;
5733 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_PacketLifeTimeSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5734 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_PacketLifeTime, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5735 local_offset += 1;
5736 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_Preference, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5737 local_offset += 1;
5739 return local_offset;
5741 /* Parse MCMemberRecord Attribute
5742 * IN: parentTree - The tree to add the dissection to
5743 * tvb - The tvbbuff of packet data
5744 * offset - The offset in TVB where the attribute begins */
5745 static int parse_MCMemberRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5747 int local_offset = *offset;
5748 proto_item *MCMemberRecord_header_item;
5749 proto_tree *MCMemberRecord_header_tree;
5751 if (!parentTree)
5753 return *offset;
5756 MCMemberRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 64, ENC_NA);
5757 proto_item_set_text(MCMemberRecord_header_item, "%s", "MCMemberRecord");
5758 MCMemberRecord_header_tree = proto_item_add_subtree(MCMemberRecord_header_item, ett_mcmemberrecord);
5760 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_Q_Key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5761 local_offset += 4;
5762 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_MLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5763 local_offset += 2;
5764 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_MTUSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5765 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_MTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5766 local_offset += 1;
5767 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_TClass, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5768 local_offset += 1;
5769 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_P_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5770 local_offset += 2;
5771 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_RateSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5772 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_Rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5773 local_offset += 1;
5774 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_PacketLifeTimeSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5775 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_PacketLifeTime, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5776 local_offset += 1;
5777 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5778 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_FlowLabel, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5779 local_offset += 3;
5780 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_HopLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5781 local_offset += 1;
5782 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_Scope, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5783 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_JoinState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5784 local_offset += 1;
5785 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_ProxyJoin, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5786 local_offset += 3;
5788 return local_offset;
5791 /* Parse TraceRecord Attribute
5792 * IN: parentTree - The tree to add the dissection to
5793 * tvb - The tvbbuff of packet data
5794 * offset - The offset in TVB where the attribute begins */
5795 static int parse_TraceRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5797 int local_offset = *offset;
5798 proto_item *TraceRecord_header_item;
5799 proto_tree *TraceRecord_header_tree;
5801 if (!parentTree)
5803 return *offset;
5806 TraceRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 46, ENC_NA);
5807 proto_item_set_text(TraceRecord_header_item, "%s", "TraceRecord");
5808 TraceRecord_header_tree = proto_item_add_subtree(TraceRecord_header_item, ett_tracerecord);
5810 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_GIDPrefix, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5811 local_offset += 8;
5812 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_IDGeneration, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5813 local_offset += 2;
5814 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5815 local_offset += 1;
5816 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_NodeType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5817 local_offset += 1;
5818 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_NodeID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5819 local_offset += 8;
5820 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_ChassisID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5821 local_offset += 8;
5822 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_EntryPortID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5823 local_offset += 8;
5824 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_ExitPortID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5825 local_offset += 8;
5826 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_EntryPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5827 local_offset += 1;
5828 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_ExitPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5829 local_offset += 1;
5831 return local_offset;
5833 /* Parse MultiPathRecord Attribute
5834 * IN: parentTree - The tree to add the dissection to
5835 * tvb - The tvbbuff of packet data
5836 * offset - The offset in TVB where the attribute begins */
5837 static int parse_MultiPathRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5839 int local_offset = *offset;
5840 proto_item *MultiPathRecord_header_item;
5841 proto_tree *MultiPathRecord_header_tree;
5842 proto_item *SDGID;
5843 uint8_t SDGIDCount;
5844 uint8_t DGIDCount;
5845 uint32_t i;
5847 if (!parentTree)
5849 return *offset;
5852 MultiPathRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 200, ENC_NA);
5853 proto_item_set_text(MultiPathRecord_header_item, "%s", "MultiPathRecord");
5854 MultiPathRecord_header_tree = proto_item_add_subtree(MultiPathRecord_header_item, ett_multipathrecord);
5856 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_RawTraffic, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5857 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_FlowLabel, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5858 local_offset += 3;
5859 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_HopLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5860 local_offset += 1;
5861 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_TClass, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5862 local_offset += 1;
5863 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_Reversible, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5864 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_NumbPath, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5865 local_offset += 1;
5866 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_P_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5867 local_offset += 2;
5868 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SL, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5869 local_offset += 2;
5870 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_MTUSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5871 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_MTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5872 local_offset += 1;
5873 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_RateSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5874 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_Rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5875 local_offset += 1;
5876 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_PacketLifeTimeSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5877 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_PacketLifeTime, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5878 local_offset += 1;
5879 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5880 local_offset += 1;
5881 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_IndependenceSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5882 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_GIDScope, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5883 local_offset += 1;
5885 SDGIDCount = tvb_get_uint8(tvb, local_offset);
5886 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SGIDCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5887 local_offset += 1;
5888 DGIDCount = tvb_get_uint8(tvb, local_offset);
5889 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_DGIDCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5890 local_offset += 1;
5891 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 7, ENC_NA);
5892 local_offset += 7;
5894 for (i = 0; i < SDGIDCount; i++)
5896 SDGID = proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SDGID, tvb, local_offset, 16, ENC_NA);
5897 local_offset += 16;
5898 proto_item_set_text(SDGID, "(%s%u)", "SGID", i);
5900 for (i = 0; i < DGIDCount; i++)
5902 SDGID = proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SDGID, tvb, local_offset, 16, ENC_NA);
5903 local_offset += 16;
5904 proto_item_set_text(SDGID, "(%s%u)", "DGID", i);
5907 return local_offset;
5909 /* Parse ServiceAssociationRecord Attribute
5910 * IN: parentTree - The tree to add the dissection to
5911 * tvb - The tvbbuff of packet data
5912 * offset - The offset in TVB where the attribute begins */
5913 static int parse_ServiceAssociationRecord(proto_tree* parentTree, tvbuff_t* tvb, int *offset)
5915 int local_offset = *offset;
5916 proto_item *ServiceAssociationRecord_header_item;
5917 proto_tree *ServiceAssociationRecord_header_tree;
5919 if (!parentTree)
5921 return *offset;
5924 ServiceAssociationRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 80, ENC_NA);
5925 proto_item_set_text(ServiceAssociationRecord_header_item, "%s", "ServiceAssociationRecord");
5926 ServiceAssociationRecord_header_tree = proto_item_add_subtree(ServiceAssociationRecord_header_item, ett_serviceassocrecord);
5928 proto_tree_add_item(ServiceAssociationRecord_header_tree, hf_infiniband_ServiceAssociationRecord_ServiceKey, tvb, local_offset, 16, ENC_NA);
5929 local_offset += 16;
5930 proto_tree_add_item(ServiceAssociationRecord_header_tree, hf_infiniband_ServiceAssociationRecord_ServiceName, tvb, local_offset, 64, ENC_ASCII);
5931 local_offset += 64;
5933 return local_offset;
5936 /* Parse PortCounters MAD from the Performance management class.
5937 * IN: parentTree - The tree to add the dissection to
5938 * tvb - The tvbbuff of packet data
5939 * offset - The offset in TVB where the attribute begins
5940 * pinfo - The packet info structure with column information */
5941 static int parse_PERF_PortCounters(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, int *offset)
5943 proto_item *perf_item;
5944 proto_tree *perf_tree;
5945 int local_offset = *offset;
5947 col_set_str(pinfo->cinfo, COL_INFO, "PERF (PortCounters)");
5949 perf_item = proto_tree_add_item(parentTree, hf_infiniband_PortCounters, tvb, local_offset, 40, ENC_NA);
5950 perf_tree = proto_item_add_subtree(perf_item, ett_perfclass);
5952 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 40, ENC_NA);
5953 local_offset += 40;
5954 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5955 local_offset += 1;
5956 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortSelect, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5957 local_offset += 1;
5958 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_CounterSelect, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5959 local_offset += 2;
5960 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_SymbolErrorCounter, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5961 local_offset += 2;
5962 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_LinkErrorRecoveryCounter, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5963 local_offset += 1;
5964 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_LinkDownedCounter, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5965 local_offset += 1;
5966 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvErrors, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5967 local_offset += 2;
5968 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvRemotePhysicalErrors, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5969 local_offset += 2;
5970 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvSwitchRelayErrors, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5971 local_offset += 2;
5972 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitDiscards, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5973 local_offset += 2;
5974 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitConstraintErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5975 local_offset += 1;
5976 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvConstraintErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5977 local_offset += 1;
5978 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5979 local_offset += 1;
5980 proto_tree_add_bits_item(perf_tree, hf_infiniband_PortCounters_LocalLinkIntegrityErrors, tvb, local_offset*8, 4, ENC_BIG_ENDIAN);
5981 proto_tree_add_bits_item(perf_tree, hf_infiniband_PortCounters_ExcessiveBufferOverrunErrors, tvb, local_offset*8 + 4, 4, ENC_BIG_ENDIAN);
5982 local_offset += 1;
5983 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5984 local_offset += 2;
5985 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_VL15Dropped, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5986 local_offset += 2;
5987 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitData, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5988 local_offset += 4;
5989 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvData, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5990 local_offset += 4;
5991 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitPkts, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5992 local_offset += 4;
5993 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvPkts, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5994 local_offset += 4;
5996 *offset = local_offset; /* update caller's offset to point to end of the PortCounters payload */
5997 return local_offset;
6000 /* Parse PortCountersExtended MAD from the Performance management class.
6001 * IN: parentTree - The tree to add the dissection to
6002 * tvb - The tvbbuff of packet data
6003 * offset - The offset in TVB where the attribute begins
6004 * pinfo - The packet info structure with column information */
6005 static int parse_PERF_PortCountersExtended(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, int *offset)
6007 proto_item *perf_item;
6008 proto_tree *perf_tree;
6009 int local_offset = *offset;
6011 col_set_str(pinfo->cinfo, COL_INFO, "PERF (PortCountersExtended)");
6013 perf_item = proto_tree_add_item(parentTree, hf_infiniband_PortCountersExt, tvb, local_offset, 72, ENC_NA);
6014 perf_tree = proto_item_add_subtree(perf_item, ett_perfclass);
6016 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 40, ENC_NA);
6017 local_offset += 40;
6018 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
6019 local_offset += 1;
6020 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortSelect, tvb, local_offset, 1, ENC_BIG_ENDIAN);
6021 local_offset += 1;
6022 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_CounterSelect, tvb, local_offset, 2, ENC_BIG_ENDIAN);
6023 local_offset += 2;
6024 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
6025 local_offset += 4;
6026 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortXmitData, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6027 local_offset += 8;
6028 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortRcvData, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6029 local_offset += 8;
6030 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortXmitPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6031 local_offset += 8;
6032 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortRcvPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6033 local_offset += 8;
6034 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortUnicastXmitPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6035 local_offset += 8;
6036 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortUnicastRcvPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6037 local_offset += 8;
6038 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortMulticastXmitPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6039 local_offset += 8;
6040 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortMulticastRcvPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
6041 local_offset += 8;
6043 *offset = local_offset; /* update caller's offset to point to end of the PortCountersExt payload */
6044 return local_offset;
6047 /* dissect_general_info
6048 * Used to extract very few values from the packet in the case that full dissection is disabled by the user.
6049 * IN:
6050 * tvb - The tvbbuff of packet data
6051 * offset - The offset in TVB where the attribute begins
6052 * pinfo - The packet info structure with column information
6053 * starts_with - regular IB packet starts with LRH, ROCE starts with GRH and RROCE starts with BTH,
6054 * this tells the parser what headers of (LRH/GRH) to skip. */
6055 static void dissect_general_info(tvbuff_t *tvb, int offset, packet_info *pinfo, ib_packet_start_header starts_with)
6057 uint8_t lnh_val = 0; /* The Link Next Header Value. Tells us which headers are coming */
6058 bool bthFollows = false; /* Tracks if we are parsing a BTH. This is a significant decision point */
6059 uint8_t virtualLane = 0; /* The Virtual Lane of the current Packet */
6060 int32_t nextHeaderSequence = -1; /* defined by this dissector. #define which indicates the upcoming header sequence from OpCode */
6061 uint8_t nxtHdr = 0; /* that must be available for that header. */
6062 uint8_t management_class = 0;
6063 MAD_Data MadData;
6065 /* BTH - Base Trasport Header */
6066 struct infinibandinfo info = { NULL, 0, 0, 0, 0, 0, 0, 0, false};
6067 int bthSize = 12;
6068 void *src_addr, /* the address to be displayed in the source/destination columns */
6069 *dst_addr; /* (lid/gid number) will be stored here */
6071 if (starts_with == IB_PACKET_STARTS_WITH_GRH) {
6072 /* this is a RoCE packet, skip LRH parsing */
6073 lnh_val = IBA_GLOBAL;
6074 goto skip_lrh;
6076 else if (starts_with == IB_PACKET_STARTS_WITH_BTH) {
6077 /* this is a RRoCE packet, skip LRH/GRH parsing and go directly to BTH */
6078 lnh_val = IBA_LOCAL;
6079 goto skip_lrh;
6082 virtualLane = tvb_get_uint8(tvb, offset);
6083 virtualLane = virtualLane & 0xF0;
6084 offset += 1;
6086 /* Save Link Next Header... This tells us what the next header is. */
6087 lnh_val = tvb_get_uint8(tvb, offset);
6088 lnh_val = lnh_val & 0x03;
6089 offset += 1;
6091 /* Set destination in packet view. */
6092 dst_addr = wmem_alloc(pinfo->pool, sizeof(uint16_t));
6093 *((uint16_t*) dst_addr) = tvb_get_ntohs(tvb, offset);
6094 set_address(&pinfo->dst, AT_IB, sizeof(uint16_t), dst_addr);
6096 offset += 4;
6098 /* Set Source in packet view. */
6099 src_addr = wmem_alloc(pinfo->pool, sizeof(uint16_t));
6100 *((uint16_t*) src_addr) = tvb_get_ntohs(tvb, offset);
6101 set_address(&pinfo->src, AT_IB, sizeof(uint16_t), src_addr);
6103 offset += 2;
6105 skip_lrh:
6107 switch (lnh_val)
6109 case IBA_GLOBAL:
6110 offset += 6;
6111 nxtHdr = tvb_get_uint8(tvb, offset);
6112 offset += 2;
6114 /* Set source GID in packet view. */
6115 set_address_tvb(&pinfo->src, AT_IB, GID_SIZE, tvb, offset);
6116 offset += 16;
6118 /* Set destination GID in packet view. */
6119 set_address_tvb(&pinfo->dst, AT_IB, GID_SIZE, tvb, offset);
6120 offset += 16;
6122 if (nxtHdr != 0x1B)
6124 /* Some kind of packet being transported globally with IBA, but locally it is not IBA - no BTH following. */
6125 break;
6127 /* else
6129 * Fall through switch and start parsing Local Headers and BTH
6132 /* FALL THROUGH */
6133 case IBA_LOCAL:
6134 bthFollows = true;
6136 /* Get the OpCode - this tells us what headers are following */
6137 info.opCode = tvb_get_uint8(tvb, offset);
6138 if ((info.opCode >> 5) == 0x2) {
6139 info.dctConnect = !(tvb_get_uint8(tvb, offset + 1) & 0x80);
6140 bthSize += 8;
6142 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const((uint32_t)info.opCode, OpCodeMap, "Unknown OpCode "));
6143 offset += bthSize;
6144 break;
6145 case IP_NON_IBA:
6146 /* Raw IPv6 Packet */
6147 dst_addr = wmem_strdup(pinfo->pool, "IPv6 over IB Packet");
6148 set_address(&pinfo->dst, AT_STRINGZ, (int)strlen((char *)dst_addr)+1, dst_addr);
6149 break;
6150 case RAW:
6151 break;
6152 default:
6153 break;
6156 if (bthFollows)
6158 /* Find our next header sequence based on the Opcode
6159 * Since we're not doing dissection here, we just need the proper offsets to get our labels in packet view */
6161 nextHeaderSequence = find_next_header_sequence(&info);
6162 switch (nextHeaderSequence)
6164 case RDETH_DETH_PAYLD:
6165 offset += 4; /* RDETH */
6166 offset += 8; /* DETH */
6167 break;
6168 case RETH_IMMDT_PAYLD:
6169 offset += 16; /* RETH */
6170 offset += 4; /* IMMDT */
6171 break;
6172 case RDETH_DETH_RETH_PAYLD:
6173 offset += 4; /* RDETH */
6174 offset += 8; /* DETH */
6175 offset += 16; /* RETH */
6176 break;
6177 case RDETH_DETH_IMMDT_PAYLD:
6178 offset += 4; /* RDETH */
6179 offset += 8; /* DETH */
6180 offset += 4; /* IMMDT */
6181 break;
6182 case RDETH_DETH_RETH_IMMDT_PAYLD:
6183 offset += 4; /* RDETH */
6184 offset += 8; /* DETH */
6185 offset += 16; /* RETH */
6186 offset += 4; /* IMMDT */
6187 break;
6188 case RDETH_DETH_RETH:
6189 offset += 4; /* RDETH */
6190 offset += 8; /* DETH */
6191 offset += 16; /* RETH */
6192 break;
6193 case RDETH_AETH_PAYLD:
6194 offset += 4; /* RDETH */
6195 offset += 4; /* AETH */
6196 break;
6197 case RDETH_PAYLD:
6198 offset += 4; /* RDETH */
6199 break;
6200 case RDETH_AETH:
6201 offset += 4; /* RDETH */
6202 offset += 4; /* AETH */
6203 break;
6204 case RDETH_AETH_ATOMICACKETH:
6205 offset += 4; /* RDETH */
6206 offset += 4; /* AETH */
6207 offset += 8; /* AtomicAckETH */
6208 break;
6209 case RDETH_DETH_ATOMICETH:
6210 offset += 4; /* RDETH */
6211 offset += 8; /* DETH */
6212 offset += 28; /* AtomicETH */
6213 break;
6214 case RDETH_DETH:
6215 offset += 4; /* RDETH */
6216 offset += 8; /* DETH */
6217 break;
6218 case DETH_PAYLD:
6219 offset += 8; /* DETH */
6220 break;
6221 case PAYLD:
6222 break;
6223 case IMMDT_PAYLD:
6224 offset += 4; /* IMMDT */
6225 break;
6226 case RETH_PAYLD:
6227 offset += 16; /* RETH */
6228 break;
6229 case RETH:
6230 offset += 16; /* RETH */
6231 break;
6232 case AETH_PAYLD:
6233 offset += 4; /* AETH */
6234 break;
6235 case AETH:
6236 offset += 4; /* AETH */
6237 break;
6238 case AETH_ATOMICACKETH:
6239 offset += 4; /* AETH */
6240 offset += 8; /* AtomicAckETH */
6241 break;
6242 case ATOMICETH:
6243 offset += 28; /* AtomicETH */
6244 break;
6245 case IETH_PAYLD:
6246 offset += 4; /* IETH */
6247 break;
6248 case DETH_IMMDT_PAYLD:
6249 offset += 8; /* DETH */
6250 offset += 4; /* IMMDT */
6251 break;
6252 case DCCETH:
6253 offset += 16; /* DCCETH */
6254 break;
6255 case FETH_RETH:
6256 offset += 4; /* FETH */
6257 offset += 16; /* RETH */
6258 break;
6259 case RDETH_FETH_RETH:
6260 offset += 4; /* RDETH */
6261 offset += 4; /* FETH */
6262 offset += 16; /* RETH */
6263 break;
6264 case RDETH_RETH_PAYLD:
6265 offset += 4; /* RDETH */
6266 offset += 16; /* RETH */
6267 default:
6268 break;
6271 if (virtualLane == 0xF0)
6273 management_class = tvb_get_uint8(tvb, offset + 1);
6274 if (((management_class >= (uint8_t)VENDOR_1_START) && (management_class <= (uint8_t)VENDOR_1_END))
6275 || ((management_class >= (uint8_t)VENDOR_2_START) && (management_class <= (uint8_t)VENDOR_2_END)))
6277 return;
6279 else if ((management_class >= (uint8_t)APPLICATION_START) && (management_class <= (uint8_t)APPLICATION_END))
6281 return;
6283 else if (((management_class == (uint8_t)0x00) || (management_class == (uint8_t)0x02))
6284 || ((management_class >= (uint8_t)0x50) && (management_class <= (uint8_t)0x80))
6285 || ((management_class >= (uint8_t)0x82)))
6287 return;
6289 else /* we have a normal management_class */
6291 if (parse_MAD_Common(NULL, tvb, &offset, &MadData)) {
6292 label_SUBM_Method(NULL, &MadData, pinfo);
6293 label_SUBM_Attribute(NULL, &MadData, pinfo);
6298 return;
6301 static void
6302 infiniband_shutdown(void)
6304 g_hash_table_destroy(CM_context_table);
6307 /* Protocol Registration */
6308 void proto_register_infiniband(void)
6310 module_t *infiniband_module;
6312 /* Field dissector structures.
6313 * For reserved fields, reservedX denotes the reserved field is X bits in length.
6314 * e.g. reserved2 is a reserved field 2 bits in length.
6315 * The third parameter is a filter string associated for this field.
6316 * So for instance, to filter packets for a given virtual lane,
6317 * The filter (infiniband.LRH.vl == 3) or something similar would be used. */
6319 /* XXX: ToDo: Verify against Infiniband 1.2.1 Specification */
6320 /* Fields verified/corrected: Those after comment "XX: All following ..." */
6322 /* meanings for MAD method field */
6323 static const value_string mad_method_str[] = {
6324 { 0x01, "Get()" },
6325 { 0x02, "Set()" },
6326 { 0x81, "GetResp()" },
6327 { 0x03, "Send()" },
6328 { 0x05, "Trap()" },
6329 { 0x06, "Report()" },
6330 { 0x86, "ReportResp()" },
6331 { 0x07, "TrapRepress()" },
6332 { 0x12, "GetTable()" },
6333 { 0x92, "GetTableResp()" },
6334 { 0x13, "GetTraceTable()" },
6335 { 0x14, "GetMulti()" },
6336 { 0x94, "GetMultiResp()" },
6337 { 0x15, "Delete()" },
6338 { 0x95, "DeleteResp()" },
6339 { 0, NULL }
6342 static hf_register_info hf[] = {
6343 /* Local Route Header (LRH) */
6344 { &hf_infiniband_LRH, {
6345 "Local Route Header", "infiniband.lrh",
6346 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6348 { &hf_infiniband_virtual_lane, {
6349 "Virtual Lane", "infiniband.lrh.vl",
6350 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
6352 { &hf_infiniband_link_version, {
6353 "Link Version", "infiniband.lrh.lver",
6354 FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}
6356 { &hf_infiniband_service_level, {
6357 "Service Level", "infiniband.lrh.sl",
6358 FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}
6360 { &hf_infiniband_reserved2, {
6361 "Reserved (2 bits)", "infiniband.lrh.reserved2",
6362 FT_UINT8, BASE_DEC, NULL, 0x0C, NULL, HFILL}
6364 { &hf_infiniband_link_next_header, {
6365 "Link Next Header", "infiniband.lrh.lnh",
6366 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
6368 { &hf_infiniband_destination_local_id, {
6369 "Destination Local ID", "infiniband.lrh.dlid",
6370 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6372 { &hf_infiniband_reserved5, {
6373 "Reserved (5 bits)", "infiniband.lrh.reserved5",
6374 FT_UINT16, BASE_DEC, NULL, 0xF800, NULL, HFILL}
6376 { &hf_infiniband_packet_length, {
6377 "Packet Length", "infiniband.lrh.pktlen",
6378 FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL}
6380 { &hf_infiniband_source_local_id, {
6381 "Source Local ID", "infiniband.lrh.slid",
6382 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6385 /* Global Route Header (GRH) */
6386 { &hf_infiniband_GRH, {
6387 "Global Route Header", "infiniband.grh",
6388 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6390 { &hf_infiniband_ip_version, {
6391 "IP Version", "infiniband.grh.ipver",
6392 FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}
6394 { &hf_infiniband_traffic_class, {
6395 "Traffic Class", "infiniband.grh.tclass",
6396 FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL}
6398 { &hf_infiniband_flow_label, {
6399 "Flow Label", "infiniband.grh.flowlabel",
6400 FT_UINT32, BASE_DEC, NULL, 0x000FFFFF, NULL, HFILL}
6402 { &hf_infiniband_payload_length, {
6403 "Payload Length", "infiniband.grh.paylen",
6404 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6406 { &hf_infiniband_next_header, {
6407 "Next Header", "infiniband.grh.nxthdr",
6408 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
6410 { &hf_infiniband_hop_limit, {
6411 "Hop Limit", "infiniband.grh.hoplmt",
6412 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
6414 { &hf_infiniband_source_gid, {
6415 "Source GID", "infiniband.grh.sgid",
6416 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6418 { &hf_infiniband_destination_gid, {
6419 "Destination GID", "infiniband.grh.dgid",
6420 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6423 /* Base Transport Header (BTH) */
6424 { &hf_infiniband_BTH, {
6425 "Base Transport Header", "infiniband.bth",
6426 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6428 { &hf_infiniband_opcode, {
6429 "Opcode", "infiniband.bth.opcode",
6430 FT_UINT8, BASE_DEC, VALS(bth_opcode_tbl), 0x0, NULL, HFILL}
6432 { &hf_infiniband_solicited_event, {
6433 "Solicited Event", "infiniband.bth.se",
6434 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6436 { &hf_infiniband_migreq, {
6437 "MigReq", "infiniband.bth.m",
6438 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
6440 { &hf_infiniband_pad_count, {
6441 "Pad Count", "infiniband.bth.padcnt",
6442 FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL}
6444 { &hf_infiniband_transport_header_version, {
6445 "Header Version", "infiniband.bth.tver",
6446 FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}
6448 { &hf_infiniband_partition_key, {
6449 "Partition Key", "infiniband.bth.p_key",
6450 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6452 { &hf_infiniband_destination_qp, {
6453 "Destination Queue Pair", "infiniband.bth.destqp",
6454 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6456 { &hf_infiniband_acknowledge_request, {
6457 "Acknowledge Request", "infiniband.bth.a",
6458 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6460 { &hf_infiniband_reserved7, {
6461 "Reserved (7 bits)", "infiniband.bth.reserved7",
6462 FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL}
6464 { &hf_infiniband_packet_sequence_number, {
6465 "Packet Sequence Number", "infiniband.bth.psn",
6466 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
6469 /* Raw Header (RWH) */
6470 { &hf_infiniband_RWH, {
6471 "Raw Header", "infiniband.rwh",
6472 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6474 { &hf_infiniband_etype, {
6475 "Ethertype", "infiniband.rwh.etype",
6476 FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, "Type", HFILL }
6479 /* Reliable Datagram Extended Transport Header (RDETH) */
6480 { &hf_infiniband_RDETH, {
6481 "Reliable Datagram Extended Transport Header", "infiniband.rdeth",
6482 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6484 { &hf_infiniband_ee_context, {
6485 "E2E Context", "infiniband.rdeth.eecnxt",
6486 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
6489 /* Datagram Extended Transport Header (DETH) */
6490 { &hf_infiniband_DETH, {
6491 "Datagram Extended Transport Header", "infiniband.deth",
6492 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6494 { &hf_infiniband_queue_key, {
6495 "Queue Key", "infiniband.deth.q_key",
6496 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6498 { &hf_infiniband_source_qp, {
6499 "Source Queue Pair", "infiniband.deth.srcqp",
6500 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6503 /* RDMA Extended Transport Header (RETH) */
6504 { &hf_infiniband_RETH, {
6505 "RDMA Extended Transport Header", "infiniband.reth",
6506 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6508 { &hf_infiniband_virtual_address, {
6509 "Virtual Address", "infiniband.reth.va",
6510 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6512 { &hf_infiniband_remote_key, {
6513 "Remote Key", "infiniband.reth.r_key",
6514 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6516 { &hf_infiniband_dma_length, {
6517 "DMA Length", "infiniband.reth.dmalen",
6518 FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}
6521 /* Atomic Extended Transport Header (AtomicETH) */
6522 { &hf_infiniband_AtomicETH, {
6523 "Atomic Extended Transport Header", "infiniband.atomiceth",
6524 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6526 #if 0
6527 { &hf_infiniband_virtual_address_AtomicETH, {
6528 "Virtual Address", "infiniband.atomiceth.va",
6529 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6531 { &hf_infiniband_remote_key_AtomicETH, {
6532 "Remote Key", "infiniband.atomiceth.r_key",
6533 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
6535 #endif
6536 { &hf_infiniband_swap_or_add_data, {
6537 "Swap (Or Add) Data", "infiniband.atomiceth.swapdt",
6538 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6540 { &hf_infiniband_compare_data, {
6541 "Compare Data", "infiniband.atomiceth.cmpdt",
6542 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6545 /* ACK Extended Transport Header (AETH) */
6546 { &hf_infiniband_AETH, {
6547 "ACK Extended Transport Header", "infiniband.aeth",
6548 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6550 { &hf_infiniband_syndrome, {
6551 "Syndrome", "infiniband.aeth.syndrome",
6552 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
6554 { &hf_infiniband_syndrome_reserved, {
6555 "Reserved", "infiniband.aeth.syndrome.reserved",
6556 FT_UINT8, BASE_DEC, NULL, AETH_SYNDROME_RES, NULL, HFILL}
6558 { &hf_infiniband_syndrome_opcode, {
6559 "OpCode", "infiniband.aeth.syndrome.opcode",
6560 FT_UINT8, BASE_DEC, VALS(aeth_syndrome_opcode_vals), AETH_SYNDROME_OPCODE, NULL, HFILL}
6562 { &hf_infiniband_syndrome_credit_count, {
6563 "Credit Count", "infiniband.aeth.syndrome.credit_count",
6564 FT_UINT8, BASE_DEC, NULL, AETH_SYNDROME_VALUE, NULL, HFILL}
6566 { &hf_infiniband_syndrome_timer, {
6567 "Timer", "infiniband.aeth.syndrome.timer",
6568 FT_UINT8, BASE_DEC, VALS(aeth_syndrome_timer_code_vals), AETH_SYNDROME_VALUE, NULL, HFILL}
6570 { &hf_infiniband_syndrome_reserved_value, {
6571 "Reserved", "infiniband.aeth.syndrome.reserved_value",
6572 FT_UINT8, BASE_DEC, NULL, AETH_SYNDROME_VALUE, NULL, HFILL}
6574 { &hf_infiniband_syndrome_error_code, {
6575 "Error Code", "infiniband.aeth.syndrome.error_code",
6576 FT_UINT8, BASE_DEC, VALS(aeth_syndrome_nak_error_code_vals), AETH_SYNDROME_VALUE, NULL, HFILL}
6578 { &hf_infiniband_message_sequence_number, {
6579 "Message Sequence Number", "infiniband.aeth.msn",
6580 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
6583 /* Atomic ACK Extended Transport Header (AtomicAckETH) */
6584 { &hf_infiniband_AtomicAckETH, {
6585 "Atomic ACK Extended Transport Header", "infiniband.atomicacketh",
6586 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6588 { &hf_infiniband_original_remote_data, {
6589 "Original Remote Data", "infiniband.atomicacketh.origremdt",
6590 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6593 /* Immediate Extended Transport Header (ImmDT) */
6594 { &hf_infiniband_IMMDT, {
6595 "Immediate Data", "infiniband.immdt",
6596 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6599 /* Invalidate Extended Transport Header (IETH) */
6600 { &hf_infiniband_IETH, {
6601 "RKey", "infiniband.ieth",
6602 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6605 /* FLUSH Extended Transport Header (FETH) */
6606 { &hf_infiniband_FETH, {
6607 "FLUSH Extended Transport Header", "infiniband.feth",
6608 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6610 { &hf_infiniband_reserved27, {
6611 "Reserved (27bits)", "infiniband.feth.reserved27",
6612 FT_UINT32, BASE_DEC, NULL, 0xFFFFFFE0, NULL, HFILL}
6614 { &hf_infiniband_selectivity_level, {
6615 "Selectivity Level", "infiniband.feth.sel",
6616 FT_UINT8, BASE_DEC, NULL, 0x18, NULL, HFILL}
6618 { &hf_infiniband_placement_type, {
6619 "Placement Type", "infiniband.feth.plt",
6620 FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL}
6623 /* Payload */
6624 { &hf_infiniband_payload, {
6625 "Payload", "infiniband.payload",
6626 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6628 { &hf_infiniband_invariant_crc, {
6629 "Invariant CRC", "infiniband.invariant.crc",
6630 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6632 { &hf_infiniband_variant_crc, {
6633 "Variant CRC", "infiniband.variant.crc",
6634 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6636 { &hf_infiniband_raw_data, {
6637 "Raw Data", "infiniband.rawdata",
6638 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6640 /* Unknown or Vendor Specific */
6641 { &hf_infiniband_vendor, {
6642 "Unknown/Vendor Specific Data", "infiniband.vendor",
6643 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6646 /* Common Reserved fields */
6647 { &hf_infiniband_reserved, {
6648 "Reserved", "infiniband.reserved",
6649 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6651 /* CM REQ Header */
6652 {&hf_cm_req_local_comm_id, {
6653 "Local Communication ID", "infiniband.cm.req",
6654 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6656 {&hf_cm_req_service_id, {
6657 "ServiceID", "infiniband.cm.req.serviceid",
6658 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6660 {&hf_cm_req_service_id_prefix, {
6661 "Prefix", "infiniband.cm.req.serviceid.prefix",
6662 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6664 {&hf_cm_req_service_id_protocol, {
6665 "Protocol", "infiniband.cm.req.serviceid.protocol",
6666 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6668 {&hf_cm_req_service_id_dport, {
6669 "Destination Port", "infiniband.cm.req.serviceid.dport",
6670 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6672 {&hf_cm_req_local_ca_guid, {
6673 "Local CA GUID", "infiniband.cm.req.localcaguid",
6674 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6676 {&hf_cm_req_local_qkey, {
6677 "Local Q_Key", "infiniband.cm.req.localqkey",
6678 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6680 {&hf_cm_req_local_qpn, {
6681 "Local QPN", "infiniband.cm.req.localqpn",
6682 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6684 {&hf_cm_req_respo_res, {
6685 "Responder Resources", "infiniband.cm.req.responderres",
6686 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6688 {&hf_cm_req_local_eecn, {
6689 "Local EECN", "infiniband.cm.req.localeecn",
6690 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6692 {&hf_cm_req_init_depth, {
6693 "Initiator Depth", "infiniband.cm.req.initdepth",
6694 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6696 {&hf_cm_req_remote_eecn, {
6697 "Remote EECN", "infiniband.cm.req.remoteeecn",
6698 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6700 {&hf_cm_req_remote_cm_resp_to, {
6701 "Remote CM Response Timeout", "infiniband.cm.req.remoteresptout",
6702 FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL}
6704 {&hf_cm_req_transp_serv_type, {
6705 "Transport Service Type", "infiniband.cm.req.transpsvctype",
6706 FT_UINT8, BASE_HEX, NULL, 0x06, NULL, HFILL}
6708 {&hf_cm_req_e2e_flow_ctrl, {
6709 "End-to-End Flow Control", "infiniband.cm.req.e2eflowctrl",
6710 FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL}
6712 {&hf_cm_req_start_psn, {
6713 "Starting PSN", "infiniband.cm.req.startpsn",
6714 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6716 {&hf_cm_req_local_cm_resp_to, {
6717 "Local CM Response Timeout", "infiniband.cm.req.localresptout",
6718 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6720 {&hf_cm_req_retry_count, {
6721 "Retry Count", "infiniband.cm.req.retrcount",
6722 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6724 {&hf_cm_req_pkey, {
6725 "Partition Key", "infiniband.cm.req.pkey",
6726 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6728 {&hf_cm_req_path_pp_mtu, {
6729 "Path Packet Payload MTU", "infiniband.cm.req.pppmtu",
6730 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6732 {&hf_cm_req_rdc_exists, {
6733 "RDC Exists", "infiniband.cm.req.rdcexist",
6734 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6736 {&hf_cm_req_rnr_retry_count, {
6737 "RNR Retry Count", "infiniband.cm.req.rnrretrcount",
6738 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6740 {&hf_cm_req_max_cm_retries, {
6741 "Max CM Retries", "infiniband.cm.req.maxcmretr",
6742 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6744 {&hf_cm_req_srq, {
6745 "SRQ", "infiniband.cm.req.srq",
6746 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6748 {&hf_cm_req_extended_transport, {
6749 "Extended Transport", "infiniband.cm.req.ext_transport",
6750 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6752 {&hf_cm_req_primary_local_lid, {
6753 "Primary Local Port LID", "infiniband.cm.req.prim_locallid",
6754 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6756 {&hf_cm_req_primary_remote_lid, {
6757 "Primary Remote Port LID", "infiniband.cm.req.prim_remotelid",
6758 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6760 {&hf_cm_req_primary_local_gid, {
6761 "Primary Local Port GID", "infiniband.cm.req.prim_localgid",
6762 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6764 {&hf_cm_req_primary_remote_gid, {
6765 "Primary Remote Port GID", "infiniband.cm.req.prim_remotegid",
6766 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6768 {&hf_cm_req_primary_local_gid_ipv4, {
6769 "Primary Local Port GID", "infiniband.cm.req.prim_localgid_ipv4",
6770 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6772 {&hf_cm_req_primary_remote_gid_ipv4, {
6773 "Primary Remote Port GID", "infiniband.cm.req.prim_remotegid_ipv4",
6774 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6776 {&hf_cm_req_primary_flow_label, {
6777 "Primary Flow Label", "infiniband.cm.req.prim_flowlabel",
6778 FT_UINT32, BASE_HEX, NULL, 0xfffff000, NULL, HFILL}
6780 {&hf_cm_req_primary_reserved0, {
6781 "Reserved", "infiniband.cm.req.prim_reserved0",
6782 FT_UINT32, BASE_HEX, NULL, 0x0fc0, NULL, HFILL}
6784 {&hf_cm_req_primary_packet_rate, {
6785 "Primary Packet Rate", "infiniband.cm.req.prim_pktrate",
6786 FT_UINT32, BASE_HEX, NULL, 0x3f, NULL, HFILL}
6788 {&hf_cm_req_primary_traffic_class, {
6789 "Primary Traffic Class", "infiniband.cm.req.prim_tfcclass",
6790 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6792 {&hf_cm_req_primary_hop_limit, {
6793 "Primary Hop Limit", "infiniband.cm.req.prim_hoplim",
6794 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6796 {&hf_cm_req_primary_sl, {
6797 "Primary SL", "infiniband.cm.req.prim_sl",
6798 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6800 {&hf_cm_req_primary_subnet_local, {
6801 "Primary Subnet Local", "infiniband.cm.req.prim_subnetlocal",
6802 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6804 {&hf_cm_req_primary_reserved1, {
6805 "Reserved", "infiniband.cm.req.prim_reserved1",
6806 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6808 {&hf_cm_req_primary_local_ack_to, {
6809 "Primary Local ACK Timeout", "infiniband.cm.req.prim_localacktout",
6810 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6812 {&hf_cm_req_primary_reserved2, {
6813 "Reserved", "infiniband.cm.req.prim_reserved2",
6814 FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}
6816 {&hf_cm_req_alt_local_lid, {
6817 "Alternate Local Port LID", "infiniband.cm.req.alt_locallid",
6818 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6820 {&hf_cm_req_alt_remote_lid, {
6821 "Alternate Remote Port LID", "infiniband.cm.req.alt_remotelid",
6822 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6824 {&hf_cm_req_alt_local_gid, {
6825 "Alternate Local Port GID", "infiniband.cm.req.alt_localgid",
6826 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6828 {&hf_cm_req_alt_remote_gid, {
6829 "Alternate Remote Port GID", "infiniband.cm.req.alt_remotegid",
6830 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6832 {&hf_cm_req_flow_label, {
6833 "Alternate Flow Label", "infiniband.cm.req.alt_flowlabel",
6834 FT_UINT32, BASE_HEX, NULL, 0xfffff000, NULL, HFILL}
6836 {&hf_cm_req_alt_reserved0, {
6837 "Reserved", "infiniband.cm.req.alt_reserved0",
6838 FT_UINT32, BASE_HEX, NULL, 0x0fc0, NULL, HFILL}
6840 {&hf_cm_req_packet_rate, {
6841 "Alternate Packet Rate", "infiniband.cm.req.alt_pktrate",
6842 FT_UINT32, BASE_HEX, NULL, 0x3f, NULL, HFILL}
6844 {&hf_cm_req_alt_traffic_class, {
6845 "Alternate Traffic Class", "infiniband.cm.req.alt_tfcclass",
6846 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6848 {&hf_cm_req_alt_hop_limit, {
6849 "Alternate Hop Limit", "infiniband.cm.req.alt_hoplim",
6850 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6852 {&hf_cm_req_SL, {
6853 "Alternate SL", "infiniband.cm.req.alt_sl",
6854 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6856 {&hf_cm_req_subnet_local, {
6857 "Alternate Subnet Local", "infiniband.cm.req.alt_subnetlocal",
6858 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6860 {&hf_cm_req_alt_reserved1, {
6861 "Reserved", "infiniband.cm.req.alt_reserved1",
6862 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6864 {&hf_cm_req_local_ACK_timeout, {
6865 "Alternate Local ACK Timeout", "infiniband.cm.req.alt_localacktout",
6866 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6868 {&hf_cm_req_alt_reserved2, {
6869 "Reserved", "infiniband.cm.req.alt_reserved1",
6870 FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}
6872 {&hf_cm_req_private_data, {
6873 "PrivateData", "infiniband.cm.req.private",
6874 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6876 {&hf_cm_req_ip_cm_req_msg, {
6877 "IP CM Request Msg", "infiniband.cm.req.ip_cm",
6878 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6880 {&hf_cm_req_ip_cm_majv, {
6881 "IP CM Major Version", "infiniband.cm.req.ip_cm.majv",
6882 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6884 {&hf_cm_req_ip_cm_minv, {
6885 "IP CM Minor Version", "infiniband.cm.req.ip_cm.minv",
6886 FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}
6888 {&hf_cm_req_ip_cm_ipv, {
6889 "IP CM IP Version", "infiniband.cm.req.ip_cm.ipv",
6890 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6892 {&hf_cm_req_ip_cm_res, {
6893 "IP CM Reserved", "infiniband.cm.req.ip_cm.reserved",
6894 FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}
6896 {&hf_cm_req_ip_cm_sport, {
6897 "IP CM Source Port", "infiniband.cm.req.ip_cm.sport",
6898 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6900 {&hf_cm_req_ip_cm_sip6, {
6901 "IP CM Source IP", "infiniband.cm.req.ip_cm.sip6",
6902 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6904 {&hf_cm_req_ip_cm_dip6, {
6905 "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip6",
6906 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6908 {&hf_cm_req_ip_cm_sip4, {
6909 "IP CM Source IP", "infiniband.cm.req.ip_cm.sip4",
6910 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6912 {&hf_cm_req_ip_cm_dip4, {
6913 "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip4",
6914 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6916 {&hf_ip_cm_req_consumer_private_data, {
6917 "IP CM Consumer PrivateData", "infiniband.cm.req.ip_cm.private",
6918 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6920 /* CM REP Header */
6921 {&hf_cm_rep_localcommid, {
6922 "Local Communication ID", "infiniband.cm.rep",
6923 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6925 {&hf_cm_rep_remotecommid, {
6926 "Remote Communication ID", "infiniband.cm.rep.remotecommid",
6927 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6929 {&hf_cm_rep_localqkey, {
6930 "Local Q_Key", "infiniband.cm.rep.localqkey",
6931 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6933 {&hf_cm_rep_localqpn, {
6934 "Local QPN", "infiniband.cm.rep.localqpn",
6935 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6937 {&hf_cm_rep_localeecontnum, {
6938 "Local EE Context Number", "infiniband.cm.rep.localeecn",
6939 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6941 {&hf_cm_rep_startingpsn, {
6942 "Starting PSN", "infiniband.cm.rep.startpsn",
6943 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6945 {&hf_cm_rep_responderres, {
6946 "Responder Resources", "infiniband.cm.rep.respres",
6947 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6949 {&hf_cm_rep_initiatordepth, {
6950 "Initiator Depth", "infiniband.cm.rep.initdepth",
6951 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6953 {&hf_cm_rep_tgtackdelay, {
6954 "Target ACK Delay", "infiniband.cm.rep.tgtackdelay",
6955 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6957 {&hf_cm_rep_failoveracc, {
6958 "Failover Accepted", "infiniband.cm.rep.failoveracc",
6959 FT_UINT8, BASE_HEX, NULL, 0x6, NULL, HFILL}
6961 {&hf_cm_rep_e2eflowctl, {
6962 "End-To-End Flow Control", "infiniband.cm.rep.e2eflowctrl",
6963 FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL}
6965 {&hf_cm_rep_rnrretrycount, {
6966 "RNR Retry Count", "infiniband.cm.rep.rnrretrcount",
6967 FT_UINT8, BASE_HEX, NULL, 0xe0, NULL, HFILL}
6969 {&hf_cm_rep_srq, {
6970 "SRQ", "infiniband.cm.rep.srq",
6971 FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL}
6973 {&hf_cm_rep_reserved, {
6974 "Reserved", "infiniband.cm.rep.reserved",
6975 FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}
6977 {&hf_cm_rep_localcaguid, {
6978 "Local CA GUID", "infiniband.cm.rep.localcaguid",
6979 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6981 {&hf_cm_rep_privatedata, {
6982 "PrivateData", "infiniband.cm.rep.private",
6983 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6985 /* IB CM RTU Header */
6986 {&hf_cm_rtu_localcommid, {
6987 "Local Communication ID", "infiniband.cm.rtu.localcommid",
6988 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6990 {&hf_cm_rtu_remotecommid, {
6991 "Remote Communication ID", "infiniband.cm.rtu.remotecommid",
6992 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6994 {&hf_cm_rtu_privatedata, {
6995 "PrivateData", "infiniband.cm.rtu.private",
6996 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6998 /* CM REJ Header */
6999 {&hf_cm_rej_local_commid, {
7000 "Local Communication ID", "infiniband.cm.rej.localcommid",
7001 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7003 {&hf_cm_rej_remote_commid, {
7004 "Remote Communication ID", "infiniband.cm.rej.remotecommid",
7005 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7007 {&hf_cm_rej_msg_rej, {
7008 "Message REJected", "infiniband.cm.rej.msgrej",
7009 FT_UINT8, BASE_HEX, NULL, 0xc0, NULL, HFILL}
7011 {&hf_cm_rej_msg_reserved0, {
7012 "Reserved", "infiniband.cm.rej.reserved0",
7013 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
7015 {&hf_cm_rej_rej_info_len, {
7016 "Reject Info Length", "infiniband.cm.rej.rejinfolen",
7017 FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL}
7019 {&hf_cm_rej_msg_reserved1, {
7020 "Reserved", "infiniband.cm.rej.reserved1",
7021 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
7023 {&hf_cm_rej_reason, {
7024 "Reason", "infiniband.cm.rej.reason",
7025 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7027 {&hf_cm_rej_add_rej_info, {
7028 "Additional Reject Information (ARI)", "infiniband.cm.rej.ari",
7029 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7031 {&hf_cm_rej_private_data, {
7032 "PrivateData", "infiniband.cm.rej.private",
7033 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7035 /* IB CM DREQ Header */
7036 {&hf_cm_dreq_localcommid, {
7037 "Local Communication ID", "infiniband.cm.dreq.localcommid",
7038 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7040 {&hf_cm_dreq_remotecommid, {
7041 "Remote Communication ID", "infiniband.cm.dreq.remotecommid",
7042 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7044 {&hf_cm_dreq_remote_qpn, {
7045 "Remote QPN/EECN", "infiniband.cm.req.remoteqpneecn",
7046 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7048 {&hf_cm_dreq_privatedata, {
7049 "PrivateData", "infiniband.cm.dreq.private",
7050 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7052 /* IB CM DRSP Header */
7053 {&hf_cm_drsp_localcommid, {
7054 "Local Communication ID", "infiniband.cm.drsp.localcommid",
7055 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7057 {&hf_cm_drsp_remotecommid, {
7058 "Remote Communication ID", "infiniband.cm.drsp.remotecommid",
7059 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7061 {&hf_cm_drsp_privatedata, {
7062 "PrivateData", "infiniband.cm.drsp.private",
7063 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7066 /* MAD Base Header */
7067 { &hf_infiniband_MAD, {
7068 "MAD (Management Datagram) Common Header", "infiniband.mad",
7069 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7071 { &hf_infiniband_base_version, {
7072 "Base Version", "infiniband.mad.baseversion",
7073 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7075 { &hf_infiniband_mgmt_class, {
7076 "Management Class", "infiniband.mad.mgmtclass",
7077 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7079 { &hf_infiniband_class_version, {
7080 "Class Version", "infiniband.mad.classversion",
7081 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7083 { &hf_infiniband_method, {
7084 "Method", "infiniband.mad.method",
7085 FT_UINT8, BASE_HEX, VALS(mad_method_str), 0x0, NULL, HFILL}
7087 { &hf_infiniband_status, {
7088 "Status", "infiniband.mad.status",
7089 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7091 { &hf_infiniband_class_specific, {
7092 "Class Specific", "infiniband.mad.classspecific",
7093 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7095 { &hf_infiniband_transaction_id, {
7096 "Transaction ID", "infiniband.mad.transactionid",
7097 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7099 { &hf_infiniband_attribute_id, {
7100 "Attribute ID", "infiniband.mad.attributeid",
7101 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7103 { &hf_infiniband_attribute_modifier, {
7104 "Attribute Modifier", "infiniband.mad.attributemodifier",
7105 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7107 { &hf_infiniband_data, {
7108 "MAD Data Payload", "infiniband.mad.data",
7109 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7112 /* RMPP Header */
7113 { &hf_infiniband_RMPP, {
7114 "RMPP (Reliable Multi-Packet Transaction Protocol)", "infiniband.rmpp",
7115 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7117 { &hf_infiniband_rmpp_version, {
7118 "RMPP Type", "infiniband.rmpp.rmppversion",
7119 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7121 { &hf_infiniband_rmpp_type, {
7122 "RMPP Type", "infiniband.rmpp.rmpptype",
7123 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7125 { &hf_infiniband_r_resp_time, {
7126 "R Resp Time", "infiniband.rmpp.rresptime",
7127 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7129 { &hf_infiniband_rmpp_flags, {
7130 "RMPP Flags", "infiniband.rmpp.rmppflags",
7131 FT_UINT8, BASE_HEX, VALS(RMPP_Flags), 0x0F, NULL, HFILL}
7133 { &hf_infiniband_rmpp_status, {
7134 "RMPP Status", "infiniband.rmpp.rmppstatus",
7135 FT_UINT8, BASE_HEX, VALS(RMPP_Status), 0x0, NULL, HFILL}
7137 { &hf_infiniband_rmpp_data1, {
7138 "RMPP Data 1", "infiniband.rmpp.data1",
7139 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7141 { &hf_infiniband_rmpp_data2, {
7142 "RMPP Data 2", "infiniband.rmpp.data2",
7143 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7146 /* RMPP Data */
7147 #if 0
7148 { &hf_infiniband_RMPP_DATA, {
7149 "RMPP Data (Reliable Multi-Packet Transaction Protocol)", "infiniband.rmpp.data",
7150 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7152 #endif
7153 { &hf_infiniband_segment_number, {
7154 "Segment Number", "infiniband.rmpp.segmentnumber",
7155 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7157 { &hf_infiniband_payload_length32, {
7158 "Payload Length", "infiniband.rmpp.payloadlength",
7159 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7161 { &hf_infiniband_transferred_data, {
7162 "Transferred Data", "infiniband.rmpp.transferreddata",
7163 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7166 /* RMPP ACK */
7167 { &hf_infiniband_new_window_last, {
7168 "New Window Last", "infiniband.rmpp.newwindowlast",
7169 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7172 /* RMPP ABORT/STOP */
7173 { &hf_infiniband_optional_extended_error_data, {
7174 "Optional Extended Error Data", "infiniband.rmpp.extendederrordata",
7175 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7178 /* SMP Data (LID Routed) */
7179 { &hf_infiniband_SMP_LID, {
7180 "Subnet Management Packet (LID Routed)", "infiniband.smplid",
7181 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7183 { &hf_infiniband_m_key, {
7184 "M_Key", "infiniband.smplid.mkey",
7185 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7187 { &hf_infiniband_smp_data, {
7188 "SMP Data", "infiniband.smplid.smpdata",
7189 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7192 /* XX: All following verified/corrected against Infiniband 1.2.1 Specification */
7193 /* SMP Data Directed Route */
7194 { &hf_infiniband_SMP_DIRECTED, {
7195 "Subnet Management Packet (Directed Route)", "infiniband.smpdirected",
7196 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7198 { &hf_infiniband_smp_status, {
7199 "Status", "infiniband.smpdirected.smpstatus",
7200 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7202 { &hf_infiniband_hop_pointer, {
7203 "Hop Pointer", "infiniband.smpdirected.hoppointer",
7204 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7206 { &hf_infiniband_hop_count, {
7207 "Hop Count", "infiniband.smpdirected.hopcount",
7208 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7210 { &hf_infiniband_dr_slid, {
7211 "DrSLID", "infiniband.smpdirected.drslid",
7212 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7214 { &hf_infiniband_dr_dlid, {
7215 "DrDLID", "infiniband.smpdirected.drdlid",
7216 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7218 { &hf_infiniband_d, {
7219 "D (Direction Bit)", "infiniband.smpdirected.d",
7220 FT_UINT64, BASE_HEX, NULL, 0x8000, NULL, HFILL}
7222 { &hf_infiniband_initial_path, {
7223 "Initial Path", "infiniband.smpdirected.initialpath",
7224 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7226 { &hf_infiniband_return_path, {
7227 "Return Path", "infiniband.smpdirected.returnpath",
7228 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7231 /* SA MAD Header */
7232 { &hf_infiniband_SA, {
7233 "SA Packet (Subnet Administration)", "infiniband.sa.drdlid",
7234 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7236 { &hf_infiniband_sm_key, {
7237 "SM_Key (Verification Key)", "infiniband.sa.smkey",
7238 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7240 { &hf_infiniband_attribute_offset, {
7241 "Attribute Offset", "infiniband.sa.attributeoffset",
7242 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7244 { &hf_infiniband_component_mask, {
7245 "Component Mask", "infiniband.sa.componentmask",
7246 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7248 { &hf_infiniband_subnet_admin_data, {
7249 "Subnet Admin Data", "infiniband.sa.subnetadmindata",
7250 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7253 /* NodeDescription */
7254 { &hf_infiniband_NodeDescription_NodeString, {
7255 "NodeString", "infiniband.nodedescription.nodestring",
7256 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
7259 /* NodeInfo */
7260 { &hf_infiniband_NodeInfo_BaseVersion, {
7261 "BaseVersion", "infiniband.nodeinfo.baseversion",
7262 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7264 { &hf_infiniband_NodeInfo_ClassVersion, {
7265 "ClassVersion", "infiniband.nodeinfo.classversion",
7266 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7268 { &hf_infiniband_NodeInfo_NodeType, {
7269 "NodeType", "infiniband.nodeinfo.nodetype",
7270 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7272 { &hf_infiniband_NodeInfo_NumPorts, {
7273 "NumPorts", "infiniband.nodeinfo.numports",
7274 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7276 { &hf_infiniband_NodeInfo_SystemImageGUID, {
7277 "SystemImageGUID", "infiniband.nodeinfo.systemimageguid",
7278 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7280 { &hf_infiniband_NodeInfo_NodeGUID, {
7281 "NodeGUID", "infiniband.nodeinfo.nodeguid",
7282 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7284 { &hf_infiniband_NodeInfo_PortGUID, {
7285 "PortGUID", "infiniband.nodeinfo.portguid",
7286 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7288 { &hf_infiniband_NodeInfo_PartitionCap, {
7289 "PartitionCap", "infiniband.nodeinfo.partitioncap",
7290 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7292 { &hf_infiniband_NodeInfo_DeviceID, {
7293 "DeviceID", "infiniband.nodeinfo.deviceid",
7294 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7296 { &hf_infiniband_NodeInfo_Revision, {
7297 "Revision", "infiniband.nodeinfo.revision",
7298 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7300 { &hf_infiniband_NodeInfo_LocalPortNum, {
7301 "LocalPortNum", "infiniband.nodeinfo.localportnum",
7302 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7304 { &hf_infiniband_NodeInfo_VendorID, {
7305 "VendorID", "infiniband.nodeinfo.vendorid",
7306 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7309 /* SwitchInfo */
7310 { &hf_infiniband_SwitchInfo_LinearFDBCap, {
7311 "LinearFDBCap", "infiniband.switchinfo.linearfdbcap",
7312 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7314 { &hf_infiniband_SwitchInfo_RandomFDBCap, {
7315 "RandomFDBCap", "infiniband.switchinfo.randomfdbcap",
7316 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7318 { &hf_infiniband_SwitchInfo_MulticastFDBCap, {
7319 "MulticastFDBCap", "infiniband.switchinfo.multicastfdbcap",
7320 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7322 { &hf_infiniband_SwitchInfo_LinearFDBTop, {
7323 "LinearFDBTop", "infiniband.switchinfo.linearfdbtop",
7324 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7326 { &hf_infiniband_SwitchInfo_DefaultPort, {
7327 "DefaultPort", "infiniband.switchinfo.defaultport",
7328 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7330 { &hf_infiniband_SwitchInfo_DefaultMulticastPrimaryPort, {
7331 "DefaultMulticastPrimaryPort", "infiniband.switchinfo.defaultmulticastprimaryport",
7332 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7334 { &hf_infiniband_SwitchInfo_DefaultMulticastNotPrimaryPort, {
7335 "DefaultMulticastNotPrimaryPort", "infiniband.switchinfo.defaultmulticastnotprimaryport",
7336 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7338 { &hf_infiniband_SwitchInfo_LifeTimeValue, {
7339 "LifeTimeValue", "infiniband.switchinfo.lifetimevalue",
7340 FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL}
7342 { &hf_infiniband_SwitchInfo_PortStateChange, {
7343 "PortStateChange", "infiniband.switchinfo.portstatechange",
7344 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL}
7346 { &hf_infiniband_SwitchInfo_OptimizedSLtoVLMappingProgramming, {
7347 "OptimizedSLtoVLMappingProgramming", "infiniband.switchinfo.optimizedsltovlmappingprogramming",
7348 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
7350 { &hf_infiniband_SwitchInfo_LIDsPerPort, {
7351 "LIDsPerPort", "infiniband.switchinfo.lidsperport",
7352 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7354 { &hf_infiniband_SwitchInfo_PartitionEnforcementCap, {
7355 "PartitionEnforcementCap", "infiniband.switchinfo.partitionenforcementcap",
7356 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7358 { &hf_infiniband_SwitchInfo_InboundEnforcementCap, {
7359 "InboundEnforcementCap", "infiniband.switchinfo.inboundenforcementcap",
7360 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7362 { &hf_infiniband_SwitchInfo_OutboundEnforcementCap, {
7363 "OutboundEnforcementCap", "infiniband.switchinfo.outboundenforcementcap",
7364 FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL}
7366 { &hf_infiniband_SwitchInfo_FilterRawInboundCap, {
7367 "FilterRawInboundCap", "infiniband.switchinfo.filterrawinboundcap",
7368 FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL}
7370 { &hf_infiniband_SwitchInfo_FilterRawOutboundCap, {
7371 "FilterRawOutboundCap", "infiniband.switchinfo.filterrawoutboundcap",
7372 FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL}
7374 { &hf_infiniband_SwitchInfo_EnhancedPortZero, {
7375 "EnhancedPortZero", "infiniband.switchinfo.enhancedportzero",
7376 FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL}
7379 /* GUIDInfo */
7380 #if 0
7381 { &hf_infiniband_GUIDInfo_GUIDBlock, {
7382 "GUIDBlock", "infiniband.switchinfo.guidblock",
7383 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7385 #endif
7386 { &hf_infiniband_GUIDInfo_GUID, {
7387 "GUID", "infiniband.switchinfo.guid",
7388 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7391 /* PortInfo */
7392 { &hf_infiniband_PortInfo_M_Key, {
7393 "M_Key", "infiniband.portinfo.m_key",
7394 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7396 { &hf_infiniband_PortInfo_GidPrefix, {
7397 "GidPrefix", "infiniband.portinfo.guid",
7398 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7400 { &hf_infiniband_PortInfo_LID, {
7401 "LID", "infiniband.portinfo.lid",
7402 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7404 { &hf_infiniband_PortInfo_MasterSMLID, {
7405 "MasterSMLID", "infiniband.portinfo.mastersmlid",
7406 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7408 { &hf_infiniband_PortInfo_CapabilityMask, {
7409 "CapabilityMask", "infiniband.portinfo.capabilitymask",
7410 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7413 /* Capability Mask Flags */
7414 { &hf_infiniband_PortInfo_CapabilityMask_SM, {
7415 "SM", "infiniband.portinfo.capabilitymask.issm",
7416 FT_UINT32, BASE_HEX, NULL, 0x00000002, NULL, HFILL}
7418 { &hf_infiniband_PortInfo_CapabilityMask_NoticeSupported, {
7419 "NoticeSupported", "infiniband.portinfo.capabilitymask.noticesupported",
7420 FT_UINT32, BASE_HEX, NULL, 0x00000004, NULL, HFILL}
7422 { &hf_infiniband_PortInfo_CapabilityMask_TrapSupported, {
7423 "TrapSupported", "infiniband.portinfo.capabilitymask.trapsupported",
7424 FT_UINT32, BASE_HEX, NULL, 0x00000008, NULL, HFILL}
7426 { &hf_infiniband_PortInfo_CapabilityMask_OptionalIPDSupported, {
7427 "OptionalIPDSupported", "infiniband.portinfo.capabilitymask.optionalipdsupported",
7428 FT_UINT32, BASE_HEX, NULL, 0x00000010, NULL, HFILL}
7430 { &hf_infiniband_PortInfo_CapabilityMask_AutomaticMigrationSupported, {
7431 "AutomaticMigrationSupported", "infiniband.portinfo.capabilitymask.automaticmigrationsupported",
7432 FT_UINT32, BASE_HEX, NULL, 0x00000020, NULL, HFILL}
7434 { &hf_infiniband_PortInfo_CapabilityMask_SLMappingSupported, {
7435 "SLMappingSupported", "infiniband.portinfo.capabilitymask.slmappingsupported",
7436 FT_UINT32, BASE_HEX, NULL, 0x00000040, NULL, HFILL}
7438 { &hf_infiniband_PortInfo_CapabilityMask_MKeyNVRAM, {
7439 "MKeyNVRAM", "infiniband.portinfo.capabilitymask.mkeynvram",
7440 FT_UINT32, BASE_HEX, NULL, 0x00000080, NULL, HFILL}
7442 { &hf_infiniband_PortInfo_CapabilityMask_PKeyNVRAM, {
7443 "PKeyNVRAM", "infiniband.portinfo.capabilitymask.pkeynvram",
7444 FT_UINT32, BASE_HEX, NULL, 0x00000100, NULL, HFILL}
7446 { &hf_infiniband_PortInfo_CapabilityMask_LEDInfoSupported, {
7447 "LEDInfoSupported", "infiniband.portinfo.capabilitymask.ledinfosupported",
7448 FT_UINT32, BASE_HEX, NULL, 0x00000200, NULL, HFILL}
7450 { &hf_infiniband_PortInfo_CapabilityMask_SMdisabled, {
7451 "SMdisabled", "infiniband.portinfo.capabilitymask.smdisabled",
7452 FT_UINT32, BASE_HEX, NULL, 0x00000400, NULL, HFILL}
7454 { &hf_infiniband_PortInfo_CapabilityMask_SystemImageGUIDSupported, {
7455 "SystemImageGUIDSupported", "infiniband.portinfo.capabilitymask.systemimageguidsupported",
7456 FT_UINT32, BASE_HEX, NULL, 0x00000800, NULL, HFILL}
7458 { &hf_infiniband_PortInfo_CapabilityMask_PKeySwitchExternalPortTrapSupported, {
7459 "PKeySwitchExternalPortTrapSupported", "infiniband.portinfo.capabilitymask.pkeyswitchexternalporttrapsupported",
7460 FT_UINT32, BASE_HEX, NULL, 0x00001000, NULL, HFILL}
7462 { &hf_infiniband_PortInfo_CapabilityMask_CommunicationManagementSupported, {
7463 "CommunicationManagementSupported", "infiniband.portinfo.capabilitymask.communicationmanagementsupported",
7464 FT_UINT32, BASE_HEX, NULL, 0x00010000, NULL, HFILL}
7466 { &hf_infiniband_PortInfo_CapabilityMask_SNMPTunnelingSupported, {
7467 "SNMPTunnelingSupported", "infiniband.portinfo.capabilitymask.snmptunnelingsupported",
7468 FT_UINT32, BASE_HEX, NULL, 0x00020000, NULL, HFILL}
7470 { &hf_infiniband_PortInfo_CapabilityMask_ReinitSupported, {
7471 "ReinitSupported", "infiniband.portinfo.capabilitymask.reinitsupported",
7472 FT_UINT32, BASE_HEX, NULL, 0x00040000, NULL, HFILL}
7474 { &hf_infiniband_PortInfo_CapabilityMask_DeviceManagementSupported, {
7475 "DeviceManagementSupported", "infiniband.portinfo.capabilitymask.devicemanagementsupported",
7476 FT_UINT32, BASE_HEX, NULL, 0x00080000, NULL, HFILL}
7478 { &hf_infiniband_PortInfo_CapabilityMask_VendorClassSupported, {
7479 "VendorClassSupported", "infiniband.portinfo.capabilitymask.vendorclasssupported",
7480 FT_UINT32, BASE_HEX, NULL, 0x00100000, NULL, HFILL}
7482 { &hf_infiniband_PortInfo_CapabilityMask_DRNoticeSupported, {
7483 "DRNoticeSupported", "infiniband.portinfo.capabilitymask.drnoticesupported",
7484 FT_UINT32, BASE_HEX, NULL, 0x00200000, NULL, HFILL}
7486 { &hf_infiniband_PortInfo_CapabilityMask_CapabilityMaskNoticeSupported, {
7487 "CapabilityMaskNoticeSupported", "infiniband.portinfo.capabilitymask.capabilitymasknoticesupported",
7488 FT_UINT32, BASE_HEX, NULL, 0x00400000, NULL, HFILL}
7490 { &hf_infiniband_PortInfo_CapabilityMask_BootManagementSupported, {
7491 "BootManagementSupported", "infiniband.portinfo.capabilitymask.bootmanagementsupported",
7492 FT_UINT32, BASE_HEX, NULL, 0x00800000, NULL, HFILL}
7494 { &hf_infiniband_PortInfo_CapabilityMask_LinkRoundTripLatencySupported, {
7495 "LinkRoundTripLatencySupported", "infiniband.portinfo.capabilitymask.linkroundtriplatencysupported",
7496 FT_UINT32, BASE_HEX, NULL, 0x01000000, NULL, HFILL}
7498 { &hf_infiniband_PortInfo_CapabilityMask_ClientRegistrationSupported, {
7499 "ClientRegistrationSupported", "infiniband.portinfo.capabilitymask.clientregistrationsupported",
7500 FT_UINT32, BASE_HEX, NULL, 0x02000000, NULL, HFILL}
7502 { &hf_infiniband_PortInfo_CapabilityMask_OtherLocalChangesNoticeSupported, {
7503 "OtherLocalChangesNoticeSupported", "infiniband.portinfo.capabilitymask.otherlocalchangesnoticesupported",
7504 FT_UINT32, BASE_HEX, NULL, 0x04000000, NULL, HFILL}
7506 { &hf_infiniband_PortInfo_CapabilityMask_LinkSpeedWIdthPairsTableSupported, {
7507 "LinkSpeedWIdthPairsTableSupported", "infiniband.portinfo.capabilitymask.linkspeedwidthpairstablesupported",
7508 FT_UINT32, BASE_HEX, NULL, 0x08000000, NULL, HFILL}
7510 /* End Capability Mask Flags */
7512 /* PortInfo */
7513 { &hf_infiniband_PortInfo_DiagCode, {
7514 "DiagCode", "infiniband.portinfo.diagcode",
7515 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7517 { &hf_infiniband_PortInfo_M_KeyLeasePeriod, {
7518 "M_KeyLeasePeriod", "infiniband.portinfo.m_keyleaseperiod",
7519 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7521 { &hf_infiniband_PortInfo_LocalPortNum, {
7522 "LocalPortNum", "infiniband.portinfo.localportnum",
7523 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7525 { &hf_infiniband_PortInfo_LinkWidthEnabled, {
7526 "LinkWidthEnabled", "infiniband.portinfo.linkwidthenabled",
7527 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7529 { &hf_infiniband_PortInfo_LinkWidthSupported, {
7530 "LinkWidthSupported", "infiniband.portinfo.linkwidthsupported",
7531 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7533 { &hf_infiniband_PortInfo_LinkWidthActive, {
7534 "LinkWidthActive", "infiniband.portinfo.linkwidthactive",
7535 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7537 { &hf_infiniband_PortInfo_LinkSpeedSupported, {
7538 "LinkSpeedSupported", "infiniband.portinfo.linkspeedsupported",
7539 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7541 { &hf_infiniband_PortInfo_PortState, {
7542 "PortState", "infiniband.portinfo.portstate",
7543 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7545 { &hf_infiniband_PortInfo_PortPhysicalState, {
7546 "PortPhysicalState", "infiniband.portinfo.portphysicalstate",
7547 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7549 { &hf_infiniband_PortInfo_LinkDownDefaultState, {
7550 "LinkDownDefaultState", "infiniband.portinfo.linkdowndefaultstate",
7551 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7553 { &hf_infiniband_PortInfo_M_KeyProtectBits, {
7554 "M_KeyProtectBits", "infiniband.portinfo.m_keyprotectbits",
7555 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7557 { &hf_infiniband_PortInfo_LMC, {
7558 "LMC", "infiniband.portinfo.lmc",
7559 FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}
7561 { &hf_infiniband_PortInfo_LinkSpeedActive, {
7562 "LinkSpeedActive", "infiniband.portinfo.linkspeedactive",
7563 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7565 { &hf_infiniband_PortInfo_LinkSpeedEnabled, {
7566 "LinkSpeedEnabled", "infiniband.portinfo.linkspeedenabled",
7567 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7569 { &hf_infiniband_PortInfo_NeighborMTU, {
7570 "NeighborMTU", "infiniband.portinfo.neighbormtu",
7571 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7573 { &hf_infiniband_PortInfo_MasterSMSL, {
7574 "MasterSMSL", "infiniband.portinfo.mastersmsl",
7575 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7577 { &hf_infiniband_PortInfo_VLCap, {
7578 "VLCap", "infiniband.portinfo.vlcap",
7579 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7581 { &hf_infiniband_PortInfo_InitType, {
7582 "InitType", "infiniband.portinfo.inittype",
7583 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7585 { &hf_infiniband_PortInfo_VLHighLimit, {
7586 "VLHighLimit", "infiniband.portinfo.vlhighlimit",
7587 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7589 { &hf_infiniband_PortInfo_VLArbitrationHighCap, {
7590 "VLArbitrationHighCap", "infiniband.portinfo.vlarbitrationhighcap",
7591 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7593 { &hf_infiniband_PortInfo_VLArbitrationLowCap, {
7594 "VLArbitrationLowCap", "infiniband.portinfo.vlarbitrationlowcap",
7595 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7597 { &hf_infiniband_PortInfo_InitTypeReply, {
7598 "InitTypeReply", "infiniband.portinfo.inittypereply",
7599 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7601 { &hf_infiniband_PortInfo_MTUCap, {
7602 "MTUCap", "infiniband.portinfo.mtucap",
7603 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7605 { &hf_infiniband_PortInfo_VLStallCount, {
7606 "VLStallCount", "infiniband.portinfo.vlstallcount",
7607 FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL}
7609 { &hf_infiniband_PortInfo_HOQLife, {
7610 "HOQLife", "infiniband.portinfo.hoqlife",
7611 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7613 { &hf_infiniband_PortInfo_OperationalVLs, {
7614 "OperationalVLs", "infiniband.portinfo.operationalvls",
7615 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7617 { &hf_infiniband_PortInfo_PartitionEnforcementInbound, {
7618 "PartitionEnforcementInbound", "infiniband.portinfo.partitionenforcementinbound",
7619 FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL}
7621 { &hf_infiniband_PortInfo_PartitionEnforcementOutbound, {
7622 "PartitionEnforcementOutbound", "infiniband.portinfo.partitionenforcementoutbound",
7623 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL}
7625 { &hf_infiniband_PortInfo_FilterRawInbound, {
7626 "FilterRawInbound", "infiniband.portinfo.filterrawinbound",
7627 FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}
7629 { &hf_infiniband_PortInfo_FilterRawOutbound, {
7630 "FilterRawOutbound", "infiniband.portinfo.filterrawoutbound",
7631 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
7633 { &hf_infiniband_PortInfo_M_KeyViolations, {
7634 "M_KeyViolations", "infiniband.portinfo.m_keyviolations",
7635 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7637 { &hf_infiniband_PortInfo_P_KeyViolations, {
7638 "P_KeyViolations", "infiniband.portinfo.p_keyviolations",
7639 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7641 { &hf_infiniband_PortInfo_Q_KeyViolations, {
7642 "Q_KeyViolations", "infiniband.portinfo.q_keyviolations",
7643 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7645 { &hf_infiniband_PortInfo_GUIDCap, {
7646 "GUIDCap", "infiniband.portinfo.guidcap",
7647 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7649 { &hf_infiniband_PortInfo_ClientReregister, {
7650 "ClientReregister", "infiniband.portinfo.clientreregister",
7651 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7653 { &hf_infiniband_PortInfo_SubnetTimeOut, {
7654 "SubnetTimeOut", "infiniband.portinfo.subnettimeout",
7655 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7657 { &hf_infiniband_PortInfo_RespTimeValue, {
7658 "RespTimeValue", "infiniband.portinfo.resptimevalue",
7659 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7661 { &hf_infiniband_PortInfo_LocalPhyErrors, {
7662 "LocalPhyErrors", "infiniband.portinfo.localphyerrors",
7663 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7665 { &hf_infiniband_PortInfo_OverrunErrors, {
7666 "OverrunErrors", "infiniband.portinfo.overrunerrors",
7667 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7669 { &hf_infiniband_PortInfo_MaxCreditHint, {
7670 "MaxCreditHint", "infiniband.portinfo.maxcredithint",
7671 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7673 { &hf_infiniband_PortInfo_LinkRoundTripLatency, {
7674 "LinkRoundTripLatency", "infiniband.portinfo.linkroundtriplatency",
7675 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7678 /* P_KeyTable */
7679 { &hf_infiniband_P_KeyTable_P_KeyTableBlock, {
7680 "P_KeyTableBlock", "infiniband.p_keytable.p_keytableblock",
7681 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7683 { &hf_infiniband_P_KeyTable_MembershipType, {
7684 "MembershipType", "infiniband.p_keytable.membershiptype",
7685 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7687 { &hf_infiniband_P_KeyTable_P_KeyBase, {
7688 "P_KeyBase", "infiniband.p_keytable.p_keybase",
7689 FT_UINT16, BASE_HEX, NULL, 0x7FFF, NULL, HFILL}
7692 /* SLtoVLMappingTable */
7693 { &hf_infiniband_SLtoVLMappingTable_SLtoVL_HighBits, {
7694 "SL(x)toVL", "infiniband.sltovlmappingtable.sltovlhighbits",
7695 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7697 { &hf_infiniband_SLtoVLMappingTable_SLtoVL_LowBits, {
7698 "SL(x)toVL", "infiniband.sltovlmappingtable.sltovllowbits",
7699 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7702 /* VLArbitrationTable */
7703 #if 0
7704 { &hf_infiniband_VLArbitrationTable_VLWeightPairs, {
7705 "VLWeightPairs", "infiniband.vlarbitrationtable.vlweightpairs",
7706 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7708 #endif
7709 { &hf_infiniband_VLArbitrationTable_VL, {
7710 "VL", "infiniband.vlarbitrationtable.vl",
7711 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7713 { &hf_infiniband_VLArbitrationTable_Weight, {
7714 "Weight", "infiniband.vlarbitrationtable.weight",
7715 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7718 /* LinearForwardingTable */
7719 #if 0
7720 { &hf_infiniband_LinearForwardingTable_LinearForwardingTableBlock, {
7721 "LinearForwardingTableBlock", "infiniband.linearforwardingtable.linearforwardingtableblock",
7722 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7724 #endif
7725 { &hf_infiniband_LinearForwardingTable_Port, {
7726 "Port", "infiniband.linearforwardingtable.port",
7727 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7730 /* RandomForwardingTable */
7731 #if 0
7732 { &hf_infiniband_RandomForwardingTable_RandomForwardingTableBlock, {
7733 "RandomForwardingTableBlock", "infiniband.randomforwardingtable.randomforwardingtableblock",
7734 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7736 #endif
7737 { &hf_infiniband_RandomForwardingTable_LID, {
7738 "LID", "infiniband.randomforwardingtable.lid",
7739 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7741 { &hf_infiniband_RandomForwardingTable_Valid, {
7742 "Valid", "infiniband.randomforwardingtable.valid",
7743 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7745 { &hf_infiniband_RandomForwardingTable_LMC, {
7746 "LMC", "infiniband.randomforwardingtable.lmc",
7747 FT_UINT8, BASE_HEX, NULL, 0x70, NULL, HFILL}
7749 { &hf_infiniband_RandomForwardingTable_Port, {
7750 "Port", "infiniband.randomforwardingtable.port",
7751 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7754 /* MulticastForwardingTable */
7755 #if 0
7756 { &hf_infiniband_MulticastForwardingTable_MulticastForwardingTableBlock , {
7757 "MulticastForwardingTableBlock", "infiniband.multicastforwardingtable.multicastforwardingtableblock",
7758 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7760 #endif
7761 { &hf_infiniband_MulticastForwardingTable_PortMask, {
7762 "PortMask", "infiniband.multicastforwardingtable.portmask",
7763 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7766 /* SMInfo */
7767 { &hf_infiniband_SMInfo_GUID, {
7768 "GUID", "infiniband.sminfo.guid",
7769 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7771 { &hf_infiniband_SMInfo_SM_Key, {
7772 "SM_Key", "infiniband.sminfo.sm_key",
7773 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7775 { &hf_infiniband_SMInfo_ActCount, {
7776 "ActCount", "infiniband.sminfo.actcount",
7777 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7779 { &hf_infiniband_SMInfo_Priority, {
7780 "Priority", "infiniband.sminfo.priority",
7781 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7783 { &hf_infiniband_SMInfo_SMState, {
7784 "SMState", "infiniband.sminfo.smstate",
7785 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7788 /* VendorDiag */
7789 { &hf_infiniband_VendorDiag_NextIndex, {
7790 "NextIndex", "infiniband.vendordiag.nextindex",
7791 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7793 { &hf_infiniband_VendorDiag_DiagData, {
7794 "DiagData", "infiniband.vendordiag.diagdata",
7795 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7798 /* LedInfo */
7799 { &hf_infiniband_LedInfo_LedMask, {
7800 "LedMask", "infiniband.ledinfo.ledmask",
7801 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7804 /* LinkSpeedWidthPairsTable */
7805 { &hf_infiniband_LinkSpeedWidthPairsTable_NumTables, {
7806 "NumTables", "infiniband.linkspeedwidthpairstable.numtables",
7807 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7809 { &hf_infiniband_LinkSpeedWidthPairsTable_PortMask, {
7810 "PortMask", "infiniband.linkspeedwidthpairstable.portmask",
7811 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7813 { &hf_infiniband_LinkSpeedWidthPairsTable_SpeedTwoFive, {
7814 "Speed 2.5 Gbps", "infiniband.linkspeedwidthpairstable.speedtwofive",
7815 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7817 { &hf_infiniband_LinkSpeedWidthPairsTable_SpeedFive, {
7818 "Speed 5 Gbps", "infiniband.linkspeedwidthpairstable.speedfive",
7819 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7821 { &hf_infiniband_LinkSpeedWidthPairsTable_SpeedTen, {
7822 "Speed 10 Gbps", "infiniband.linkspeedwidthpairstable.speedten",
7823 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7826 /* NodeRecord */
7827 /* PortInfoRecord */
7828 /* SLtoVLMappingTableRecord */
7829 /* SwitchInfoRecord */
7830 /* LinearForwardingTableRecord */
7831 /* RandomForwardingTableRecord */
7832 /* MulticastForwardingTableRecord */
7833 /* VLArbitrationTableRecord */
7834 { &hf_infiniband_SA_LID, {
7835 "LID", "infiniband.sa.lid",
7836 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7838 { &hf_infiniband_SA_EndportLID, {
7839 "EndportLID", "infiniband.sa.endportlid",
7840 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7842 { &hf_infiniband_SA_PortNum, {
7843 "PortNum", "infiniband.sa.portnum",
7844 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7846 { &hf_infiniband_SA_InputPortNum , {
7847 "InputPortNum", "infiniband.sa.inputportnum",
7848 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7850 { &hf_infiniband_SA_OutputPortNum, {
7851 "OutputPortNum", "infiniband.sa.outputportnum",
7852 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7854 { &hf_infiniband_SA_BlockNum_EightBit, {
7855 "BlockNum_EightBit", "infiniband.sa.blocknum_eightbit",
7856 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7858 { &hf_infiniband_SA_BlockNum_NineBit, {
7859 "BlockNum_NineBit", "infiniband.sa.blocknum_ninebit",
7860 FT_UINT16, BASE_HEX, NULL, 0x01FF, NULL, HFILL}
7862 { &hf_infiniband_SA_BlockNum_SixteenBit, {
7863 "BlockNum_SixteenBit", "infiniband.sa.blocknum_sixteenbit",
7864 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7866 { &hf_infiniband_SA_Position, {
7867 "Position", "infiniband.sa.position",
7868 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7870 #if 0
7871 { &hf_infiniband_SA_Index, {
7872 "Index", "infiniband.sa.index",
7873 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7875 #endif
7877 /* InformInfoRecord */
7878 { &hf_infiniband_InformInfoRecord_SubscriberGID, {
7879 "SubscriberGID", "infiniband.informinforecord.subscribergid",
7880 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7882 { &hf_infiniband_InformInfoRecord_Enum, {
7883 "Enum", "infiniband.informinforecord.enum",
7884 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7887 /* InformInfo */
7888 { &hf_infiniband_InformInfo_GID, {
7889 "GID", "infiniband.informinfo.gid",
7890 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7892 { &hf_infiniband_InformInfo_LIDRangeBegin, {
7893 "LIDRangeBegin", "infiniband.informinfo.lidrangebegin",
7894 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7896 { &hf_infiniband_InformInfo_LIDRangeEnd, {
7897 "LIDRangeEnd", "infiniband.informinfo.lidrangeend",
7898 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7900 { &hf_infiniband_InformInfo_IsGeneric, {
7901 "IsGeneric", "infiniband.informinfo.isgeneric",
7902 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7904 { &hf_infiniband_InformInfo_Subscribe, {
7905 "Subscribe", "infiniband.informinfo.subscribe",
7906 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7908 { &hf_infiniband_InformInfo_Type, {
7909 "Type", "infiniband.informinfo.type",
7910 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7912 { &hf_infiniband_InformInfo_TrapNumberDeviceID, {
7913 "TrapNumberDeviceID", "infiniband.informinfo.trapnumberdeviceid",
7914 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7916 { &hf_infiniband_InformInfo_QPN, {
7917 "QPN", "infiniband.informinfo.qpn",
7918 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7920 { &hf_infiniband_InformInfo_RespTimeValue, {
7921 "RespTimeValue", "infiniband.informinfo.resptimevalue",
7922 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7924 { &hf_infiniband_InformInfo_ProducerTypeVendorID, {
7925 "ProducerTypeVendorID", "infiniband.informinfo.producertypevendorid",
7926 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7929 /* LinkRecord */
7930 { &hf_infiniband_LinkRecord_FromLID, {
7931 "FromLID", "infiniband.linkrecord.fromlid",
7932 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7934 { &hf_infiniband_LinkRecord_FromPort, {
7935 "FromPort", "infiniband.linkrecord.fromport",
7936 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7938 { &hf_infiniband_LinkRecord_ToPort, {
7939 "ToPort", "infiniband.linkrecord.toport",
7940 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7942 { &hf_infiniband_LinkRecord_ToLID, {
7943 "ToLID", "infiniband.linkrecord.tolid",
7944 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7947 /* ServiceRecord */
7948 { &hf_infiniband_ServiceRecord_ServiceID, {
7949 "ServiceID", "infiniband.linkrecord.serviceid",
7950 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7952 { &hf_infiniband_ServiceRecord_ServiceGID, {
7953 "ServiceGID", "infiniband.linkrecord.servicegid",
7954 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7956 { &hf_infiniband_ServiceRecord_ServiceP_Key, {
7957 "ServiceP_Key", "infiniband.linkrecord.servicep_key",
7958 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7960 { &hf_infiniband_ServiceRecord_ServiceLease, {
7961 "ServiceLease", "infiniband.linkrecord.servicelease",
7962 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7964 { &hf_infiniband_ServiceRecord_ServiceKey, {
7965 "ServiceKey", "infiniband.linkrecord.servicekey",
7966 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7968 { &hf_infiniband_ServiceRecord_ServiceName, {
7969 "ServiceName", "infiniband.linkrecord.servicename",
7970 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7972 { &hf_infiniband_ServiceRecord_ServiceData, {
7973 "ServiceData", "infiniband.linkrecord.servicedata",
7974 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7977 /* ServiceAssociationRecord */
7978 { &hf_infiniband_ServiceAssociationRecord_ServiceKey, {
7979 "ServiceKey", "infiniband.serviceassociationrecord.servicekey",
7980 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7982 { &hf_infiniband_ServiceAssociationRecord_ServiceName, {
7983 "ServiceName", "infiniband.serviceassociationrecord.servicename",
7984 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
7987 /* PathRecord */
7988 { &hf_infiniband_PathRecord_DGID, {
7989 "DGID", "infiniband.pathrecord.dgid",
7990 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7992 { &hf_infiniband_PathRecord_SGID, {
7993 "SGID", "infiniband.pathrecord.sgid",
7994 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7996 { &hf_infiniband_PathRecord_DLID, {
7997 "DLID", "infiniband.pathrecord.dlid",
7998 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8000 { &hf_infiniband_PathRecord_SLID, {
8001 "SLID", "infiniband.pathrecord.slid",
8002 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8004 { &hf_infiniband_PathRecord_RawTraffic, {
8005 "RawTraffic", "infiniband.pathrecord.rawtraffic",
8006 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8008 { &hf_infiniband_PathRecord_FlowLabel, {
8009 "FlowLabel", "infiniband.pathrecord.flowlabel",
8010 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
8012 { &hf_infiniband_PathRecord_HopLimit, {
8013 "HopLimit", "infiniband.pathrecord.hoplimit",
8014 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8016 { &hf_infiniband_PathRecord_TClass, {
8017 "TClass", "infiniband.pathrecord.tclass",
8018 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8020 { &hf_infiniband_PathRecord_Reversible, {
8021 "Reversible", "infiniband.pathrecord.reversible",
8022 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8024 { &hf_infiniband_PathRecord_NumbPath, {
8025 "NumbPath", "infiniband.pathrecord.numbpath",
8026 FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}
8028 { &hf_infiniband_PathRecord_P_Key, {
8029 "P_Key", "infiniband.pathrecord.p_key",
8030 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8032 { &hf_infiniband_PathRecord_SL, {
8033 "SL", "infiniband.pathrecord.sl",
8034 FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL}
8036 { &hf_infiniband_PathRecord_MTUSelector, {
8037 "MTUSelector", "infiniband.pathrecord.mtuselector",
8038 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8040 { &hf_infiniband_PathRecord_MTU, {
8041 "MTU", "infiniband.pathrecord.mtu",
8042 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8044 { &hf_infiniband_PathRecord_RateSelector, {
8045 "RateSelector", "infiniband.pathrecord.rateselector",
8046 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8048 { &hf_infiniband_PathRecord_Rate, {
8049 "Rate", "infiniband.pathrecord.rate",
8050 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8052 { &hf_infiniband_PathRecord_PacketLifeTimeSelector, {
8053 "PacketLifeTimeSelector", "infiniband.pathrecord.packetlifetimeselector",
8054 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8056 { &hf_infiniband_PathRecord_PacketLifeTime, {
8057 "PacketLifeTime", "infiniband.pathrecord.packetlifetime",
8058 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8060 { &hf_infiniband_PathRecord_Preference, {
8061 "Preference", "infiniband.pathrecord.preference",
8062 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8065 /* MCMemberRecord */
8066 { &hf_infiniband_MCMemberRecord_MGID, {
8067 "MGID", "infiniband.mcmemberrecord.mgid",
8068 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8070 { &hf_infiniband_MCMemberRecord_PortGID, {
8071 "PortGID", "infiniband.mcmemberrecord.portgid",
8072 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8074 { &hf_infiniband_MCMemberRecord_Q_Key, {
8075 "Q_Key", "infiniband.mcmemberrecord.q_key",
8076 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8078 { &hf_infiniband_MCMemberRecord_MLID, {
8079 "MLID", "infiniband.mcmemberrecord.mlid",
8080 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8082 { &hf_infiniband_MCMemberRecord_MTUSelector, {
8083 "MTUSelector", "infiniband.mcmemberrecord.mtuselector",
8084 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8086 { &hf_infiniband_MCMemberRecord_MTU, {
8087 "MTU", "infiniband.mcmemberrecord.mtu",
8088 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8090 { &hf_infiniband_MCMemberRecord_TClass, {
8091 "TClass", "infiniband.mcmemberrecord.tclass",
8092 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8094 { &hf_infiniband_MCMemberRecord_P_Key, {
8095 "P_Key", "infiniband.mcmemberrecord.p_key",
8096 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8098 { &hf_infiniband_MCMemberRecord_RateSelector, {
8099 "RateSelector", "infiniband.mcmemberrecord.rateselector",
8100 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8102 { &hf_infiniband_MCMemberRecord_Rate, {
8103 "Rate", "infiniband.mcmemberrecord.rate",
8104 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8106 { &hf_infiniband_MCMemberRecord_PacketLifeTimeSelector, {
8107 "PacketLifeTimeSelector", "infiniband.mcmemberrecord.packetlifetimeselector",
8108 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8110 { &hf_infiniband_MCMemberRecord_PacketLifeTime, {
8111 "PacketLifeTime", "infiniband.mcmemberrecord.packetlifetime",
8112 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8114 { &hf_infiniband_MCMemberRecord_SL, {
8115 "SL", "infiniband.mcmemberrecord.sl",
8116 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8118 { &hf_infiniband_MCMemberRecord_FlowLabel, {
8119 "FlowLabel", "infiniband.mcmemberrecord.flowlabel",
8120 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
8122 { &hf_infiniband_MCMemberRecord_HopLimit, {
8123 "HopLimit", "infiniband.mcmemberrecord.hoplimit",
8124 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8126 { &hf_infiniband_MCMemberRecord_Scope, {
8127 "Scope", "infiniband.mcmemberrecord.scope",
8128 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8130 { &hf_infiniband_MCMemberRecord_JoinState, {
8131 "JoinState", "infiniband.mcmemberrecord.joinstate",
8132 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
8134 { &hf_infiniband_MCMemberRecord_ProxyJoin, {
8135 "ProxyJoin", "infiniband.mcmemberrecord.proxyjoin",
8136 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8139 /* TraceRecord */
8140 { &hf_infiniband_TraceRecord_GIDPrefix, {
8141 "GidPrefix", "infiniband.tracerecord.gidprefix",
8142 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8144 { &hf_infiniband_TraceRecord_IDGeneration, {
8145 "IDGeneration", "infiniband.tracerecord.idgeneration",
8146 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8148 { &hf_infiniband_TraceRecord_NodeType, {
8149 "NodeType", "infiniband.tracerecord.nodetype",
8150 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8152 { &hf_infiniband_TraceRecord_NodeID, {
8153 "NodeID", "infiniband.tracerecord.nodeid",
8154 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8156 { &hf_infiniband_TraceRecord_ChassisID, {
8157 "ChassisID", "infiniband.tracerecord.chassisid",
8158 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8160 { &hf_infiniband_TraceRecord_EntryPortID, {
8161 "EntryPortID", "infiniband.tracerecord.entryportid",
8162 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8164 { &hf_infiniband_TraceRecord_ExitPortID, {
8165 "ExitPortID", "infiniband.tracerecord.exitportid",
8166 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8168 { &hf_infiniband_TraceRecord_EntryPort, {
8169 "EntryPort", "infiniband.tracerecord.entryport",
8170 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8172 { &hf_infiniband_TraceRecord_ExitPort, {
8173 "ExitPort", "infiniband.tracerecord.exitport",
8174 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8177 /* MultiPathRecord */
8178 { &hf_infiniband_MultiPathRecord_RawTraffic, {
8179 "RawTraffic", "infiniband.multipathrecord.rawtraffic",
8180 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8182 { &hf_infiniband_MultiPathRecord_FlowLabel, {
8183 "FlowLabel", "infiniband.multipathrecord.flowlabel",
8184 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
8186 { &hf_infiniband_MultiPathRecord_HopLimit, {
8187 "HopLimit", "infiniband.multipathrecord.hoplimit",
8188 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8190 { &hf_infiniband_MultiPathRecord_TClass, {
8191 "TClass", "infiniband.multipathrecord.tclass",
8192 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8194 { &hf_infiniband_MultiPathRecord_Reversible, {
8195 "Reversible", "infiniband.multipathrecord.reversible",
8196 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8198 { &hf_infiniband_MultiPathRecord_NumbPath, {
8199 "NumbPath", "infiniband.multipathrecord.numbpath",
8200 FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}
8202 { &hf_infiniband_MultiPathRecord_P_Key, {
8203 "P_Key", "infiniband.multipathrecord.p_key",
8204 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8206 { &hf_infiniband_MultiPathRecord_SL, {
8207 "SL", "infiniband.multipathrecord.sl",
8208 FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL}
8210 { &hf_infiniband_MultiPathRecord_MTUSelector, {
8211 "MTUSelector", "infiniband.multipathrecord.mtuselector",
8212 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8214 { &hf_infiniband_MultiPathRecord_MTU, {
8215 "MTU", "infiniband.multipathrecord.mtu",
8216 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8218 { &hf_infiniband_MultiPathRecord_RateSelector, {
8219 "RateSelector", "infiniband.multipathrecord.rateselector",
8220 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8222 { &hf_infiniband_MultiPathRecord_Rate, {
8223 "Rate", "infiniband.multipathrecord.rate",
8224 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8226 { &hf_infiniband_MultiPathRecord_PacketLifeTimeSelector, {
8227 "PacketLifeTimeSelector", "infiniband.multipathrecord.packetlifetimeselector",
8228 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8230 { &hf_infiniband_MultiPathRecord_PacketLifeTime, {
8231 "PacketLifeTime", "infiniband.multipathrecord.packetlifetime",
8232 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8234 { &hf_infiniband_MultiPathRecord_IndependenceSelector, {
8235 "IndependenceSelector", "infiniband.multipathrecord.independenceselector",
8236 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8238 { &hf_infiniband_MultiPathRecord_GIDScope, {
8239 "GIDScope", "infiniband.multipathrecord.gidscope",
8240 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8242 { &hf_infiniband_MultiPathRecord_SGIDCount, {
8243 "SGIDCount", "infiniband.multipathrecord.sgidcount",
8244 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8246 { &hf_infiniband_MultiPathRecord_DGIDCount, {
8247 "DGIDCount", "infiniband.multipathrecord.dgidcount",
8248 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8250 { &hf_infiniband_MultiPathRecord_SDGID, {
8251 "SDGID", "infiniband.multipathrecord.sdgid",
8252 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8255 /* ClassPortInfo */
8256 { &hf_infiniband_ClassPortInfo_BaseVersion, {
8257 "BaseVersion", "infiniband.classportinfo.baseversion",
8258 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8260 { &hf_infiniband_ClassPortInfo_ClassVersion, {
8261 "ClassVersion", "infiniband.classportinfo.classversion",
8262 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8264 { &hf_infiniband_ClassPortInfo_CapabilityMask, {
8265 "CapabilityMask", "infiniband.classportinfo.capabilitymask",
8266 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8268 { &hf_infiniband_ClassPortInfo_CapabilityMask2, {
8269 "CapabilityMask2", "infiniband.classportinfo.capabilitymask2",
8270 FT_UINT32, BASE_HEX, NULL, 0xFFFFFFE0, NULL, HFILL}
8272 { &hf_infiniband_ClassPortInfo_RespTimeValue, {
8273 "RespTimeValue", "infiniband.classportinfo.resptimevalue",
8274 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
8276 { &hf_infiniband_ClassPortInfo_RedirectGID, {
8277 "RedirectGID", "infiniband.classportinfo.redirectgid",
8278 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8280 { &hf_infiniband_ClassPortInfo_RedirectTC, {
8281 "RedirectTC", "infiniband.classportinfo.redirecttc",
8282 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8284 { &hf_infiniband_ClassPortInfo_RedirectSL, {
8285 "RedirectSL", "infiniband.classportinfo.redirectsl",
8286 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8288 { &hf_infiniband_ClassPortInfo_RedirectFL, {
8289 "RedirectFL", "infiniband.classportinfo.redirectfl",
8290 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
8292 { &hf_infiniband_ClassPortInfo_RedirectLID, {
8293 "RedirectLID", "infiniband.classportinfo.redirectlid",
8294 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8296 { &hf_infiniband_ClassPortInfo_RedirectP_Key, {
8297 "RedirectP_Key", "infiniband.classportinfo.redirectpkey",
8298 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8300 { &hf_infiniband_ClassPortInfo_Reserved, {
8301 "Reserved", "infiniband.classportinfo.reserved",
8302 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8304 { &hf_infiniband_ClassPortInfo_RedirectQP, {
8305 "RedirectQP", "infiniband.classportinfo.redirectqp",
8306 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8308 { &hf_infiniband_ClassPortInfo_RedirectQ_Key, {
8309 "RedirectQ_Key", "infiniband.classportinfo.redirectqkey",
8310 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8312 { &hf_infiniband_ClassPortInfo_TrapGID, {
8313 "TrapGID", "infiniband.classportinfo.trapgid",
8314 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8316 { &hf_infiniband_ClassPortInfo_TrapTC, {
8317 "TrapTC", "infiniband.classportinfo.traptc",
8318 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8320 { &hf_infiniband_ClassPortInfo_TrapSL, {
8321 "TrapSL", "infiniband.classportinfo.trapsl",
8322 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8324 { &hf_infiniband_ClassPortInfo_TrapFL, {
8325 "TrapFL", "infiniband.classportinfo.trapfl",
8326 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
8328 { &hf_infiniband_ClassPortInfo_TrapLID, {
8329 "TrapLID", "infiniband.classportinfo.traplid",
8330 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8332 { &hf_infiniband_ClassPortInfo_TrapP_Key, {
8333 "TrapP_Key", "infiniband.classportinfo.trappkey",
8334 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8336 { &hf_infiniband_ClassPortInfo_TrapQP, {
8337 "TrapQP", "infiniband.classportinfo.trapqp",
8338 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8340 { &hf_infiniband_ClassPortInfo_TrapQ_Key, {
8341 "TrapQ_Key", "infiniband.classportinfo.trapqkey",
8342 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8345 /* Notice */
8346 { &hf_infiniband_Notice_IsGeneric, {
8347 "IsGeneric", "infiniband.notice.isgeneric",
8348 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8350 { &hf_infiniband_Notice_Type, {
8351 "Type", "infiniband.notice.type",
8352 FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}
8354 { &hf_infiniband_Notice_ProducerTypeVendorID, {
8355 "ProducerTypeVendorID", "infiniband.notice.producertypevendorid",
8356 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8358 { &hf_infiniband_Notice_TrapNumberDeviceID, {
8359 "TrapNumberDeviceID", "infiniband.notice.trapnumberdeviceid",
8360 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8362 { &hf_infiniband_Notice_IssuerLID, {
8363 "IssuerLID", "infiniband.notice.issuerlid",
8364 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8366 { &hf_infiniband_Notice_NoticeToggle, {
8367 "NoticeToggle", "infiniband.notice.noticetoggle",
8368 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8370 { &hf_infiniband_Notice_NoticeCount, {
8371 "NoticeCount", "infiniband.notice.noticecount",
8372 FT_UINT16, BASE_HEX, NULL, 0x7FFF, NULL, HFILL}
8374 { &hf_infiniband_Notice_DataDetails, {
8375 "DataDetails", "infiniband.notice.datadetails",
8376 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8378 #if 0
8379 { &hf_infiniband_Notice_IssuerGID, {
8380 "IssuerGID", "infiniband.notice.issuergid",
8381 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8383 { &hf_infiniband_Notice_ClassTrapSpecificData, {
8384 "ClassTrapSpecificData", "infiniband.notice.classtrapspecificdata",
8385 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8387 #endif
8389 /* Traps 64,65,66,67 */
8390 { &hf_infiniband_Trap_GIDADDR, {
8391 "GIDADDR", "infiniband.trap.gidaddr",
8392 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8394 /* Traps 68,69 */
8395 { &hf_infiniband_Trap_COMP_MASK, {
8396 "COMP_MASK", "infiniband.trap.comp_mask",
8397 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8399 { &hf_infiniband_Trap_WAIT_FOR_REPATH, {
8400 "WAIT_FOR_REPATH", "infiniband.trap.wait_for_repath",
8401 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8403 #if 0
8404 { &hf_infiniband_Trap_PATH_REC, {
8405 "PATH_REC", "infiniband.trap.path_rec",
8406 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8408 #endif
8410 /* Trap 128 */
8411 { &hf_infiniband_Trap_LIDADDR, {
8412 "LIDADDR", "infiniband.trap.lidaddr",
8413 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8416 /* Trap 129, 130, 131 */
8417 { &hf_infiniband_Trap_PORTNO, {
8418 "PORTNO", "infiniband.trap.portno",
8419 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8422 /* Trap 144 */
8423 { &hf_infiniband_Trap_OtherLocalChanges, {
8424 "OtherLocalChanges", "infiniband.trap.otherlocalchanges",
8425 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
8427 { &hf_infiniband_Trap_CAPABILITYMASK, {
8428 "CAPABILITYMASK", "infiniband.trap.capabilitymask",
8429 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8431 { &hf_infiniband_Trap_LinkSpeecEnabledChange, {
8432 "LinkSpeecEnabledChange", "infiniband.trap.linkspeecenabledchange",
8433 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL}
8435 { &hf_infiniband_Trap_LinkWidthEnabledChange, {
8436 "LinkWidthEnabledChange", "infiniband.trap.linkwidthenabledchange",
8437 FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}
8439 { &hf_infiniband_Trap_NodeDescriptionChange, {
8440 "NodeDescriptionChange", "infiniband.trap.nodedescriptionchange",
8441 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
8444 /* Trap 145 */
8445 { &hf_infiniband_Trap_SYSTEMIMAGEGUID, {
8446 "SYSTEMIMAGEGUID", "infiniband.trap.systemimageguid",
8447 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8450 /* Trap 256 */
8451 { &hf_infiniband_Trap_DRSLID, {
8452 "DRSLID", "infiniband.trap.drslid",
8453 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8455 { &hf_infiniband_Trap_METHOD, {
8456 "METHOD", "infiniband.trap.method",
8457 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8459 { &hf_infiniband_Trap_ATTRIBUTEID, {
8460 "ATTRIBUTEID", "infiniband.trap.attributeid",
8461 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8463 { &hf_infiniband_Trap_ATTRIBUTEMODIFIER, {
8464 "ATTRIBUTEMODIFIER", "infiniband.trap.attributemodifier",
8465 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8467 { &hf_infiniband_Trap_MKEY, {
8468 "MKEY", "infiniband.trap.mkey",
8469 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8471 { &hf_infiniband_Trap_DRNotice, {
8472 "DRNotice", "infiniband.trap.drnotice",
8473 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8475 { &hf_infiniband_Trap_DRPathTruncated, {
8476 "DRPathTruncated", "infiniband.trap.drpathtruncated",
8477 FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL}
8479 { &hf_infiniband_Trap_DRHopCount, {
8480 "DRHopCount", "infiniband.trap.drhopcount",
8481 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8483 { &hf_infiniband_Trap_DRNoticeReturnPath, {
8484 "DRNoticeReturnPath", "infiniband.trap.drnoticereturnpath",
8485 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8488 /* Trap 257, 258 */
8489 { &hf_infiniband_Trap_LIDADDR1, {
8490 "LIDADDR1", "infiniband.trap.lidaddr1",
8491 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8493 { &hf_infiniband_Trap_LIDADDR2, {
8494 "LIDADDR2", "infiniband.trap.lidaddr2",
8495 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8497 { &hf_infiniband_Trap_KEY, {
8498 "KEY", "infiniband.trap.key",
8499 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8501 { &hf_infiniband_Trap_SL, {
8502 "SL", "infiniband.trap.sl",
8503 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8505 { &hf_infiniband_Trap_QP1, {
8506 "QP1", "infiniband.trap.qp1",
8507 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8509 { &hf_infiniband_Trap_QP2, {
8510 "QP2", "infiniband.trap.qp2",
8511 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8513 { &hf_infiniband_Trap_GIDADDR1, {
8514 "GIDADDR1", "infiniband.trap.gidaddr1",
8515 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8517 { &hf_infiniband_Trap_GIDADDR2, {
8518 "GIDADDR2", "infiniband.trap.gidaddr2",
8519 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8522 /* Trap 259 */
8523 { &hf_infiniband_Trap_DataValid, {
8524 "DataValid", "infiniband.trap.datavalid",
8525 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8527 { &hf_infiniband_Trap_PKEY, {
8528 "PKEY", "infiniband.trap.pkey",
8529 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8531 { &hf_infiniband_Trap_SWLIDADDR, {
8532 "SWLIDADDR", "infiniband.trap.swlidaddr",
8533 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8535 /* ClassPortInfo in Performance class */
8536 { &hf_infiniband_PerfMgt_ClassPortInfo, {
8537 "ClassPortInfo (Performance Management MAD)", "infiniband.classportinfo",
8538 FT_NONE, BASE_NONE, NULL, 0x0,
8539 "Performance class ClassPortInfo packet", HFILL}
8541 /* PortCounters in Performance class */
8542 { &hf_infiniband_PortCounters, {
8543 "Port Counters (Performance Management MAD)", "infiniband.portcounters",
8544 FT_NONE, BASE_NONE, NULL, 0x0,
8545 "Performance class PortCounters packet", HFILL}
8547 { &hf_infiniband_PortCounters_PortSelect, {
8548 "PortSelect", "infiniband.portcounters.portselect",
8549 FT_UINT8, BASE_HEX, NULL, 0x0,
8550 "Selects the port that will be accessed", HFILL}
8552 { &hf_infiniband_PortCounters_CounterSelect, {
8553 "CounterSelect", "infiniband.portcounters.counterselect",
8554 FT_UINT16, BASE_HEX, NULL, 0x0,
8555 "When writing, selects which counters are affected by the operation", HFILL}
8557 { &hf_infiniband_PortCounters_SymbolErrorCounter, {
8558 "SymbolErrorCounter", "infiniband.portcounters.symbolerrorcounter",
8559 FT_UINT16, BASE_DEC, NULL, 0x0,
8560 "Total number of minor link errors", HFILL}
8562 { &hf_infiniband_PortCounters_LinkErrorRecoveryCounter, {
8563 "LinkErrorRecoveryCounter", "infiniband.portcounters.linkerrorrecoverycounter",
8564 FT_UINT8, BASE_DEC, NULL, 0x0,
8565 "Total number of times successfully completed link error recovery process", HFILL}
8567 { &hf_infiniband_PortCounters_LinkDownedCounter, {
8568 "LinkDownedCounter", "infiniband.portcounters.linkdownedcounter",
8569 FT_UINT8, BASE_DEC, NULL, 0x0,
8570 "Total number of times failed link error recovery process", HFILL}
8572 { &hf_infiniband_PortCounters_PortRcvErrors, {
8573 "PortRcvErrors", "infiniband.portcounters.portrcverrors",
8574 FT_UINT16, BASE_DEC, NULL, 0x0,
8575 "Total number of packets containing an error received", HFILL}
8577 { &hf_infiniband_PortCounters_PortRcvRemotePhysicalErrors, {
8578 "PortRcvRemotePhysicalErrors", "infiniband.portcounters.portrcvremotephysicalerrors",
8579 FT_UINT16, BASE_DEC, NULL, 0x0,
8580 "Total number of packets marked with EBP delimiter received", HFILL}
8582 { &hf_infiniband_PortCounters_PortRcvSwitchRelayErrors, {
8583 "PortRcvSwitchRelayErrors", "infiniband.portcounters.portrcvswitchrelayerrors",
8584 FT_UINT16, BASE_DEC, NULL, 0x0,
8585 "Total number of packets discarded because they could not be forwarded by switch relay",
8586 HFILL}
8588 { &hf_infiniband_PortCounters_PortXmitDiscards, {
8589 "PortXmitDiscards", "infiniband.portcounters.portxmitdiscards",
8590 FT_UINT16, BASE_DEC, NULL, 0x0,
8591 "Total number of outbound packets discarded", HFILL}
8593 { &hf_infiniband_PortCounters_PortXmitConstraintErrors, {
8594 "PortXmitConstraintErrors", "infiniband.portcounters.portxmitconstrainterrors",
8595 FT_UINT8, BASE_DEC, NULL, 0x0,
8596 "Total number of packets not transmitted from the switch physical port", HFILL}
8598 { &hf_infiniband_PortCounters_PortRcvConstraintErrors, {
8599 "PortRcvConstraintErrors", "infiniband.portcounters.portrcvconstrainterrors",
8600 FT_UINT8, BASE_DEC, NULL, 0x0,
8601 "Total number of packets received on the switch physical port that are discarded", HFILL}
8603 { &hf_infiniband_PortCounters_LocalLinkIntegrityErrors, {
8604 "LocalLinkIntegrityErrors", "infiniband.portcounters.locallinkintegrityerrors",
8605 FT_UINT8, BASE_DEC, NULL, 0x0,
8606 "The number of times the count of local physical errors exceeded the threshold specified by LocalPhyErrors",
8607 HFILL}
8609 { &hf_infiniband_PortCounters_ExcessiveBufferOverrunErrors, {
8610 "ExcessiveBufferOverrunErrors", "infiniband.portcounters.excessivebufferoverrunerrors",
8611 FT_UINT8, BASE_DEC, NULL, 0x0,
8612 "The number of times that OverrunErrors consecutive flow control update periods occurred",
8613 HFILL}
8615 { &hf_infiniband_PortCounters_VL15Dropped, {
8616 "VL15Dropped", "infiniband.portcounters.vl15dropped",
8617 FT_UINT16, BASE_DEC, NULL, 0x0,
8618 "Number of incoming VL15 packets dropped", HFILL}
8620 { &hf_infiniband_PortCounters_PortXmitData, {
8621 "PortXmitData", "infiniband.portcounters.portxmitdata",
8622 FT_UINT32, BASE_DEC, NULL, 0x0,
8623 "Total number of data octets, divided by 4, transmitted on all VLs from the port", HFILL}
8625 { &hf_infiniband_PortCounters_PortRcvData, {
8626 "PortRcvData", "infiniband.portcounters.portrcvdata",
8627 FT_UINT32, BASE_DEC, NULL, 0x0,
8628 "Total number of data octets, divided by 4, received on all VLs at the port", HFILL}
8630 { &hf_infiniband_PortCounters_PortXmitPkts, {
8631 "PortXmitPkts", "infiniband.portcounters.portxmitpkts",
8632 FT_UINT32, BASE_DEC, NULL, 0x0,
8633 "Total number of packets transmitted on all VLs from the port", HFILL}
8635 { &hf_infiniband_PortCounters_PortRcvPkts, {
8636 "PortRcvPkts", "infiniband.portcounters.portrcvpkts",
8637 FT_UINT32, BASE_DEC, NULL, 0x0,
8638 "Total number of packets received from all VLs on the port", HFILL}
8640 /* PortCountersExtended in Performance class */
8641 { &hf_infiniband_PortCountersExt, {
8642 "Port Counters Extended (Performance Management MAD)", "infiniband.portcounters_ext",
8643 FT_NONE, BASE_NONE, NULL, 0x0,
8644 "Performance class PortCountersExtended packet", HFILL}
8646 { &hf_infiniband_PortCountersExt_PortSelect, {
8647 "PortSelect", "infiniband.portcounters_ext.portselect",
8648 FT_UINT8, BASE_HEX, NULL, 0x0,
8649 "Selects the port that will be accessed", HFILL}
8651 { &hf_infiniband_PortCountersExt_CounterSelect, {
8652 "CounterSelect", "infiniband.portcounters_ext.counterselect",
8653 FT_UINT16, BASE_HEX, NULL, 0x0,
8654 "When writing, selects which counters are affected by the operation", HFILL}
8656 { &hf_infiniband_PortCountersExt_PortXmitData, {
8657 "PortXmitData", "infiniband.portcounters_ext.portxmitdata",
8658 FT_UINT64, BASE_DEC, NULL, 0x0,
8659 "Total number of data octets, divided by 4, transmitted on all VLs from the port", HFILL}
8661 { &hf_infiniband_PortCountersExt_PortRcvData, {
8662 "PortRcvData", "infiniband.portcounters_ext.portrcvdata",
8663 FT_UINT64, BASE_DEC, NULL, 0x0,
8664 "Total number of data octets, divided by 4, received on all VLs at the port", HFILL}
8666 { &hf_infiniband_PortCountersExt_PortXmitPkts, {
8667 "PortXmitPkts", "infiniband.portcounters_ext.portxmitpkts",
8668 FT_UINT64, BASE_DEC, NULL, 0x0,
8669 "Total number of packets transmitted on all VLs from the port", HFILL}
8671 { &hf_infiniband_PortCountersExt_PortRcvPkts, {
8672 "PortRcvPkts", "infiniband.portcounters_ext.portrcvpkts",
8673 FT_UINT64, BASE_DEC, NULL, 0x0,
8674 "Total number of packets received from all VLs on the port", HFILL}
8676 { &hf_infiniband_PortCountersExt_PortUnicastXmitPkts, {
8677 "PortUnicastXmitPkts", "infiniband.portcounters_ext.portunicastxmitpkts",
8678 FT_UINT64, BASE_DEC, NULL, 0x0,
8679 "Total number of unicast packets transmitted on all VLs from the port", HFILL}
8681 { &hf_infiniband_PortCountersExt_PortUnicastRcvPkts, {
8682 "PortUnicastRcvPkts", "infiniband.portcounters_ext.portunicastrcvpkts",
8683 FT_UINT64, BASE_DEC, NULL, 0x0,
8684 "Total number of unicast packets received from all VLs on the port", HFILL}
8686 { &hf_infiniband_PortCountersExt_PortMulticastXmitPkts, {
8687 "PortMulticastXmitPkts", "infiniband.portcounters_ext.portmulticastxmitpkts",
8688 FT_UINT64, BASE_DEC, NULL, 0x0,
8689 "Total number of multicast packets transmitted on all VLs from the port", HFILL}
8691 { &hf_infiniband_PortCountersExt_PortMulticastRcvPkts, {
8692 "PortMulticastRcvPkts", "infiniband.portcounters_ext.portmulticastrcvpkts",
8693 FT_UINT64, BASE_DEC, NULL, 0x0,
8694 "Total number of multicast packets received from all VLs on the port", HFILL}
8698 /* Array to hold expansion options between dissections */
8699 static int *ett[] = {
8700 /* &ett_infiniband, */
8701 &ett_all_headers,
8702 &ett_lrh,
8703 &ett_grh,
8704 &ett_bth,
8705 &ett_rwh,
8706 &ett_rdeth,
8707 &ett_deth,
8708 &ett_reth,
8709 &ett_atomiceth,
8710 &ett_aeth,
8711 &ett_aeth_syndrome,
8712 &ett_atomicacketh,
8713 &ett_immdt,
8714 &ett_ieth,
8715 &ett_payload,
8716 &ett_vendor,
8717 &ett_subn_lid_routed,
8718 &ett_subn_directed_route,
8719 &ett_subnadmin,
8720 &ett_cm,
8721 &ett_cm_sid,
8722 &ett_cm_ipcm,
8723 &ett_mad,
8724 &ett_rmpp,
8725 &ett_subm_attribute,
8726 &ett_suba_attribute,
8727 &ett_datadetails,
8728 &ett_noticestraps,
8729 /* &ett_nodedesc, */
8730 /* &ett_nodeinfo, */
8731 /* &ett_switchinfo, */
8732 /* &ett_guidinfo, */
8733 /* &ett_portinfo, */
8734 &ett_portinfo_capmask,
8735 &ett_pkeytable,
8736 &ett_sltovlmapping,
8737 &ett_vlarbitrationtable,
8738 &ett_linearforwardingtable,
8739 &ett_randomforwardingtable,
8740 &ett_multicastforwardingtable,
8741 &ett_sminfo,
8742 &ett_vendordiag,
8743 &ett_ledinfo,
8744 &ett_linkspeedwidthpairs,
8745 &ett_informinfo,
8746 &ett_linkrecord,
8747 &ett_servicerecord,
8748 &ett_pathrecord,
8749 &ett_mcmemberrecord,
8750 &ett_tracerecord,
8751 &ett_multipathrecord,
8752 &ett_serviceassocrecord,
8753 &ett_perfclass,
8756 static hf_register_info hf_link[] = {
8757 { &hf_infiniband_link_op, {
8758 "Operand", "infiniband_link.op",
8759 FT_UINT16, BASE_DEC, VALS(Operand_Description), 0xF000, NULL, HFILL}
8761 { &hf_infiniband_link_fctbs, {
8762 "Flow Control Total Blocks Sent", "infiniband_link.fctbs",
8763 FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL}
8765 { &hf_infiniband_link_vl, {
8766 "Virtual Lane", "infiniband_link.vl",
8767 FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL}
8769 { &hf_infiniband_link_fccl, {
8770 "Flow Control Credit Limit", "infiniband_link.fccl",
8771 FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL}
8773 { &hf_infiniband_link_lpcrc, {
8774 "Link Packet CRC", "infiniband_link.lpcrc",
8775 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}
8779 static int *ett_link_array[] = {
8780 &ett_link
8783 static hf_register_info hf_eoib[] = {
8784 /* Mellanox EoIB encapsulation header */
8785 { &hf_infiniband_ver, {
8786 "Version", "infiniband.eoib.version",
8787 FT_UINT16, BASE_HEX, NULL, MELLANOX_VERSION_FLAG, NULL, HFILL}
8789 { &hf_infiniband_tcp_chk, {
8790 "TCP Checksum", "infiniband.eoib.tcp_chk",
8791 FT_UINT16, BASE_HEX, NULL, MELLANOX_TCP_CHECKSUM_FLAG, NULL, HFILL}
8793 { &hf_infiniband_ip_chk, {
8794 "IP Checksum", "infiniband.eoib.ip_chk",
8795 FT_UINT16, BASE_HEX, NULL, MELLANOX_IP_CHECKSUM_FLAG, NULL, HFILL}
8797 { &hf_infiniband_fcs, {
8798 "FCS Field Present", "infiniband.eoib.fcs",
8799 FT_BOOLEAN, 16, NULL, MELLANOX_FCS_PRESENT_FLAG, NULL, HFILL}
8801 { &hf_infiniband_ms, {
8802 "More Segments to Follow", "infiniband.eoib.ms",
8803 FT_BOOLEAN, 16, NULL, MELLANOX_MORE_SEGMENT_FLAG, NULL, HFILL}
8805 { &hf_infiniband_seg_off, {
8806 "Segment Offset", "infiniband.eoib.ip_seg_offset",
8807 FT_UINT16, BASE_DEC, NULL, MELLANOX_SEGMENT_FLAG, NULL, HFILL}
8809 { &hf_infiniband_seg_id, {
8810 "Segment ID", "infiniband.eoib.ip_seg_id",
8811 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
8815 static int *ett_eoib_array[] = {
8816 &ett_eoib
8819 proto_infiniband = proto_register_protocol("InfiniBand", "IB", "infiniband");
8820 ib_handle = register_dissector("infiniband", dissect_infiniband, proto_infiniband);
8822 proto_register_field_array(proto_infiniband, hf, array_length(hf));
8823 proto_register_subtree_array(ett, array_length(ett));
8825 /* register the subdissector tables */
8826 heur_dissectors_payload = register_heur_dissector_list_with_description("infiniband.payload", "InfiniBand payload", proto_infiniband);
8827 heur_dissectors_cm_private = register_heur_dissector_list_with_description("infiniband.mad.cm.private", "InfiniBand CM private data", proto_infiniband);
8829 /* register dissection preferences */
8830 infiniband_module = prefs_register_protocol(proto_infiniband, proto_reg_handoff_infiniband);
8832 prefs_register_obsolete_preference(infiniband_module, "identify_payload");
8833 prefs_register_obsolete_preference(infiniband_module, "dissect_eoib");
8834 prefs_register_uint_preference(infiniband_module, "rroce.port", "RRoce UDP Port",
8835 "The UDP port for RROCE messages (default " G_STRINGIFY(DEFAULT_RROCE_UDP_PORT) ")",
8836 10, &pref_rroce_udp_port);
8837 prefs_register_bool_preference(infiniband_module, "try_heuristic_first",
8838 "Try heuristic sub-dissectors first",
8839 "Try to decode a packet using an heuristic sub-dissector before using Decode As",
8840 &try_heuristic_first);
8842 proto_infiniband_link = proto_register_protocol("InfiniBand Link", "InfiniBand Link", "infiniband_link");
8843 ib_link_handle = register_dissector("infiniband_link", dissect_infiniband_link, proto_infiniband_link);
8845 proto_register_field_array(proto_infiniband_link, hf_link, array_length(hf_link));
8846 proto_register_subtree_array(ett_link_array, array_length(ett_link_array));
8848 proto_mellanox_eoib = proto_register_protocol("Mellanox EoIB Encapsulation Header", "Mellanox EoIB", "infiniband.eoib");
8849 proto_register_field_array(proto_infiniband, hf_eoib, array_length(hf_eoib));
8850 proto_register_subtree_array(ett_eoib_array, array_length(ett_eoib_array));
8852 /* initialize the hash table */
8853 CM_context_table = g_hash_table_new_full(g_int64_hash, g_int64_equal,
8854 table_destroy_notify, table_destroy_notify);
8856 subdissector_table = register_decode_as_next_proto(proto_infiniband, "infiniband", "Infiniband Payload",
8857 infiniband_payload_prompt);
8859 register_shutdown_routine(infiniband_shutdown);
8862 /* Reg Handoff. Register dissectors we'll need for IPoIB and RoCE */
8863 void proto_reg_handoff_infiniband(void)
8865 static bool initialized = false;
8866 static unsigned prev_rroce_udp_port;
8867 static dissector_handle_t rroce_handle;
8869 if (!initialized)
8871 dissector_handle_t roce_handle;
8872 int proto_ethertype;
8874 ipv6_handle = find_dissector_add_dependency("ipv6", proto_infiniband);
8877 * I haven't found an official spec for EoIB, but slide 10
8878 * of
8880 * http://downloads.openfabrics.org/Media/Sonoma2009/Sonoma_2009_Tues_converged-net-bridging.pdf
8882 * shows the "Eth Payload" following the "Eth Header" and optional
8883 * "Vlan tag", and doesn't show an FCS; "Payload" generally
8884 * refers to the data transported by the protocol, which wouldn't
8885 * include the FCS.
8887 * In addition, the capture attached to bug 5061 includes no
8888 * Ethernet FCS.
8890 * So we assume the Ethernet frames carried by EoIB don't include
8891 * the Ethernet FCS.
8893 eth_handle = find_dissector("eth_withoutfcs");
8894 ethertype_dissector_table = find_dissector_table("ethertype");
8896 /* announce an anonymous Infiniband dissector */
8897 dissector_add_uint("erf.types.type", ERF_TYPE_INFINIBAND, ib_handle);
8899 /* announce an anonymous Infiniband dissector */
8900 dissector_add_uint("erf.types.type", ERF_TYPE_INFINIBAND_LINK, ib_link_handle);
8902 /* create and announce an anonymous RoCE dissector */
8903 roce_handle = create_dissector_handle(dissect_roce, proto_infiniband);
8904 dissector_add_uint("ethertype", ETHERTYPE_ROCE, roce_handle);
8906 /* create and announce an anonymous RRoCE dissector */
8907 rroce_handle = create_dissector_handle(dissect_rroce, proto_infiniband);
8909 /* RROCE over IPv4 isn't standardized but it's been seen in the wild */
8910 dissector_add_for_decode_as("ip.proto", rroce_handle);
8912 dissector_add_uint("wtap_encap", WTAP_ENCAP_INFINIBAND, ib_handle);
8913 heur_dissector_add("infiniband.payload", dissect_mellanox_eoib, "Mellanox EoIB", "mellanox_eoib", proto_mellanox_eoib, HEURISTIC_ENABLE);
8915 /* This could be put in the ethernet dissector file, but since there are a few Infiniband fields in the encapsulation,
8916 keep the dissector here, but associate it with ethernet */
8917 proto_ethertype = proto_get_id_by_filter_name("ethertype");
8918 heur_dissector_add("infiniband.payload", dissect_eth_over_ib, "Ethernet over IB", "eth_over_ib", proto_ethertype, HEURISTIC_ENABLE);
8920 initialized = true;
8922 else
8924 dissector_delete_uint("udp.port", prev_rroce_udp_port, rroce_handle);
8926 /* We are saving the previous value of rroce udp port so we will be able to remove the dissector
8927 * the next time user pref is updated and we get called back to proto_reg_handoff_infiniband.
8928 * "Auto" preference not used because port isn't for the Infiniband protocol itself.
8930 prev_rroce_udp_port = pref_rroce_udp_port;
8931 dissector_add_uint("udp.port", pref_rroce_udp_port, rroce_handle);
8935 * Editor modelines - https://www.wireshark.org/tools/modelines.html
8937 * Local variables:
8938 * c-basic-offset: 4
8939 * tab-width: 8
8940 * indent-tabs-mode: nil
8941 * End:
8943 * vi: set shiftwidth=4 tabstop=8 expandtab:
8944 * :indentSize=4:tabSize=8:noTabs=true: