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
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.h>
25 #include "packet-infiniband.h"
27 void proto_register_infiniband(void);
28 void proto_reg_handoff_infiniband(void);
30 /*Default RRoce UDP port*/
31 #define DEFAULT_RROCE_UDP_PORT 4791
33 /* service id prefix 0x0000000001 is designated for
34 * RDMA IP CM service as per Annex A11.2
36 #define RDMA_IP_CM_SID_PREFIX_MASK 0xFFFFFFFFFF000000
37 #define RDMA_IP_CM_SID_PREFIX 0x0000000001000000
40 static int proto_infiniband = -1;
41 static int proto_infiniband_link = -1;
43 /* Variables to hold expansion values between packets */
44 /* static gint ett_infiniband = -1; */
45 static gint ett_all_headers = -1;
46 static gint ett_lrh = -1;
47 static gint ett_grh = -1;
48 static gint ett_bth = -1;
49 static gint ett_rwh = -1;
50 static gint ett_rdeth = -1;
51 static gint ett_deth = -1;
52 static gint ett_reth = -1;
53 static gint ett_atomiceth = -1;
54 static gint ett_aeth = -1;
55 static gint ett_aeth_syndrome = -1;
56 static gint ett_atomicacketh = -1;
57 static gint ett_immdt = -1;
58 static gint ett_ieth = -1;
59 static gint ett_payload = -1;
60 static gint ett_vendor = -1;
61 static gint ett_subn_lid_routed = -1;
62 static gint ett_subn_directed_route = -1;
63 static gint ett_subnadmin = -1;
64 static gint ett_mad = -1;
65 static gint ett_cm = -1;
66 static gint ett_cm_sid = -1;
67 static gint ett_cm_ipcm = -1;
68 static gint ett_rmpp = -1;
69 static gint ett_subm_attribute = -1;
70 static gint ett_suba_attribute = -1;
71 static gint ett_datadetails = -1;
72 static gint ett_noticestraps = -1;
73 /* static gint ett_nodedesc = -1; */
74 /* static gint ett_nodeinfo = -1; */
75 /* static gint ett_switchinfo = -1; */
76 /* static gint ett_guidinfo = -1; */
77 /* static gint ett_portinfo = -1; */
78 static gint ett_portinfo_capmask = -1;
79 static gint ett_pkeytable = -1;
80 static gint ett_sltovlmapping = -1;
81 static gint ett_vlarbitrationtable = -1;
82 static gint ett_linearforwardingtable = -1;
83 static gint ett_randomforwardingtable = -1;
84 static gint ett_multicastforwardingtable = -1;
85 static gint ett_sminfo = -1;
86 static gint ett_vendordiag = -1;
87 static gint ett_ledinfo = -1;
88 static gint ett_linkspeedwidthpairs = -1;
89 static gint ett_informinfo = -1;
90 static gint ett_linkrecord = -1;
91 static gint ett_servicerecord = -1;
92 static gint ett_pathrecord = -1;
93 static gint ett_mcmemberrecord = -1;
94 static gint ett_tracerecord = -1;
95 static gint ett_multipathrecord = -1;
96 static gint ett_serviceassocrecord = -1;
97 static gint ett_perfclass = -1;
98 static gint ett_link = -1;
100 /* Dissector Declaration */
101 static dissector_handle_t ib_handle;
102 static dissector_handle_t ib_link_handle;
104 /* Subdissectors Declarations */
105 static dissector_handle_t ipv6_handle;
106 static dissector_handle_t eth_handle;
107 static dissector_table_t ethertype_dissector_table;
109 static dissector_table_t subdissector_table;
112 * Structure to hold information from the common MAD header.
113 * This is necessary because the MAD header contains information which significantly changes the dissection algorithm. */
115 guint8 managementClass;
119 guint16 classSpecific;
120 guint64 transactionID;
122 guint32 attributeModifier;
123 char data[MAD_DATA_SIZE];
127 IB_PACKET_STARTS_WITH_LRH, /* Regular IB packet */
128 IB_PACKET_STARTS_WITH_GRH, /* ROCE packet */
129 IB_PACKET_STARTS_WITH_BTH /* RROCE packet */
130 } ib_packet_start_header;
132 /* Forward-declarations */
134 static void dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ib_packet_start_header starts_with);
135 static gint32 find_next_header_sequence(struct infinibandinfo* ibInfo);
136 static gboolean contains(guint32 value, guint32* arr, int length);
137 static void dissect_general_info(tvbuff_t *tvb, gint offset, packet_info *pinfo, ib_packet_start_header starts_with);
139 /* Parsing Methods for specific IB headers. */
141 static void parse_VENDOR(proto_tree *, tvbuff_t *, gint *);
142 static void parse_PAYLOAD(proto_tree *, packet_info *, struct infinibandinfo *, tvbuff_t *, gint *, gint length, gint crclen, proto_tree *);
143 static void parse_IETH(proto_tree *, tvbuff_t *, gint *);
144 static void parse_IMMDT(proto_tree *, tvbuff_t *, gint *offset);
145 static void parse_ATOMICACKETH(proto_tree *, tvbuff_t *, gint *offset);
146 static void parse_AETH(proto_tree *, tvbuff_t *, gint *offset);
147 static void parse_ATOMICETH(proto_tree *, tvbuff_t *, gint *offset);
148 static void parse_RETH(proto_tree *, tvbuff_t *, gint *offset,
149 struct infinibandinfo *info);
150 static void parse_DETH(proto_tree *, packet_info *, tvbuff_t *, gint *offset);
151 static void parse_RDETH(proto_tree *, tvbuff_t *, gint *offset);
152 static void parse_IPvSix(proto_tree *, tvbuff_t *, gint *offset, packet_info *);
153 static void parse_RWH(proto_tree *, tvbuff_t *, gint *offset, packet_info *, proto_tree *);
154 static void parse_DCCETH(proto_tree *parentTree, tvbuff_t *tvb, gint *offset);
156 static void parse_SUBN_LID_ROUTED(proto_tree *, packet_info *, tvbuff_t *, gint *offset);
157 static void parse_SUBN_DIRECTED_ROUTE(proto_tree *, packet_info *, tvbuff_t *, gint *offset);
158 static void parse_SUBNADMN(proto_tree *, packet_info *, tvbuff_t *, gint *offset);
159 static void parse_PERF(proto_tree *, tvbuff_t *, packet_info *, gint *offset);
160 static void parse_BM(proto_tree *, tvbuff_t *, gint *offset);
161 static void parse_DEV_MGT(proto_tree *, tvbuff_t *, gint *offset);
162 static void parse_COM_MGT(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, gint *offset, proto_tree* top_tree);
163 static void parse_SNMP(proto_tree *, tvbuff_t *, gint *offset);
164 static void parse_VENDOR_MANAGEMENT(proto_tree *, tvbuff_t *, gint *offset);
165 static void parse_APPLICATION_MANAGEMENT(proto_tree *, tvbuff_t *, gint *offset);
166 static void parse_RESERVED_MANAGEMENT(proto_tree *, tvbuff_t *, gint *offset);
168 static gboolean parse_MAD_Common(proto_tree*, tvbuff_t*, gint *offset, MAD_Data*);
169 static gboolean parse_RMPP(proto_tree* , tvbuff_t* , gint *offset);
170 static void label_SUBM_Method(proto_item*, MAD_Data*, packet_info*);
171 static void label_SUBM_Attribute(proto_item*, MAD_Data*, packet_info*);
172 static void label_SUBA_Method(proto_item*, MAD_Data*, packet_info*);
173 static void label_SUBA_Attribute(proto_item*, MAD_Data*, packet_info*);
175 /* Class Attribute Parsing Routines */
176 static gboolean parse_SUBM_Attribute(proto_tree*, tvbuff_t*, gint *offset, MAD_Data*);
177 static gboolean parse_SUBA_Attribute(proto_tree*, tvbuff_t*, gint *offset, MAD_Data*);
179 /* These methods parse individual attributes
180 * Naming convention FunctionHandle = "parse_" + [Attribute Name];
181 * Where [Attribute Name] is the attribute identifier from chapter 14 of the IB Specification
182 * Subnet Management */
183 static void parse_NoticesAndTraps(proto_tree*, tvbuff_t*, gint *offset);
184 static void parse_NodeDescription(proto_tree*, tvbuff_t*, gint *offset);
185 static int parse_NodeInfo(proto_tree*, tvbuff_t*, gint *offset);
186 static int parse_SwitchInfo(proto_tree*, tvbuff_t*, gint *offset);
187 static int parse_GUIDInfo(proto_tree*, tvbuff_t*, gint *offset);
188 static int parse_PortInfo(proto_tree*, tvbuff_t*, gint *offset);
189 static void parse_P_KeyTable(proto_tree*, tvbuff_t*, gint *offset);
190 static void parse_SLtoVLMappingTable(proto_tree*, tvbuff_t*, gint *offset);
191 static void parse_VLArbitrationTable(proto_tree*, tvbuff_t*, gint *offset);
192 static void parse_LinearForwardingTable(proto_tree*, tvbuff_t*, gint *offset);
193 static void parse_RandomForwardingTable(proto_tree*, tvbuff_t*, gint *offset);
194 static void parse_MulticastForwardingTable(proto_tree*, tvbuff_t*, gint *offset);
195 static int parse_SMInfo(proto_tree*, tvbuff_t*, gint *offset);
196 static int parse_VendorDiag(proto_tree*, tvbuff_t*, gint *offset);
197 static void parse_LedInfo(proto_tree*, tvbuff_t*, gint *offset);
198 static int parse_LinkSpeedWidthPairsTable(proto_tree*, tvbuff_t*, gint *offset);
200 /* These methods parse individual attributes for specific MAD management classes.
201 * Naming convention FunctionHandle = "parse_" + [Management Class] + "_" + [Attribute Name];
202 * Where [Management Class] is the shorthand name for the management class as defined
203 * in the MAD Management Classes section below in this file, and [Attribute Name] is the
204 * attribute identifier from the corresponding chapter of the IB Specification */
205 static int parse_PERF_PortCounters(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, gint *offset);
206 static int parse_PERF_PortCountersExtended(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, gint *offset);
208 /* Subnet Administration */
209 static int parse_InformInfo(proto_tree*, tvbuff_t*, gint *offset);
210 static int parse_LinkRecord(proto_tree*, tvbuff_t*, gint *offset);
211 static int parse_ServiceRecord(proto_tree*, tvbuff_t*, gint *offset);
212 static int parse_PathRecord(proto_tree*, tvbuff_t*, gint *offset);
213 static int parse_MCMemberRecord(proto_tree*, tvbuff_t*, gint *offset);
214 static int parse_TraceRecord(proto_tree*, tvbuff_t*, gint *offset);
215 static int parse_MultiPathRecord(proto_tree*, tvbuff_t*, gint *offset);
216 static int parse_ServiceAssociationRecord(proto_tree*, tvbuff_t*, gint *offset);
218 /* Subnet Administration */
219 static void parse_RID(proto_tree*, tvbuff_t*, gint *offset, MAD_Data*);
222 static int parse_ClassPortInfo(proto_tree*, tvbuff_t*, gint *offset);
225 static const value_string SUBM_Methods[] = {
228 { 0x81, "SubnGetResp("},
229 { 0x05, "SubnTrap("},
230 { 0x07, "SubnTrapResp("},
234 static const value_string SUBM_Attributes[] = {
235 { 0x0002, "Attribute (Notice)"},
236 { 0x0010, "Attribute (NodeDescription)"},
237 { 0x0011, "Attribute (NodeInfo)"},
238 { 0x0012, "Attribute (SwitchInfo)"},
239 { 0x0014, "Attribute (GUIDInfo)"},
240 { 0x0015, "Attribute (PortInfo)"},
241 { 0x0016, "Attribute (P_KeyTable)"},
242 { 0x0017, "Attribute (SLtoVLMapptingTable)"},
243 { 0x0018, "Attribute (VLArbitrationTable)"},
244 { 0x0019, "Attribute (LinearForwardingTable)"},
245 { 0x001A, "Attribute (RandomForwardingTable)"},
246 { 0x001B, "Attribute (MulticastForwardingTable)"},
247 { 0x001C, "Attribute (LinkSpeedWidthPairsTable)"},
248 { 0x0020, "Attribute (SMInfo)"},
249 { 0x0030, "Attribute (VendorDiag)"},
250 { 0x0031, "Attribute (LedInfo)"},
255 static const value_string SUBA_Methods[] = {
256 { 0x01, "SubnAdmGet("},
257 { 0x81, "SubnAdmGetResp("},
258 { 0x02, "SubnAdmSet("},
259 { 0x06, "SubnAdmReport("},
260 { 0x86, "SubnAdmReportResp("},
261 { 0x12, "SubnAdmGetTable("},
262 { 0x92, "SubnAdmGetTableResp("},
263 { 0x13, "SubnAdmGetTraceTable("},
264 { 0x14, "SubnAdmGetMulti("},
265 { 0x94, "SubnAdmGetMultiResp("},
266 { 0x15, "SubnAdmDelete("},
267 { 0x95, "SubnAdmDeleteResp("},
271 static const value_string SUBA_Attributes[] = {
272 { 0x0001, "Attribute (ClassPortInfo)"},
273 { 0x0002, "Attribute (Notice)"},
274 { 0x0003, "Attribute (InformInfo)"},
275 { 0x0011, "Attribute (NodeRecord)"},
276 { 0x0012, "Attribute (PortInfoRecord)"},
277 { 0x0013, "Attribute (SLtoVLMappingTableRecord)"},
278 { 0x0014, "Attribute (SwitchInfoRecord)"},
279 { 0x0015, "Attribute (LinearForwardingTableRecord)"},
280 { 0x0016, "Attribute (RandomForwardingTableRecord)"},
281 { 0x0017, "Attribute (MulticastForwardingTableRecord)"},
282 { 0x0018, "Attribute (SMInfoRecord)"},
283 { 0x0019, "Attribute (LinkSpeedWidthPairsTableRecord)"},
284 { 0x00F3, "Attribute (InformInfoRecord)"},
285 { 0x0020, "Attribute (LinkRecord)"},
286 { 0x0030, "Attribute (GuidInfoRecord)"},
287 { 0x0031, "Attribute (ServiceRecord)"},
288 { 0x0033, "Attribute (P_KeyTableRecord)"},
289 { 0x0035, "Attribute (PathRecord)"},
290 { 0x0036, "Attribute (VLArbitrationTableRecord)"},
291 { 0x0038, "Attribute (MCMemberRecord)"},
292 { 0x0039, "Attribute (TraceRecord)"},
293 { 0x003A, "Attribute (MultiPathRecord)"},
294 { 0x003B, "Attribute (ServiceAssociationRecord)"},
299 static const value_string CM_Attributes[] = {
300 { 0x0001, "ClassPortInfo"},
301 { ATTR_CM_REQ, "ConnectRequest"},
302 { 0x0011, "MsgRcptAck"},
303 { ATTR_CM_REJ, "ConnectReject"},
304 { ATTR_CM_REP, "ConnectReply"},
305 { ATTR_CM_RTU, "ReadyToUse"},
306 { ATTR_CM_DREQ, "DisconnectRequest"},
307 { ATTR_CM_DRSP, "DisconnectReply"},
308 { 0x0017, "ServiceIDResReq"},
309 { 0x0018, "ServiceIDResReqResp"},
310 { 0x0019, "LoadAlternatePath"},
311 { 0x001A, "AlternatePathResponse"},
316 #define RMPP_NOT_USED 0
322 static const value_string RMPP_Packet_Types[] = {
323 { RMPP_NOT_USED, " Not an RMPP Packet " },
324 { RMPP_DATA, "RMPP (DATA)" },
325 { RMPP_ACK, "RMPP (ACK)" },
326 { RMPP_STOP, "RMPP (STOP)" },
327 { RMPP_ABORT, "RMPP (ABORT)" },
331 static const value_string RMPP_Flags[] = {
332 { 3, " (Transmission Sequence - First Packet)"},
333 { 5, " (Transmission Sequence - Last Packet)"},
334 { 7, " (Transmission Sequence - First and Last Packet)"},
335 { 1, " (Transmission Sequence) " },
339 static const value_string RMPP_Status[]= {
341 { 1, " (Resources Exhausted)"},
342 { 118, " (Total Time Too Long)"},
343 { 119, " (Inconsistent Last and PayloadLength)"},
344 { 120, " (Inconsistent First and Segment Number)"},
345 { 121, " (Bad RMPPType)"},
346 { 122, " (NewWindowLast Too Small)"},
347 { 123, " (SegmentNumber Too Big)"},
348 { 124, " (Illegal Status)"},
349 { 125, " (Unsupported Version)"},
350 { 126, " (Too Many Retries)"},
351 { 127, " (Unspecified - Unknown Error Code on ABORT)"},
355 static const value_string DiagCode[]= {
356 {0x0000, "Function Ready"},
357 {0x0001, "Performing Self Test"},
358 {0x0002, "Initializing"},
359 {0x0003, "Soft Error - Function has non-fatal error"},
360 {0x0004, "Hard Error - Function has fatal error"},
363 static const value_string LinkWidthEnabled[]= {
364 {0x0000, "No State Change"},
367 {0x0003, "1x or 4x"},
369 {0x0005, "1x or 8x"},
370 {0x0006, "4x or 8x"},
371 {0x0007, "1x or 4x or 8x"},
373 {0x0009, "1x or 12x"},
374 {0x000A, "4x or 12x"},
375 {0x000B, "1x or 4x or 12x"},
376 {0x000C, "8x or 12x"},
377 {0x000D, "1x or 8x or 12x"},
378 {0x000E, "4x or 8x or 12x"},
379 {0x000E, "1x or 4x or 8x or 12x"},
380 {0x00FF, "Set to LinkWidthSupported Value - Response contains actual LinkWidthSupported"},
384 static const value_string LinkWidthSupported[]= {
386 {0x0003, "1x or 4x"},
387 {0x0007, "1x or 4x or 8x"},
388 {0x000B, "1x or 4x or 12x"},
389 {0x000F, "1x or 4x or 8x or 12x"},
392 static const value_string LinkWidthActive[]= {
399 static const value_string LinkSpeedSupported[]= {
400 {0x0001, "2.5 Gbps"},
401 {0x0003, "2.5 or 5.0 Gbps"},
402 {0x0005, "2.5 or 10.0 Gbps"},
403 {0x0007, "2.5 or 5.0 or 10.0 Gbps"},
406 static const value_string PortState[]= {
407 {0x0000, "No State Change"},
408 {0x0001, "Down (includes failed links)"},
409 {0x0002, "Initialized"},
414 static const value_string PortPhysicalState[]= {
415 {0x0000, "No State Change"},
418 {0x0003, "Disabled"},
419 {0x0004, "PortConfigurationTraining"},
421 {0x0006, "LinkErrorRecovery"},
422 {0x0007, "Phy Test"},
425 static const value_string LinkDownDefaultState[]= {
426 {0x0000, "No State Change"},
431 static const value_string LinkSpeedActive[]= {
432 {0x0001, "2.5 Gbps"},
433 {0x0002, "5.0 Gbps"},
434 {0x0004, "10.0 Gbps"},
437 static const value_string LinkSpeedEnabled[]= {
438 {0x0000, "No State Change"},
439 {0x0001, "2.5 Gbps"},
440 {0x0003, "2.5 or 5.0 Gbps"},
441 {0x0005, "2.5 or 10.0 Gbps"},
442 {0x0007, "2.5 or 5.0 or 10.0 Gbps"},
443 {0x000F, "Set to LinkSpeedSupported value - response contains actual LinkSpeedSupported"},
446 static const value_string NeighborMTU[]= {
454 static const value_string VLCap[]= {
456 {0x0002, "VL0, VL1"},
457 {0x0003, "VL0 - VL3"},
458 {0x0004, "VL0 - VL7"},
459 {0x0005, "VL0 - VL14"},
462 static const value_string MTUCap[]= {
470 static const value_string OperationalVLs[]= {
471 {0x0000, "No State Change"},
473 {0x0002, "VL0, VL1"},
474 {0x0003, "VL0 - VL3"},
475 {0x0004, "VL0 - VL7"},
476 {0x0005, "VL0 - VL14"},
480 /* For reserved fields in various packets */
481 static int hf_infiniband_reserved = -1;
482 /* Local Route Header (LRH) */
483 static int hf_infiniband_LRH = -1;
484 static int hf_infiniband_virtual_lane = -1;
485 static int hf_infiniband_link_version = -1;
486 static int hf_infiniband_service_level = -1;
487 static int hf_infiniband_reserved2 = -1;
488 static int hf_infiniband_link_next_header = -1;
489 static int hf_infiniband_destination_local_id = -1;
490 static int hf_infiniband_reserved5 = -1;
491 static int hf_infiniband_packet_length = -1;
492 static int hf_infiniband_source_local_id = -1;
493 /* Global Route Header (GRH) */
494 static int hf_infiniband_GRH = -1;
495 static int hf_infiniband_ip_version = -1;
496 static int hf_infiniband_traffic_class = -1;
497 static int hf_infiniband_flow_label = -1;
498 static int hf_infiniband_payload_length = -1;
499 static int hf_infiniband_next_header = -1;
500 static int hf_infiniband_hop_limit = -1;
501 static int hf_infiniband_source_gid = -1;
502 static int hf_infiniband_destination_gid = -1;
503 /* Base Transport Header (BTH) */
504 static int hf_infiniband_BTH = -1;
505 static int hf_infiniband_opcode = -1;
506 static int hf_infiniband_solicited_event = -1;
507 static int hf_infiniband_migreq = -1;
508 static int hf_infiniband_pad_count = -1;
509 static int hf_infiniband_transport_header_version = -1;
510 static int hf_infiniband_partition_key = -1;
511 static int hf_infiniband_destination_qp = -1;
512 static int hf_infiniband_acknowledge_request = -1;
513 static int hf_infiniband_reserved7 = -1;
514 static int hf_infiniband_packet_sequence_number = -1;
515 /* Raw Header (RWH) */
516 static int hf_infiniband_RWH = -1;
517 static int hf_infiniband_etype = -1;
518 /* Reliable Datagram Extended Transport Header (RDETH) */
519 static int hf_infiniband_RDETH = -1;
520 static int hf_infiniband_ee_context = -1;
521 /* Datagram Extended Transport Header (DETH) */
522 static int hf_infiniband_DETH = -1;
523 static int hf_infiniband_queue_key = -1;
524 static int hf_infiniband_source_qp = -1;
525 /* RDMA Extended Transport Header (RETH) */
526 static int hf_infiniband_RETH = -1;
527 static int hf_infiniband_virtual_address = -1;
528 static int hf_infiniband_remote_key = -1;
529 static int hf_infiniband_dma_length = -1;
530 /* Atomic Extended Transport Header (AtomicETH) */
531 static int hf_infiniband_AtomicETH = -1;
532 /* static int hf_infiniband_virtual_address_AtomicETH = -1; */
533 /* static int hf_infiniband_remote_key_AtomicETH = -1; */
534 static int hf_infiniband_swap_or_add_data = -1;
535 static int hf_infiniband_compare_data = -1;
536 /* ACK Extended Transport Header (AETH) */
537 static int hf_infiniband_AETH = -1;
538 static int hf_infiniband_syndrome = -1;
539 static int hf_infiniband_syndrome_reserved = -1;
540 static int hf_infiniband_syndrome_opcode = -1;
541 static int hf_infiniband_syndrome_credit_count = -1;
542 static int hf_infiniband_syndrome_timer = -1;
543 static int hf_infiniband_syndrome_reserved_value = -1;
544 static int hf_infiniband_syndrome_error_code = -1;
545 static int hf_infiniband_message_sequence_number = -1;
546 /* Atomic ACK Extended Transport Header (AtomicAckETH) */
547 static int hf_infiniband_AtomicAckETH = -1;
548 static int hf_infiniband_original_remote_data = -1;
549 /* Immediate Extended Transport Header (ImmDt) */
550 static int hf_infiniband_IMMDT = -1;
551 /* Invalidate Extended Transport Header (IETH) */
552 static int hf_infiniband_IETH = -1;
554 static int hf_infiniband_payload = -1;
555 static int hf_infiniband_invariant_crc = -1;
556 static int hf_infiniband_variant_crc = -1;
557 /* Unknown or Vendor Specific */
558 static int hf_infiniband_raw_data = -1;
559 static int hf_infiniband_vendor = -1;
561 static int hf_cm_req_local_comm_id = -1;
562 static int hf_cm_req_service_id = -1;
563 static int hf_cm_req_service_id_prefix = -1;
564 static int hf_cm_req_service_id_protocol = -1;
565 static int hf_cm_req_service_id_dport = -1;
566 static int hf_cm_req_local_ca_guid = -1;
567 static int hf_cm_req_local_qkey = -1;
568 static int hf_cm_req_local_qpn = -1;
569 static int hf_cm_req_respo_res = -1;
570 static int hf_cm_req_local_eecn = -1;
571 static int hf_cm_req_init_depth = -1;
572 static int hf_cm_req_remote_eecn = -1;
573 static int hf_cm_req_remote_cm_resp_to = -1;
574 static int hf_cm_req_transp_serv_type = -1;
575 static int hf_cm_req_e2e_flow_ctrl = -1;
576 static int hf_cm_req_start_psn = -1;
577 static int hf_cm_req_local_cm_resp_to = -1;
578 static int hf_cm_req_retry_count = -1;
579 static int hf_cm_req_pkey = -1;
580 static int hf_cm_req_path_pp_mtu = -1;
581 static int hf_cm_req_rdc_exists = -1;
582 static int hf_cm_req_rnr_retry_count = -1;
583 static int hf_cm_req_max_cm_retries = -1;
584 static int hf_cm_req_srq = -1;
585 static int hf_cm_req_extended_transport = -1;
586 static int hf_cm_req_primary_local_lid = -1;
587 static int hf_cm_req_primary_remote_lid = -1;
588 static int hf_cm_req_primary_local_gid = -1;
589 static int hf_cm_req_primary_remote_gid = -1;
590 static int hf_cm_req_primary_local_gid_ipv4 = -1;
591 static int hf_cm_req_primary_remote_gid_ipv4 = -1;
592 static int hf_cm_req_primary_flow_label = -1;
593 static int hf_cm_req_primary_reserved0 = -1;
594 static int hf_cm_req_primary_packet_rate = -1;
595 static int hf_cm_req_primary_traffic_class = -1;
596 static int hf_cm_req_primary_hop_limit = -1;
597 static int hf_cm_req_primary_sl = -1;
598 static int hf_cm_req_primary_subnet_local = -1;
599 static int hf_cm_req_primary_reserved1 = -1;
600 static int hf_cm_req_primary_local_ack_to = -1;
601 static int hf_cm_req_primary_reserved2 = -1;
602 static int hf_cm_req_alt_local_lid = -1;
603 static int hf_cm_req_alt_remote_lid = -1;
604 static int hf_cm_req_alt_local_gid = -1;
605 static int hf_cm_req_alt_remote_gid = -1;
606 static int hf_cm_req_flow_label = -1;
607 static int hf_cm_req_alt_reserved0 = -1;
608 static int hf_cm_req_packet_rate = -1;
609 static int hf_cm_req_alt_traffic_class = -1;
610 static int hf_cm_req_alt_hop_limit = -1;
611 static int hf_cm_req_SL = -1;
612 static int hf_cm_req_subnet_local = -1;
613 static int hf_cm_req_alt_reserved1 = -1;
614 static int hf_cm_req_local_ACK_timeout = -1;
615 static int hf_cm_req_alt_reserved2 = -1;
616 static int hf_cm_req_private_data = -1;
617 static int hf_cm_req_ip_cm_req_msg = -1;
618 static int hf_cm_req_ip_cm_majv = -1;
619 static int hf_cm_req_ip_cm_minv = -1;
620 static int hf_cm_req_ip_cm_ipv = -1;
621 static int hf_cm_req_ip_cm_res = -1;
622 static int hf_cm_req_ip_cm_sport = -1;
623 static int hf_cm_req_ip_cm_sip6 = -1;
624 static int hf_cm_req_ip_cm_dip6 = -1;
625 static int hf_cm_req_ip_cm_sip4 = -1;
626 static int hf_cm_req_ip_cm_dip4 = -1;
627 static int hf_ip_cm_req_consumer_private_data = -1;
630 static int hf_cm_rep_localcommid = -1;
631 static int hf_cm_rep_remotecommid = -1;
632 static int hf_cm_rep_localqkey = -1;
633 static int hf_cm_rep_localqpn = -1;
634 static int hf_cm_rep_localeecontnum = -1;
635 static int hf_cm_rep_startingpsn = -1;
636 static int hf_cm_rep_responderres = -1;
637 static int hf_cm_rep_initiatordepth = -1;
638 static int hf_cm_rep_tgtackdelay = -1;
639 static int hf_cm_rep_failoveracc = -1;
640 static int hf_cm_rep_e2eflowctl = -1;
641 static int hf_cm_rep_rnrretrycount = -1;
642 static int hf_cm_rep_srq = -1;
643 static int hf_cm_rep_reserved = -1;
644 static int hf_cm_rep_localcaguid = -1;
645 static int hf_cm_rep_privatedata = -1;
647 static int hf_cm_rtu_localcommid = -1;
648 static int hf_cm_rtu_remotecommid = -1;
649 static int hf_cm_rtu_privatedata = -1;
651 static int hf_cm_rej_local_commid = -1;
652 static int hf_cm_rej_remote_commid = -1;
653 static int hf_cm_rej_msg_rej = -1;
654 static int hf_cm_rej_msg_reserved0 = -1;
655 static int hf_cm_rej_rej_info_len = -1;
656 static int hf_cm_rej_msg_reserved1 = -1;
657 static int hf_cm_rej_reason = -1;
658 static int hf_cm_rej_add_rej_info = -1;
659 static int hf_cm_rej_private_data = -1;
661 static int hf_cm_dreq_localcommid = -1;
662 static int hf_cm_dreq_remotecommid = -1;
663 static int hf_cm_dreq_remote_qpn = -1;
664 static int hf_cm_dreq_privatedata = -1;
666 static int hf_cm_drsp_localcommid = -1;
667 static int hf_cm_drsp_remotecommid = -1;
668 static int hf_cm_drsp_privatedata = -1;
669 /* MAD Base Header */
670 static int hf_infiniband_MAD = -1;
671 static int hf_infiniband_base_version = -1;
672 static int hf_infiniband_mgmt_class = -1;
673 static int hf_infiniband_class_version = -1;
674 static int hf_infiniband_method = -1;
675 static int hf_infiniband_status = -1;
676 static int hf_infiniband_class_specific = -1;
677 static int hf_infiniband_transaction_id = -1;
678 static int hf_infiniband_attribute_id = -1;
679 static int hf_infiniband_attribute_modifier = -1;
680 static int hf_infiniband_data = -1;
682 static int hf_infiniband_RMPP = -1;
683 static int hf_infiniband_rmpp_version = -1;
684 static int hf_infiniband_rmpp_type = -1;
685 static int hf_infiniband_r_resp_time = -1;
686 static int hf_infiniband_rmpp_flags = -1;
687 static int hf_infiniband_rmpp_status = -1;
688 static int hf_infiniband_rmpp_data1 = -1;
689 static int hf_infiniband_rmpp_data2 = -1;
691 /* static int hf_infiniband_RMPP_DATA = -1; */
692 static int hf_infiniband_segment_number = -1;
693 static int hf_infiniband_payload_length32 = -1;
694 static int hf_infiniband_transferred_data = -1;
696 static int hf_infiniband_new_window_last = -1;
697 /* RMPP ABORT and STOP */
698 static int hf_infiniband_optional_extended_error_data = -1;
699 /* SMP Data LID Routed */
700 static int hf_infiniband_SMP_LID = -1;
701 static int hf_infiniband_m_key = -1;
702 static int hf_infiniband_smp_data = -1;
703 /* SMP Data Directed Route */
704 static int hf_infiniband_SMP_DIRECTED = -1;
705 static int hf_infiniband_smp_status = -1;
706 static int hf_infiniband_hop_pointer = -1;
707 static int hf_infiniband_hop_count = -1;
708 static int hf_infiniband_dr_slid = -1;
709 static int hf_infiniband_dr_dlid = -1;
710 static int hf_infiniband_d = -1;
711 static int hf_infiniband_initial_path = -1;
712 static int hf_infiniband_return_path = -1;
714 static int hf_infiniband_SA = -1;
715 static int hf_infiniband_sm_key = -1;
716 static int hf_infiniband_attribute_offset = -1;
717 static int hf_infiniband_component_mask = -1;
718 static int hf_infiniband_subnet_admin_data = -1;
720 /* Mellanox EoIB encapsulation header */
721 static int proto_mellanox_eoib = -1;
722 static int hf_infiniband_ver = -1;
723 static int hf_infiniband_tcp_chk = -1;
724 static int hf_infiniband_ip_chk = -1;
725 static int hf_infiniband_fcs = -1;
726 static int hf_infiniband_ms = -1;
727 static int hf_infiniband_seg_off = -1;
728 static int hf_infiniband_seg_id = -1;
730 static gint ett_eoib = -1;
732 #define MELLANOX_VERSION_FLAG 0x3000
733 #define MELLANOX_TCP_CHECKSUM_FLAG 0x0C00
734 #define MELLANOX_IP_CHECKSUM_FLAG 0x0300
735 #define MELLANOX_FCS_PRESENT_FLAG 0x0040
736 #define MELLANOX_MORE_SEGMENT_FLAG 0x0020
737 #define MELLANOX_SEGMENT_FLAG 0x001F
740 * Additional Structures for individuala attribute decoding.
741 * Since they are not headers the naming convention is slightly modified
742 * Convention: hf_infiniband_[attribute name]_[field]
743 * This was not entirely necessary but I felt the previous convention
744 * did not provide adequate readability for the granularity of attribute/attribute fields. */
746 /* NodeDescription */
747 static int hf_infiniband_NodeDescription_NodeString = -1;
749 static int hf_infiniband_NodeInfo_BaseVersion = -1;
750 static int hf_infiniband_NodeInfo_ClassVersion = -1;
751 static int hf_infiniband_NodeInfo_NodeType = -1;
752 static int hf_infiniband_NodeInfo_NumPorts = -1;
753 static int hf_infiniband_NodeInfo_SystemImageGUID = -1;
754 static int hf_infiniband_NodeInfo_NodeGUID = -1;
755 static int hf_infiniband_NodeInfo_PortGUID = -1;
756 static int hf_infiniband_NodeInfo_PartitionCap = -1;
757 static int hf_infiniband_NodeInfo_DeviceID = -1;
758 static int hf_infiniband_NodeInfo_Revision = -1;
759 static int hf_infiniband_NodeInfo_LocalPortNum = -1;
760 static int hf_infiniband_NodeInfo_VendorID = -1;
762 static int hf_infiniband_SwitchInfo_LinearFDBCap = -1;
763 static int hf_infiniband_SwitchInfo_RandomFDBCap = -1;
764 static int hf_infiniband_SwitchInfo_MulticastFDBCap = -1;
765 static int hf_infiniband_SwitchInfo_LinearFDBTop = -1;
766 static int hf_infiniband_SwitchInfo_DefaultPort = -1;
767 static int hf_infiniband_SwitchInfo_DefaultMulticastPrimaryPort = -1;
768 static int hf_infiniband_SwitchInfo_DefaultMulticastNotPrimaryPort = -1;
769 static int hf_infiniband_SwitchInfo_LifeTimeValue = -1;
770 static int hf_infiniband_SwitchInfo_PortStateChange = -1;
771 static int hf_infiniband_SwitchInfo_OptimizedSLtoVLMappingProgramming = -1;
772 static int hf_infiniband_SwitchInfo_LIDsPerPort = -1;
773 static int hf_infiniband_SwitchInfo_PartitionEnforcementCap = -1;
774 static int hf_infiniband_SwitchInfo_InboundEnforcementCap = -1;
775 static int hf_infiniband_SwitchInfo_OutboundEnforcementCap = -1;
776 static int hf_infiniband_SwitchInfo_FilterRawInboundCap = -1;
777 static int hf_infiniband_SwitchInfo_FilterRawOutboundCap = -1;
778 static int hf_infiniband_SwitchInfo_EnhancedPortZero = -1;
780 /* static int hf_infiniband_GUIDInfo_GUIDBlock = -1; */
781 static int hf_infiniband_GUIDInfo_GUID = -1;
783 static int hf_infiniband_PortInfo_GidPrefix = -1;
784 static int hf_infiniband_PortInfo_LID = -1;
785 static int hf_infiniband_PortInfo_MasterSMLID = -1;
786 static int hf_infiniband_PortInfo_CapabilityMask = -1;
788 /* Capability Mask Flags */
789 static int hf_infiniband_PortInfo_CapabilityMask_SM = -1;
790 static int hf_infiniband_PortInfo_CapabilityMask_NoticeSupported = -1;
791 static int hf_infiniband_PortInfo_CapabilityMask_TrapSupported = -1;
792 static int hf_infiniband_PortInfo_CapabilityMask_OptionalIPDSupported = -1;
793 static int hf_infiniband_PortInfo_CapabilityMask_AutomaticMigrationSupported = -1;
794 static int hf_infiniband_PortInfo_CapabilityMask_SLMappingSupported = -1;
795 static int hf_infiniband_PortInfo_CapabilityMask_MKeyNVRAM = -1;
796 static int hf_infiniband_PortInfo_CapabilityMask_PKeyNVRAM = -1;
797 static int hf_infiniband_PortInfo_CapabilityMask_LEDInfoSupported = -1;
798 static int hf_infiniband_PortInfo_CapabilityMask_SMdisabled = -1;
799 static int hf_infiniband_PortInfo_CapabilityMask_SystemImageGUIDSupported = -1;
800 static int hf_infiniband_PortInfo_CapabilityMask_PKeySwitchExternalPortTrapSupported = -1;
801 static int hf_infiniband_PortInfo_CapabilityMask_CommunicationManagementSupported = -1;
802 static int hf_infiniband_PortInfo_CapabilityMask_SNMPTunnelingSupported = -1;
803 static int hf_infiniband_PortInfo_CapabilityMask_ReinitSupported = -1;
804 static int hf_infiniband_PortInfo_CapabilityMask_DeviceManagementSupported = -1;
805 static int hf_infiniband_PortInfo_CapabilityMask_VendorClassSupported = -1;
806 static int hf_infiniband_PortInfo_CapabilityMask_DRNoticeSupported = -1;
807 static int hf_infiniband_PortInfo_CapabilityMask_CapabilityMaskNoticeSupported = -1;
808 static int hf_infiniband_PortInfo_CapabilityMask_BootManagementSupported = -1;
809 static int hf_infiniband_PortInfo_CapabilityMask_LinkRoundTripLatencySupported = -1;
810 static int hf_infiniband_PortInfo_CapabilityMask_ClientRegistrationSupported = -1;
811 static int hf_infiniband_PortInfo_CapabilityMask_OtherLocalChangesNoticeSupported = -1;
812 static int hf_infiniband_PortInfo_CapabilityMask_LinkSpeedWIdthPairsTableSupported = -1;
813 /* End Capability Mask Flags */
816 static int hf_infiniband_PortInfo_DiagCode = -1;
817 static int hf_infiniband_PortInfo_M_KeyLeasePeriod = -1;
818 static int hf_infiniband_PortInfo_LocalPortNum = -1;
819 static int hf_infiniband_PortInfo_LinkWidthEnabled = -1;
820 static int hf_infiniband_PortInfo_LinkWidthSupported = -1;
821 static int hf_infiniband_PortInfo_LinkWidthActive = -1;
822 static int hf_infiniband_PortInfo_LinkSpeedSupported = -1;
823 static int hf_infiniband_PortInfo_PortState = -1;
824 static int hf_infiniband_PortInfo_PortPhysicalState = -1;
825 static int hf_infiniband_PortInfo_LinkDownDefaultState = -1;
826 static int hf_infiniband_PortInfo_M_KeyProtectBits = -1;
827 static int hf_infiniband_PortInfo_LMC = -1;
828 static int hf_infiniband_PortInfo_LinkSpeedActive = -1;
829 static int hf_infiniband_PortInfo_LinkSpeedEnabled = -1;
830 static int hf_infiniband_PortInfo_NeighborMTU = -1;
831 static int hf_infiniband_PortInfo_MasterSMSL = -1;
832 static int hf_infiniband_PortInfo_VLCap = -1;
833 static int hf_infiniband_PortInfo_M_Key = -1;
834 static int hf_infiniband_PortInfo_InitType = -1;
835 static int hf_infiniband_PortInfo_VLHighLimit = -1;
836 static int hf_infiniband_PortInfo_VLArbitrationHighCap = -1;
837 static int hf_infiniband_PortInfo_VLArbitrationLowCap = -1;
838 static int hf_infiniband_PortInfo_InitTypeReply = -1;
839 static int hf_infiniband_PortInfo_MTUCap = -1;
840 static int hf_infiniband_PortInfo_VLStallCount = -1;
841 static int hf_infiniband_PortInfo_HOQLife = -1;
842 static int hf_infiniband_PortInfo_OperationalVLs = -1;
843 static int hf_infiniband_PortInfo_PartitionEnforcementInbound = -1;
844 static int hf_infiniband_PortInfo_PartitionEnforcementOutbound = -1;
845 static int hf_infiniband_PortInfo_FilterRawInbound = -1;
846 static int hf_infiniband_PortInfo_FilterRawOutbound = -1;
847 static int hf_infiniband_PortInfo_M_KeyViolations = -1;
848 static int hf_infiniband_PortInfo_P_KeyViolations = -1;
849 static int hf_infiniband_PortInfo_Q_KeyViolations = -1;
850 static int hf_infiniband_PortInfo_GUIDCap = -1;
851 static int hf_infiniband_PortInfo_ClientReregister = -1;
852 static int hf_infiniband_PortInfo_SubnetTimeOut = -1;
853 static int hf_infiniband_PortInfo_RespTimeValue = -1;
854 static int hf_infiniband_PortInfo_LocalPhyErrors = -1;
855 static int hf_infiniband_PortInfo_OverrunErrors = -1;
856 static int hf_infiniband_PortInfo_MaxCreditHint = -1;
857 static int hf_infiniband_PortInfo_LinkRoundTripLatency = -1;
860 static int hf_infiniband_P_KeyTable_P_KeyTableBlock = -1;
861 static int hf_infiniband_P_KeyTable_MembershipType = -1;
862 static int hf_infiniband_P_KeyTable_P_KeyBase = -1;
864 /* SLtoVLMappingTable */
865 static int hf_infiniband_SLtoVLMappingTable_SLtoVL_HighBits = -1;
866 static int hf_infiniband_SLtoVLMappingTable_SLtoVL_LowBits = -1;
868 /* VLArbitrationTable */
869 /* static int hf_infiniband_VLArbitrationTable_VLWeightPairs = -1; */
870 static int hf_infiniband_VLArbitrationTable_VL = -1;
871 static int hf_infiniband_VLArbitrationTable_Weight = -1;
873 /* LinearForwardingTable */
874 /* static int hf_infiniband_LinearForwardingTable_LinearForwardingTableBlock = -1; */
875 static int hf_infiniband_LinearForwardingTable_Port = -1;
877 /* RandomForwardingTable */
878 /* static int hf_infiniband_RandomForwardingTable_RandomForwardingTableBlock = -1; */
879 static int hf_infiniband_RandomForwardingTable_LID = -1;
880 static int hf_infiniband_RandomForwardingTable_Valid = -1;
881 static int hf_infiniband_RandomForwardingTable_LMC = -1;
882 static int hf_infiniband_RandomForwardingTable_Port = -1;
884 /* MulticastForwardingTable */
885 /* static int hf_infiniband_MulticastForwardingTable_MulticastForwardingTableBlock = -1; */
886 static int hf_infiniband_MulticastForwardingTable_PortMask = -1;
889 static int hf_infiniband_SMInfo_GUID = -1;
890 static int hf_infiniband_SMInfo_SM_Key = -1;
891 static int hf_infiniband_SMInfo_ActCount = -1;
892 static int hf_infiniband_SMInfo_Priority = -1;
893 static int hf_infiniband_SMInfo_SMState = -1;
896 static int hf_infiniband_VendorDiag_NextIndex = -1;
897 static int hf_infiniband_VendorDiag_DiagData = -1;
900 static int hf_infiniband_LedInfo_LedMask = -1;
902 /* LinkSpeedWidthPairsTable */
903 static int hf_infiniband_LinkSpeedWidthPairsTable_NumTables = -1;
904 static int hf_infiniband_LinkSpeedWidthPairsTable_PortMask = -1;
905 static int hf_infiniband_LinkSpeedWidthPairsTable_SpeedTwoFive = -1;
906 static int hf_infiniband_LinkSpeedWidthPairsTable_SpeedFive = -1;
907 static int hf_infiniband_LinkSpeedWidthPairsTable_SpeedTen = -1;
909 /* Attributes for Subnet Administration.
910 * Mostly we have "Records" here which are just structures of SM attributes.
911 * There are some unique attributes though that we will want to have a structure for. */
915 /* SLtoVLMappingTableRecord */
916 /* SwitchInfoRecord */
917 /* LinearForwardingTableRecord */
918 /* RandomForwardingTableRecord */
919 /* MulticastForwardingTableRecord */
920 /* VLArbitrationTableRecord */
922 static int hf_infiniband_SA_LID = -1;
923 static int hf_infiniband_SA_EndportLID = -1;
924 static int hf_infiniband_SA_PortNum = -1;
925 static int hf_infiniband_SA_InputPortNum = -1;
926 static int hf_infiniband_SA_OutputPortNum = -1;
927 static int hf_infiniband_SA_BlockNum_EightBit = -1;
928 static int hf_infiniband_SA_BlockNum_NineBit = -1;
929 static int hf_infiniband_SA_BlockNum_SixteenBit = -1;
930 static int hf_infiniband_SA_Position = -1;
931 /* static int hf_infiniband_SA_Index = -1; */
933 /* InformInfoRecord */
934 static int hf_infiniband_InformInfoRecord_SubscriberGID = -1;
935 static int hf_infiniband_InformInfoRecord_Enum = -1;
938 static int hf_infiniband_InformInfo_GID = -1;
939 static int hf_infiniband_InformInfo_LIDRangeBegin = -1;
940 static int hf_infiniband_InformInfo_LIDRangeEnd = -1;
941 static int hf_infiniband_InformInfo_IsGeneric = -1;
942 static int hf_infiniband_InformInfo_Subscribe = -1;
943 static int hf_infiniband_InformInfo_Type = -1;
944 static int hf_infiniband_InformInfo_TrapNumberDeviceID = -1;
945 static int hf_infiniband_InformInfo_QPN = -1;
946 static int hf_infiniband_InformInfo_RespTimeValue = -1;
947 static int hf_infiniband_InformInfo_ProducerTypeVendorID = -1;
950 static int hf_infiniband_LinkRecord_FromLID = -1;
951 static int hf_infiniband_LinkRecord_FromPort = -1;
952 static int hf_infiniband_LinkRecord_ToPort = -1;
953 static int hf_infiniband_LinkRecord_ToLID = -1;
956 static int hf_infiniband_ServiceRecord_ServiceID = -1;
957 static int hf_infiniband_ServiceRecord_ServiceGID = -1;
958 static int hf_infiniband_ServiceRecord_ServiceP_Key = -1;
959 static int hf_infiniband_ServiceRecord_ServiceLease = -1;
960 static int hf_infiniband_ServiceRecord_ServiceKey = -1;
961 static int hf_infiniband_ServiceRecord_ServiceName = -1;
962 static int hf_infiniband_ServiceRecord_ServiceData = -1;
964 /* ServiceAssociationRecord */
965 static int hf_infiniband_ServiceAssociationRecord_ServiceKey = -1;
966 static int hf_infiniband_ServiceAssociationRecord_ServiceName = -1;
969 static int hf_infiniband_PathRecord_DGID = -1;
970 static int hf_infiniband_PathRecord_SGID = -1;
971 static int hf_infiniband_PathRecord_DLID = -1;
972 static int hf_infiniband_PathRecord_SLID = -1;
973 static int hf_infiniband_PathRecord_RawTraffic = -1;
974 static int hf_infiniband_PathRecord_FlowLabel = -1;
975 static int hf_infiniband_PathRecord_HopLimit = -1;
976 static int hf_infiniband_PathRecord_TClass = -1;
977 static int hf_infiniband_PathRecord_Reversible = -1;
978 static int hf_infiniband_PathRecord_NumbPath = -1;
979 static int hf_infiniband_PathRecord_P_Key = -1;
980 static int hf_infiniband_PathRecord_SL = -1;
981 static int hf_infiniband_PathRecord_MTUSelector = -1;
982 static int hf_infiniband_PathRecord_MTU = -1;
983 static int hf_infiniband_PathRecord_RateSelector = -1;
984 static int hf_infiniband_PathRecord_Rate = -1;
985 static int hf_infiniband_PathRecord_PacketLifeTimeSelector = -1;
986 static int hf_infiniband_PathRecord_PacketLifeTime = -1;
987 static int hf_infiniband_PathRecord_Preference = -1;
990 static int hf_infiniband_MCMemberRecord_MGID = -1;
991 static int hf_infiniband_MCMemberRecord_PortGID = -1;
992 static int hf_infiniband_MCMemberRecord_Q_Key = -1;
993 static int hf_infiniband_MCMemberRecord_MLID = -1;
994 static int hf_infiniband_MCMemberRecord_MTUSelector = -1;
995 static int hf_infiniband_MCMemberRecord_MTU = -1;
996 static int hf_infiniband_MCMemberRecord_TClass = -1;
997 static int hf_infiniband_MCMemberRecord_P_Key = -1;
998 static int hf_infiniband_MCMemberRecord_RateSelector = -1;
999 static int hf_infiniband_MCMemberRecord_Rate = -1;
1000 static int hf_infiniband_MCMemberRecord_PacketLifeTimeSelector = -1;
1001 static int hf_infiniband_MCMemberRecord_PacketLifeTime = -1;
1002 static int hf_infiniband_MCMemberRecord_SL = -1;
1003 static int hf_infiniband_MCMemberRecord_FlowLabel = -1;
1004 static int hf_infiniband_MCMemberRecord_HopLimit = -1;
1005 static int hf_infiniband_MCMemberRecord_Scope = -1;
1006 static int hf_infiniband_MCMemberRecord_JoinState = -1;
1007 static int hf_infiniband_MCMemberRecord_ProxyJoin = -1;
1010 static int hf_infiniband_TraceRecord_GIDPrefix = -1;
1011 static int hf_infiniband_TraceRecord_IDGeneration = -1;
1012 static int hf_infiniband_TraceRecord_NodeType = -1;
1013 static int hf_infiniband_TraceRecord_NodeID = -1;
1014 static int hf_infiniband_TraceRecord_ChassisID = -1;
1015 static int hf_infiniband_TraceRecord_EntryPortID = -1;
1016 static int hf_infiniband_TraceRecord_ExitPortID = -1;
1017 static int hf_infiniband_TraceRecord_EntryPort = -1;
1018 static int hf_infiniband_TraceRecord_ExitPort = -1;
1020 /* MultiPathRecord */
1021 static int hf_infiniband_MultiPathRecord_RawTraffic = -1;
1022 static int hf_infiniband_MultiPathRecord_FlowLabel = -1;
1023 static int hf_infiniband_MultiPathRecord_HopLimit = -1;
1024 static int hf_infiniband_MultiPathRecord_TClass = -1;
1025 static int hf_infiniband_MultiPathRecord_Reversible = -1;
1026 static int hf_infiniband_MultiPathRecord_NumbPath = -1;
1027 static int hf_infiniband_MultiPathRecord_P_Key = -1;
1028 static int hf_infiniband_MultiPathRecord_SL = -1;
1029 static int hf_infiniband_MultiPathRecord_MTUSelector = -1;
1030 static int hf_infiniband_MultiPathRecord_MTU = -1;
1031 static int hf_infiniband_MultiPathRecord_RateSelector = -1;
1032 static int hf_infiniband_MultiPathRecord_Rate = -1;
1033 static int hf_infiniband_MultiPathRecord_PacketLifeTimeSelector = -1;
1034 static int hf_infiniband_MultiPathRecord_PacketLifeTime = -1;
1035 static int hf_infiniband_MultiPathRecord_IndependenceSelector = -1;
1036 static int hf_infiniband_MultiPathRecord_GIDScope = -1;
1037 static int hf_infiniband_MultiPathRecord_SGIDCount = -1;
1038 static int hf_infiniband_MultiPathRecord_DGIDCount = -1;
1039 static int hf_infiniband_MultiPathRecord_SDGID = -1;
1042 static int hf_infiniband_ClassPortInfo_BaseVersion = -1;
1043 static int hf_infiniband_ClassPortInfo_ClassVersion = -1;
1044 static int hf_infiniband_ClassPortInfo_CapabilityMask = -1;
1045 static int hf_infiniband_ClassPortInfo_CapabilityMask2 = -1;
1046 static int hf_infiniband_ClassPortInfo_RespTimeValue = -1;
1047 static int hf_infiniband_ClassPortInfo_RedirectGID = -1;
1048 static int hf_infiniband_ClassPortInfo_RedirectTC = -1;
1049 static int hf_infiniband_ClassPortInfo_RedirectSL = -1;
1050 static int hf_infiniband_ClassPortInfo_RedirectFL = -1;
1051 static int hf_infiniband_ClassPortInfo_RedirectLID = -1;
1052 static int hf_infiniband_ClassPortInfo_RedirectP_Key = -1;
1053 static int hf_infiniband_ClassPortInfo_Reserved = -1;
1054 static int hf_infiniband_ClassPortInfo_RedirectQP = -1;
1055 static int hf_infiniband_ClassPortInfo_RedirectQ_Key = -1;
1056 static int hf_infiniband_ClassPortInfo_TrapGID = -1;
1057 static int hf_infiniband_ClassPortInfo_TrapTC = -1;
1058 static int hf_infiniband_ClassPortInfo_TrapSL = -1;
1059 static int hf_infiniband_ClassPortInfo_TrapFL = -1;
1060 static int hf_infiniband_ClassPortInfo_TrapLID = -1;
1061 static int hf_infiniband_ClassPortInfo_TrapP_Key = -1;
1062 static int hf_infiniband_ClassPortInfo_TrapQP = -1;
1063 static int hf_infiniband_ClassPortInfo_TrapQ_Key = -1;
1066 static int hf_infiniband_Notice_IsGeneric = -1;
1067 static int hf_infiniband_Notice_Type = -1;
1068 static int hf_infiniband_Notice_ProducerTypeVendorID = -1;
1069 static int hf_infiniband_Notice_TrapNumberDeviceID = -1;
1070 static int hf_infiniband_Notice_IssuerLID = -1;
1071 static int hf_infiniband_Notice_NoticeToggle = -1;
1072 static int hf_infiniband_Notice_NoticeCount = -1;
1073 static int hf_infiniband_Notice_DataDetails = -1;
1074 /* static int hf_infiniband_Notice_IssuerGID = -1; */
1075 /* static int hf_infiniband_Notice_ClassTrapSpecificData = -1; */
1077 /* ClassPortInfo attribute in Performance class */
1078 static int hf_infiniband_PerfMgt_ClassPortInfo = -1;
1080 /* PortCounters attribute in Performance class */
1081 static int hf_infiniband_PortCounters = -1;
1082 static int hf_infiniband_PortCounters_PortSelect = -1;
1083 static int hf_infiniband_PortCounters_CounterSelect = -1;
1084 static int hf_infiniband_PortCounters_SymbolErrorCounter = -1;
1085 static int hf_infiniband_PortCounters_LinkErrorRecoveryCounter = -1;
1086 static int hf_infiniband_PortCounters_LinkDownedCounter = -1;
1087 static int hf_infiniband_PortCounters_PortRcvErrors = -1;
1088 static int hf_infiniband_PortCounters_PortRcvRemotePhysicalErrors = -1;
1089 static int hf_infiniband_PortCounters_PortRcvSwitchRelayErrors = -1;
1090 static int hf_infiniband_PortCounters_PortXmitDiscards = -1;
1091 static int hf_infiniband_PortCounters_PortXmitConstraintErrors = -1;
1092 static int hf_infiniband_PortCounters_PortRcvConstraintErrors = -1;
1093 static int hf_infiniband_PortCounters_LocalLinkIntegrityErrors = -1;
1094 static int hf_infiniband_PortCounters_ExcessiveBufferOverrunErrors = -1;
1095 static int hf_infiniband_PortCounters_VL15Dropped = -1;
1096 static int hf_infiniband_PortCounters_PortXmitData = -1;
1097 static int hf_infiniband_PortCounters_PortRcvData = -1;
1098 static int hf_infiniband_PortCounters_PortXmitPkts = -1;
1099 static int hf_infiniband_PortCounters_PortRcvPkts = -1;
1101 /* Extended PortCounters attribute in Performance class */
1102 static int hf_infiniband_PortCountersExt = -1;
1103 static int hf_infiniband_PortCountersExt_PortSelect = -1;
1104 static int hf_infiniband_PortCountersExt_CounterSelect = -1;
1105 static int hf_infiniband_PortCountersExt_PortXmitData = -1;
1106 static int hf_infiniband_PortCountersExt_PortRcvData = -1;
1107 static int hf_infiniband_PortCountersExt_PortXmitPkts = -1;
1108 static int hf_infiniband_PortCountersExt_PortRcvPkts = -1;
1109 static int hf_infiniband_PortCountersExt_PortUnicastXmitPkts = -1;
1110 static int hf_infiniband_PortCountersExt_PortUnicastRcvPkts = -1;
1111 static int hf_infiniband_PortCountersExt_PortMulticastXmitPkts = -1;
1112 static int hf_infiniband_PortCountersExt_PortMulticastRcvPkts = -1;
1114 /* Notice DataDetails and ClassTrapSpecific Data for certain traps
1115 * Note that traps reuse many fields, so they are only declared once under the first trap that they appear.
1116 * There is no need to redeclare them for specific Traps (as with other SA Attributes) because they are uniform between Traps. */
1118 /* Parse DataDetails for a given Trap */
1119 static gint parse_NoticeDataDetails(proto_tree*, tvbuff_t*, gint *offset, guint16 trapNumber);
1121 /* Traps 64,65,66,67 */
1122 static int hf_infiniband_Trap_GIDADDR = -1;
1126 static int hf_infiniband_Trap_COMP_MASK = -1;
1127 static int hf_infiniband_Trap_WAIT_FOR_REPATH = -1;
1128 /* ClassTrapSpecificData */
1129 /* static int hf_infiniband_Trap_PATH_REC = -1; */
1132 static int hf_infiniband_Trap_LIDADDR = -1;
1134 /* Trap 129, 130, 131 */
1135 static int hf_infiniband_Trap_PORTNO = -1;
1138 static int hf_infiniband_Trap_OtherLocalChanges = -1;
1139 static int hf_infiniband_Trap_CAPABILITYMASK = -1;
1140 static int hf_infiniband_Trap_LinkSpeecEnabledChange = -1;
1141 static int hf_infiniband_Trap_LinkWidthEnabledChange = -1;
1142 static int hf_infiniband_Trap_NodeDescriptionChange = -1;
1145 static int hf_infiniband_Trap_SYSTEMIMAGEGUID = -1;
1148 static int hf_infiniband_Trap_DRSLID = -1;
1149 static int hf_infiniband_Trap_METHOD = -1;
1150 static int hf_infiniband_Trap_ATTRIBUTEID = -1;
1151 static int hf_infiniband_Trap_ATTRIBUTEMODIFIER = -1;
1152 static int hf_infiniband_Trap_MKEY = -1;
1153 static int hf_infiniband_Trap_DRNotice = -1;
1154 static int hf_infiniband_Trap_DRPathTruncated = -1;
1155 static int hf_infiniband_Trap_DRHopCount = -1;
1156 static int hf_infiniband_Trap_DRNoticeReturnPath = -1;
1159 static int hf_infiniband_Trap_LIDADDR1 = -1;
1160 static int hf_infiniband_Trap_LIDADDR2 = -1;
1161 static int hf_infiniband_Trap_KEY = -1;
1162 static int hf_infiniband_Trap_SL = -1;
1163 static int hf_infiniband_Trap_QP1 = -1;
1164 static int hf_infiniband_Trap_QP2 = -1;
1165 static int hf_infiniband_Trap_GIDADDR1 = -1;
1166 static int hf_infiniband_Trap_GIDADDR2 = -1;
1169 static int hf_infiniband_Trap_DataValid = -1;
1170 static int hf_infiniband_Trap_PKEY = -1;
1171 static int hf_infiniband_Trap_SWLIDADDR = -1;
1173 /* Infiniband Link */
1174 static int hf_infiniband_link_op = -1;
1175 static int hf_infiniband_link_fctbs = -1;
1176 static int hf_infiniband_link_vl = -1;
1177 static int hf_infiniband_link_fccl = -1;
1178 static int hf_infiniband_link_lpcrc = -1;
1180 /* Trap Type/Descriptions for dissection */
1181 static const value_string Operand_Description[]= {
1182 { 0, " Normal Flow Control"},
1183 { 1, " Flow Control Init"},
1187 /* Trap Type/Descriptions for dissection */
1188 static const value_string Trap_Description[]= {
1189 { 64, " (Informational) <GIDADDR> is now in service"},
1190 { 65, " (Informational) <GIDADDR> is out of service"},
1191 { 66, " (Informational) New Multicast Group with multicast address <GIDADDR> is now created"},
1192 { 67, " (Informational) Multicast Group with multicast address <GIDADDR> is now deleted"},
1193 { 68, " (Informational) Paths indicated by <PATH_REC> and <COMP_MASK> are no longer valid"},
1194 { 69, " (Informational) Paths indicated by <PATH_REC> and <COMP_MASK> have been recomputed"},
1195 { 128, " (Urgent) Link State of at least one port of switch at <LIDADDR> has changed"},
1196 { 129, " (Urgent) Local Link Integrity threshold reached at <LIDADDR><PORTNO>"},
1197 { 130, " (Urgent) Excessive Buffer OVerrun threshold reached at <LIDADDR><PORTNO>"},
1198 { 131, " (Urgent) Flow Control Update watchdog timer expired at <LIDADDR><PORTNO>"},
1199 { 144, " (Informational) CapMask, NodeDesc, LinkWidthEnabled or LinkSpeedEnabled at <LIDADDR> has been modified"},
1200 { 145, " (Informational) SystemImageGUID at <LIDADDR> has been modified. New value is <SYSTEMIMAGEGUID>"},
1201 { 256, " (Security) Bad M_Key, <M_KEY> from <LIDADDR> attempted <METHOD> with <ATTRIBUTEID> and <ATTRIBUTEMODIFIER>"},
1202 { 257, " (Security) Bad P_Key, <KEY> from <LIDADDR1><GIDADDR1><QP1> to <LIDADDR2><GIDADDR2><QP2> on <SL>"},
1203 { 258, " (Security) Bad Q_Key, <KEY> from <LIDADDR1><GIDADDR1><QP1> to <LIDADDR2><GIDADDR2><QP2> on <SL>"},
1204 { 259, " (Security) Bad P_Key, <KEY> from <LIDADDR1><GIDADDR1><QP1> to <LIDADDR2><GIDADDR2><QP2> on <SL> at switch <LIDADDR><PORTNO>"},
1209 static const value_string bth_opcode_tbl[] = {
1210 { 0x0, "Reliable Connection (RC) - SEND First" },
1211 { 0x1, "Reliable Connection (RC) - SEND Middle" },
1212 { 0x2, "Reliable Connection (RC) - SEND Last" },
1213 { 0x3, "Reliable Connection (RC) - SEND Last with Immediate" },
1214 { 0x4, "Reliable Connection (RC) - SEND Only" },
1215 { 0x5, "Reliable Connection (RC) - SEND Only with Immediate" },
1216 { 0x6, "Reliable Connection (RC) - RDMA WRITE First" },
1217 { 0x7, "Reliable Connection (RC) - RDMA WRITE Middle" },
1218 { 0x8, "Reliable Connection (RC) - RDMA WRITE Last" },
1219 { 0x9, "Reliable Connection (RC) - RDMA WRITE Last with Immediate" },
1220 { 0xA, "Reliable Connection (RC) - RDMA WRITE Only" },
1221 { 0xB, "Reliable Connection (RC) - RDMA WRITE Only with Immediate" },
1222 { 0xC, "Reliable Connection (RC) - RDMA READ Request" },
1223 { 0xD, "Reliable Connection (RC) - RDMA READ response First" },
1224 { 0xE, "Reliable Connection (RC) - RDMA READ response Middle" },
1225 { 0xF, "Reliable Connection (RC) - RDMA READ response Last" },
1226 { 0x10, "Reliable Connection (RC) - RDMA READ response Only" },
1227 { 0x11, "Reliable Connection (RC) - Acknowledge" },
1228 { 0x12, "Reliable Connection (RC) - ATOMIC Acknowledge" },
1229 { 0x13, "Reliable Connection (RC) - CmpSwap" },
1230 { 0x14, "Reliable Connection (RC) - FetchAdd" },
1231 { 0x15, "Reliable Connection (RC) - Reserved" },
1232 { 0x16, "Reliable Connection (RC) - SEND Last with Invalidate" },
1233 { 0x17, "Reliable Connection (RC) - SEND Only with Invalidate" },
1234 { 0x20, "Unreliable Connection (UC) - SEND First" },
1235 { 0x21, "Unreliable Connection (UC) - SEND Middle" },
1236 { 0x22, "Unreliable Connection (UC) - SEND Last" },
1237 { 0x23, "Unreliable Connection (UC) - SEND Last with Immediate" },
1238 { 0x24, "Unreliable Connection (UC) - SEND Only" },
1239 { 0x25, "Unreliable Connection (UC) - SEND Only with Immediate" },
1240 { 0x26, "Unreliable Connection (UC) - RDMA WRITE First" },
1241 { 0x27, "Unreliable Connection (UC) - RDMA WRITE Middle" },
1242 { 0x28, "Unreliable Connection (UC) - RDMA WRITE Last" },
1243 { 0x29, "Unreliable Connection (UC) - RDMA WRITE Last with Immediate" },
1244 { 0x2A, "Unreliable Connection (UC) - RDMA WRITE Only" },
1245 { 0x2B, "Unreliable Connection (UC) - RDMA WRITE Only with Immediate" },
1246 { 0x40, "Reliable Datagram (RD) - SEND First" },
1247 { 0x41, "Reliable Datagram (RD) - SEND Middle" },
1248 { 0x42, "Reliable Datagram (RD) - SEND Last" },
1249 { 0x43, "Reliable Datagram (RD) - SEND Last with Immediate" },
1250 { 0x44, "Reliable Datagram (RD) - SEND Only" },
1251 { 0x45, "Reliable Datagram (RD) - SEND Only with Immediate" },
1252 { 0x46, "Reliable Datagram (RD) - RDMA WRITE First" },
1253 { 0x47, "Reliable Datagram (RD) - RDMA WRITE Middle" },
1254 { 0x48, "Reliable Datagram (RD) - RDMA WRITE Last" },
1255 { 0x49, "Reliable Datagram (RD) - RDMA WRITE Last with Immediate" },
1256 { 0x4A, "Reliable Datagram (RD) - RDMA WRITE Only" },
1257 { 0x4B, "Reliable Datagram (RD) - RDMA WRITE Only with Immediate" },
1258 { 0x4C, "Reliable Datagram (RD) - RDMA READ Request" },
1259 { 0x4D, "Reliable Datagram (RD) - RDMA READ response First" },
1260 { 0x4E, "Reliable Datagram (RD) - RDMA READ response Middle" },
1261 { 0x4F, "Reliable Datagram (RD) - RDMA READ response Last" },
1262 { 0x50, "Reliable Datagram (RD) - RDMA READ response Only" },
1263 { 0x51, "Reliable Datagram (RD) - Acknowledge" },
1264 { 0x52, "Reliable Datagram (RD) - ATOMIC Acknowledge" },
1265 { 0x53, "Reliable Datagram (RD) - CmpSwap" },
1266 { 0x54, "Reliable Datagram (RD) - FetchAdd" },
1267 { 0x55, "Reliable Datagram (RD) - RESYNC" },
1268 { 0x64, "Unreliable Datagram (UD) - SEND only" },
1269 { 0x65, "Unreliable Datagram (UD) - SEND only with Immediate" },
1271 { 0xA0, "Extended Reliable Connection (XRC) - SEND First" },
1272 { 0xA1, "Extended Reliable Connection (XRC) - SEND Middle" },
1273 { 0xA2, "Extended Reliable Connection (XRC) - SEND Last" },
1274 { 0xA3, "Extended Reliable Connection (XRC) - SEND Last with Immediate" },
1275 { 0xA4, "Extended Reliable Connection (XRC) - SEND Only" },
1276 { 0xA5, "Extended Reliable Connection (XRC) - SEND Only with Immediate" },
1277 { 0xA6, "Extended Reliable Connection (XRC) - RDMA WRITE First" },
1278 { 0xA7, "Extended Reliable Connection (XRC) - RDMA WRITE Middle" },
1279 { 0xA8, "Extended Reliable Connection (XRC) - RDMA WRITE Last" },
1280 { 0xA9, "Extended Reliable Connection (XRC) - RDMA WRITE Last with Immediate" },
1281 { 0xAA, "Extended Reliable Connection (XRC) - RDMA WRITE Only" },
1282 { 0xAB, "Extended Reliable Connection (XRC) - RDMA WRITE Only with Immediate" },
1283 { 0xAC, "Extended Reliable Connection (XRC) - RDMA READ Request" },
1284 { 0xAD, "Extended Reliable Connection (XRC) - RDMA READ response First" },
1285 { 0xAE, "Extended Reliable Connection (XRC) - RDMA READ response Middle" },
1286 { 0xAF, "Extended Reliable Connection (XRC) - RDMA READ response Last" },
1287 { 0xB0, "Extended Reliable Connection (XRC) - RDMA READ response Only" },
1288 { 0xB1, "Extended Reliable Connection (XRC) - Acknowledge" },
1289 { 0xB2, "Extended Reliable Connection (XRC) - ATOMIC Acknowledge" },
1290 { 0xB3, "Extended Reliable Connection (XRC) - CmpSwap" },
1291 { 0xB4, "Extended Reliable Connection (XRC) - FetchAdd" },
1292 { 0xB6, "Extended Reliable Connection (XRC) - SEND Last with Invalidate" },
1293 { 0xB7, "Extended Reliable Connection (XRC) - SEND Only with Invalidate" },
1297 #define AETH_SYNDROME_OPCODE_ACK 0
1298 #define AETH_SYNDROME_OPCODE_RNR_NAK 1
1299 #define AETH_SYNDROME_OPCODE_RES 2
1300 #define AETH_SYNDROME_OPCODE_NAK 3
1302 static const value_string aeth_syndrome_opcode_vals[]= {
1303 { AETH_SYNDROME_OPCODE_ACK, "Ack"},
1304 { AETH_SYNDROME_OPCODE_RNR_NAK, "RNR Nak"},
1305 { AETH_SYNDROME_OPCODE_RES, "Reserved"},
1306 { AETH_SYNDROME_OPCODE_NAK, "Nak"},
1310 static const value_string aeth_syndrome_nak_error_code_vals[]= {
1311 { 0, "PSN Sequence Error"},
1312 { 1, "Invalid Request"},
1313 { 2, "Remote Access Error"},
1314 { 3, "Remote Operational Error"},
1315 { 4, "Invalid RD Request"},
1319 static const value_string aeth_syndrome_timer_code_vals[]= {
1355 /* MAD Management Classes
1356 * Classes from the Common MAD Header
1358 * Management Class Name Class Description
1359 * ------------------------------------------------------------------------------------------------------------ */
1360 #define SUBN_LID_ROUTED 0x01 /* Subnet Management LID Route */
1361 #define SUBN_DIRECTED_ROUTE 0x81 /* Subnet Management Directed Route */
1362 #define SUBNADMN 0x03 /* Subnet Administration */
1363 #define PERF 0x04 /* Performance Management */
1364 #define BM 0x05 /* Baseboard Management (Tunneling of IB-ML commands through the IBA subnet) */
1365 #define DEV_MGT 0x06 /* Device Management */
1366 #define COM_MGT 0x07 /* Communication Management */
1367 #define SNMP 0x08 /* SNMP Tunneling (tunneling of the SNMP protocol through the IBA fabric) */
1368 #define VENDOR_1_START 0x09 /* Start of first Vendor Specific Range */
1369 #define VENDOR_1_END 0x0F /* End of first Vendor Specific Range */
1370 #define VENDOR_2_START 0x30 /* Start of second Vendor Specific Range */
1371 #define VENDOR_2_END 0x4F /* End of the second Vendor Specific Range */
1372 #define APPLICATION_START 0x10 /* Start of Application Specific Range */
1373 #define APPLICATION_END 0x2F /* End of Application Specific Range */
1375 /* Performance class Attributes */
1376 #define ATTR_PORT_COUNTERS 0x0012
1377 #define ATTR_PORT_COUNTERS_EXT 0x001D
1379 /* Link Next Header Values */
1380 #define IBA_GLOBAL 3
1382 #define IP_NON_IBA 1
1385 static const value_string OpCodeMap[] =
1387 { RC_SEND_FIRST, "RC Send First " },
1388 { RC_SEND_MIDDLE, "RC Send Middle "},
1389 { RC_SEND_LAST, "RC Send Last " },
1390 { RC_SEND_LAST_IMM, "RC Send Last Immediate "},
1391 { RC_SEND_ONLY, "RC Send Only "},
1392 { RC_SEND_ONLY_IMM, "RC Send Only Immediate "},
1393 { RC_RDMA_WRITE_FIRST, "RC RDMA Write First " },
1394 { RC_RDMA_WRITE_MIDDLE, "RC RDMA Write Middle "},
1395 { RC_RDMA_WRITE_LAST, "RC RDMA Write Last "},
1396 { RC_RDMA_WRITE_LAST_IMM, "RC RDMA Write Last Immediate " },
1397 { RC_RDMA_WRITE_ONLY, "RC RDMA Write Only " },
1398 { RC_RDMA_WRITE_ONLY_IMM, "RC RDMA Write Only Immediate "},
1399 { RC_RDMA_READ_REQUEST, "RC RDMA Read Request " },
1400 { RC_RDMA_READ_RESPONSE_FIRST, "RC RDMA Read Response First " },
1401 { RC_RDMA_READ_RESPONSE_MIDDLE, "RC RDMA Read Response Middle "},
1402 { RC_RDMA_READ_RESPONSE_LAST, "RC RDMA Read Response Last " },
1403 { RC_RDMA_READ_RESPONSE_ONLY, "RC RDMA Read Response Only "},
1404 { RC_ACKNOWLEDGE, "RC Acknowledge " },
1405 { RC_ATOMIC_ACKNOWLEDGE, "RC Atomic Acknowledge " },
1406 { RC_CMP_SWAP, "RC Compare Swap " },
1407 { RC_FETCH_ADD, "RC Fetch Add "},
1408 { RC_SEND_LAST_INVAL, "RC Send Last Invalidate "},
1409 { RC_SEND_ONLY_INVAL, "RC Send Only Invalidate " },
1411 { RD_SEND_FIRST, "RD Send First "},
1412 { RD_SEND_MIDDLE, "RD Send Middle " },
1413 { RD_SEND_LAST, "RD Send Last "},
1414 { RD_SEND_LAST_IMM, "RD Last Immediate " },
1415 { RD_SEND_ONLY, "RD Send Only "},
1416 { RD_SEND_ONLY_IMM, "RD Send Only Immediate "},
1417 { RD_RDMA_WRITE_FIRST, "RD RDMA Write First "},
1418 { RD_RDMA_WRITE_MIDDLE, "RD RDMA Write Middle "},
1419 { RD_RDMA_WRITE_LAST, "RD RDMA Write Last "},
1420 { RD_RDMA_WRITE_LAST_IMM, "RD RDMA Write Last Immediate "},
1421 { RD_RDMA_WRITE_ONLY, "RD RDMA Write Only "},
1422 { RD_RDMA_WRITE_ONLY_IMM, "RD RDMA Write Only Immediate "},
1423 { RD_RDMA_READ_REQUEST, "RD RDMA Read Request "},
1424 { RD_RDMA_READ_RESPONSE_FIRST, "RD RDMA Read Response First "},
1425 { RD_RDMA_READ_RESPONSE_MIDDLE, "RD RDMA Read Response Middle "},
1426 { RD_RDMA_READ_RESPONSE_LAST, "RD RDMA Read Response Last "},
1427 { RD_RDMA_READ_RESPONSE_ONLY, "RD RDMA Read Response Only "},
1428 { RD_ACKNOWLEDGE, "RD Acknowledge "},
1429 { RD_ATOMIC_ACKNOWLEDGE, "RD Atomic Acknowledge "},
1430 { RD_CMP_SWAP, "RD Compare Swap "},
1431 { RD_FETCH_ADD, "RD Fetch Add "},
1432 { RD_RESYNC, "RD RESYNC "},
1434 { UD_SEND_ONLY, "UD Send Only "},
1435 { UD_SEND_ONLY_IMM, "UD Send Only Immediate "},
1437 { UC_SEND_FIRST, "UC Send First "},
1438 { UC_SEND_MIDDLE, "UC Send Middle "},
1439 { UC_SEND_LAST, "UC Send Last "},
1440 { UC_SEND_LAST_IMM, "UC Send Last Immediate "},
1441 { UC_SEND_ONLY, "UC Send Only "},
1442 { UC_SEND_ONLY_IMM, "UC Send Only Immediate "},
1443 { UC_RDMA_WRITE_FIRST, "UC RDMA Write First"},
1444 { UC_RDMA_WRITE_MIDDLE, "UC RDMA Write Middle "},
1445 { UC_RDMA_WRITE_LAST, "UC RDMA Write Last "},
1446 { UC_RDMA_WRITE_LAST_IMM, "UC RDMA Write Last Immediate "},
1447 { UC_RDMA_WRITE_ONLY, "UC RDMA Write Only "},
1448 { UC_RDMA_WRITE_ONLY_IMM, "UC RDMA Write Only Immediate "},
1452 /* Mellanox DCT has the same opcodes as RD so will use the same RD macros */
1453 static const value_string DctOpCodeMap[] =
1455 { RD_SEND_FIRST, "DC Send First "},
1456 { RD_SEND_MIDDLE, "DC Send Middle " },
1457 { RD_SEND_LAST, "DC Send Last "},
1458 { RD_SEND_LAST_IMM, "DC Last Immediate " },
1459 { RD_SEND_ONLY, "DC Send Only "},
1460 { RD_SEND_ONLY_IMM, "DC Send Only Immediate "},
1461 { RD_RDMA_WRITE_FIRST, "DC RDMA Write First "},
1462 { RD_RDMA_WRITE_MIDDLE, "DC RDMA Write Middle "},
1463 { RD_RDMA_WRITE_LAST, "DC RDMA Write Last "},
1464 { RD_RDMA_WRITE_LAST_IMM, "DC RDMA Write Last Immediate "},
1465 { RD_RDMA_WRITE_ONLY, "DC RDMA Write Only "},
1466 { RD_RDMA_WRITE_ONLY_IMM, "DC RDMA Write Only Immediate "},
1467 { RD_RDMA_READ_REQUEST, "DC RDMA Read Request "},
1468 { RD_RDMA_READ_RESPONSE_FIRST, "DC RDMA Read Response First "},
1469 { RD_RDMA_READ_RESPONSE_MIDDLE, "DC RDMA Read Response Middle "},
1470 { RD_RDMA_READ_RESPONSE_LAST, "DC RDMA Read Response Last "},
1471 { RD_RDMA_READ_RESPONSE_ONLY, "DC RDMA Read Response Only "},
1472 { RD_ACKNOWLEDGE, "DC Acknowledge "},
1473 { RD_ATOMIC_ACKNOWLEDGE, "DC Atomic Acknowledge "},
1474 { RD_CMP_SWAP, "DC Compare Swap "},
1475 { RD_FETCH_ADD, "DC Fetch Add "},
1476 { RD_RESYNC, "DC Unknown Opcode "},
1480 /* Header Ordering Based on OPCODES
1481 * These are simply an enumeration of the possible header combinations defined by the IB Spec.
1482 * These enumerations
1483 * #DEFINE [HEADER_ORDER] [ENUM]
1484 * __________________________________ */
1485 #define RDETH_DETH_PAYLD 0
1486 /* __________________________________ */
1487 #define RDETH_DETH_RETH_PAYLD 1
1488 /* __________________________________ */
1489 #define RDETH_DETH_IMMDT_PAYLD 2
1490 /* __________________________________ */
1491 #define RDETH_DETH_RETH_IMMDT_PAYLD 3
1492 /* __________________________________ */
1493 #define RDETH_DETH_RETH 4
1494 /* __________________________________ */
1495 #define RDETH_AETH_PAYLD 5
1496 /* __________________________________ */
1497 #define RDETH_PAYLD 6
1498 /* __________________________________ */
1499 #define RDETH_AETH 7
1500 /* __________________________________ */
1501 #define RDETH_AETH_ATOMICACKETH 8
1502 /* __________________________________ */
1503 #define RDETH_DETH_ATOMICETH 9
1504 /* ___________________________________ */
1505 #define RDETH_DETH 10
1506 /* ___________________________________ */
1507 #define DETH_PAYLD 11
1508 /* ___________________________________ */
1509 #define DETH_IMMDT_PAYLD 12
1510 /* ___________________________________ */
1512 /* ___________________________________ */
1513 #define IMMDT_PAYLD 14
1514 /* ___________________________________ */
1515 #define RETH_PAYLD 15
1516 /* ___________________________________ */
1517 #define RETH_IMMDT_PAYLD 16
1518 /* ___________________________________ */
1520 /* ___________________________________ */
1521 #define AETH_PAYLD 18
1522 /* ___________________________________ */
1524 /* ___________________________________ */
1525 #define AETH_ATOMICACKETH 20
1526 /* ___________________________________ */
1527 #define ATOMICETH 21
1528 /* ___________________________________ */
1529 #define IETH_PAYLD 22
1530 /* ___________________________________ */
1532 /* ___________________________________ */
1535 /* Infiniband transport services
1536 These are an enumeration of the transport services over which an IB packet
1537 might be sent. The values match the corresponding 3 bits of the opCode field
1539 #define TRANSPORT_RC 0
1540 #define TRANSPORT_UC 1
1541 #define TRANSPORT_RD 2
1542 #define TRANSPORT_UD 3
1544 #define AETH_SYNDROME_RES 0x80
1545 #define AETH_SYNDROME_OPCODE 0x60
1546 #define AETH_SYNDROME_VALUE 0x1F
1549 /* Array of all availavle OpCodes to make matching a bit easier.
1550 * The OpCodes dictate the header sequence following in the packet.
1551 * These arrays tell the dissector which headers must be decoded for the given OpCode. */
1552 static guint32 opCode_RDETH_DETH_ATOMICETH[] = {
1556 static guint32 opCode_IETH_PAYLD[] = {
1560 static guint32 opCode_ATOMICETH[] = {
1564 static guint32 opCode_RDETH_DETH_RETH_PAYLD[] = {
1565 RD_RDMA_WRITE_FIRST,
1568 static guint32 opCode_RETH_IMMDT_PAYLD[] = {
1569 RC_RDMA_WRITE_ONLY_IMM,
1570 UC_RDMA_WRITE_ONLY_IMM
1572 static guint32 opCode_RDETH_DETH_IMMDT_PAYLD[] = {
1575 RD_RDMA_WRITE_LAST_IMM
1578 static guint32 opCode_RDETH_AETH_PAYLD[] = {
1579 RD_RDMA_READ_RESPONSE_FIRST,
1580 RD_RDMA_READ_RESPONSE_LAST,
1581 RD_RDMA_READ_RESPONSE_ONLY
1583 static guint32 opCode_AETH_PAYLD[] = {
1584 RC_RDMA_READ_RESPONSE_FIRST,
1585 RC_RDMA_READ_RESPONSE_LAST,
1586 RC_RDMA_READ_RESPONSE_ONLY
1588 static guint32 opCode_RETH_PAYLD[] = {
1589 RC_RDMA_WRITE_FIRST,
1591 UC_RDMA_WRITE_FIRST,
1595 static guint32 opCode_RDETH_DETH_PAYLD[] = {
1600 RD_RDMA_WRITE_MIDDLE,
1604 static guint32 opCode_IMMDT_PAYLD[] = {
1607 RC_RDMA_WRITE_LAST_IMM,
1610 UC_RDMA_WRITE_LAST_IMM
1613 static guint32 opCode_PAYLD[] = {
1618 RC_RDMA_WRITE_MIDDLE,
1620 RC_RDMA_READ_RESPONSE_MIDDLE,
1625 UC_RDMA_WRITE_MIDDLE,
1629 /* It is not necessary to create arrays for these OpCodes since they indicate only one further header.
1630 * We can just decode it directly
1632 * static guint32 opCode_DETH_IMMDT_PAYLD[] = {
1635 * static guint32 opCode_DETH_PAYLD[] = {
1638 * static guint32 opCode_RDETH_DETH[] = {
1641 * static guint32 opCode_RDETH_DETH_RETH[] = {
1642 * RD_RDMA_READ_REQUEST
1644 * static guint32 opCode_RDETH_DETH_RETH_IMMDT_PAYLD[] = {
1645 * RD_RDMA_WRITE_ONLY_IMM
1647 * static guint32 opCode_RDETH_AETH_ATOMICACKETH[] = {
1648 * RD_ATOMIC_ACKNOWLEDGE
1650 * static guint32 opCode_RDETH_AETH[] = {
1653 * static guint32 opCode_RDETH_PAYLD[] = {
1654 * RD_RDMA_READ_RESPONSE_MIDDLE
1656 * static guint32 opCode_AETH_ATOMICACKETH[] = {
1657 * RC_ATOMIC_ACKNOWLEDGE
1659 * static guint32 opCode_RETH[] = {
1660 * RC_RDMA_READ_REQUEST
1662 * static guint32 opCode_AETH[] = {
1666 /* settings to be set by the user via the preferences dialog */
1667 static guint pref_rroce_udp_port = DEFAULT_RROCE_UDP_PORT;
1668 static gboolean try_heuristic_first = TRUE;
1670 /* saves information about connections that have been/are in the process of being
1671 negotiated via ConnectionManagement packets */
1673 guint8 req_gid[GID_SIZE],
1674 resp_gid[GID_SIZE]; /* GID of requester/responder, respectively */
1676 resp_lid; /* LID of requester/responder, respectively */
1678 resp_qp; /* QP number of requester/responder, respectively */
1679 guint64 service_id; /* service id for this connection */
1680 } connection_context;
1682 /* holds a table of connection contexts being negotiated by CM. the key is a obtained
1683 using add_address_to_hash64(initiator address, TransactionID) */
1684 static GHashTable *CM_context_table = NULL;
1686 /* heuristics sub-dissectors list for dissecting the data payload of IB packets */
1687 static heur_dissector_list_t heur_dissectors_payload;
1688 /* heuristics sub-dissectors list for dissecting the PrivateData of CM packets */
1689 static heur_dissector_list_t heur_dissectors_cm_private;
1691 /* ----- This sections contains various utility functions indirectly related to Infiniband dissection ---- */
1692 static void infiniband_payload_prompt(packet_info *pinfo _U_, gchar* result)
1694 g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "Dissect Infiniband payload as");
1697 static void table_destroy_notify(gpointer data) {
1701 /* --------------------------------------------------------------------------------------------------------*/
1702 /* Helper dissector for correctly dissecting RRoCE packets (encapsulated within an IP */
1703 /* frame). The only difference from regular IB packets is that RRoCE packets do not contain */
1704 /* a LRH, and always start with a BTH. */
1706 dissect_rroce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1708 /* this is a RRoCE packet, so signal the IB dissector not to look for LRH/GRH */
1709 dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_BTH);
1710 return tvb_captured_length(tvb);
1713 /* Helper dissector for correctly dissecting RoCE packets (encapsulated within an Ethernet */
1714 /* frame). The only difference from regular IB packets is that RoCE packets do not contain */
1715 /* a LRH, and always start with a GRH. */
1717 dissect_roce(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1719 /* this is a RoCE packet, so signal the IB dissector not to look for LRH */
1720 dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_GRH);
1721 return tvb_captured_length(tvb);
1725 dissect_infiniband(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1727 dissect_infiniband_common(tvb, pinfo, tree, IB_PACKET_STARTS_WITH_LRH);
1728 return tvb_captured_length(tvb);
1731 /* Common Dissector for both InfiniBand and RoCE packets
1733 * tvb - The tvbbuff of packet data
1734 * pinfo - The packet info structure with column information
1735 * tree - The tree structure under which field nodes are to be added
1736 * starts_with - regular IB packet starts with LRH, ROCE starts with GRH and RROCE starts with BTH,
1737 * this tells the parser what headers of (LRH/GRH) to skip.
1739 * 1.) Floating "offset+=" statements should probably be "functionized" but they are inline
1740 * Offset is only passed by reference in specific places, so do not be confused when following code
1741 * In any code path, adding up "offset+=" statements will tell you what byte you are at */
1743 dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ib_packet_start_header starts_with)
1745 /* Top Level Item */
1746 proto_item *infiniband_packet;
1748 /* The Headers Subtree */
1749 proto_tree *all_headers_tree;
1751 /* BTH - Base Trasport Header */
1752 gboolean dctBthHeader = FALSE;
1755 /* LRH - Local Route Header */
1756 proto_item *local_route_header_item;
1757 proto_tree *local_route_header_tree;
1760 proto_item *RAWDATA_header_item;
1761 guint8 lnh_val; /* Link Next Header Value */
1762 gint offset = 0; /* Current Offset */
1764 /* General Variables */
1765 gboolean bthFollows = FALSE; /* Tracks if we are parsing a BTH. This is a significant decision point */
1766 struct infinibandinfo info = { 0, FALSE, 0, NULL, 0, 0, 0 };
1767 gint32 nextHeaderSequence = -1; /* defined by this dissector. #define which indicates the upcoming header sequence from OpCode */
1768 guint8 nxtHdr = 0; /* Keyed off for header dissection order */
1769 guint16 packetLength = 0; /* Packet Length. We track this as tvb_length - offset. */
1770 /* It provides the parsing methods a known size */
1771 /* that must be available for that header. */
1772 gint crc_length = 0;
1775 void *src_addr, /* the address to be displayed in the source/destination columns */
1776 *dst_addr; /* (lid/gid number) will be stored here */
1778 pinfo->srcport = pinfo->destport = 0xffffffff; /* set the src/dest QPN to something impossible instead of the default 0,
1779 so we don't mistake it for a MAD. (QP is only 24bit, so can't be 0xffffffff)*/
1781 pinfo->ptype = PT_IBQP; /* set the port-type for this packet to be Infiniband QP number */
1783 /* Mark the Packet type as Infiniband in the wireshark UI */
1784 /* Clear other columns */
1785 col_set_str(pinfo->cinfo, COL_PROTOCOL, "InfiniBand");
1786 col_clear(pinfo->cinfo, COL_INFO);
1788 /* Top Level Packet */
1789 infiniband_packet = proto_tree_add_item(tree, proto_infiniband, tvb, offset, -1, ENC_NA);
1791 /* Headers Level Tree */
1792 all_headers_tree = proto_item_add_subtree(infiniband_packet, ett_all_headers);
1794 if (starts_with == IB_PACKET_STARTS_WITH_GRH) {
1795 /* this is a RoCE packet, skip LRH parsing */
1796 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RoCE");
1797 lnh_val = IBA_GLOBAL;
1798 packetLength = tvb_reported_length_remaining(tvb, offset);
1802 else if (starts_with == IB_PACKET_STARTS_WITH_BTH) {
1803 /* this is a RRoCE packet, skip LRH/GRH parsing and go directly to BTH */
1804 col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRoCE");
1805 lnh_val = IBA_LOCAL;
1806 packetLength = tvb_reported_length_remaining(tvb, offset);
1811 /* Local Route Header Subtree */
1812 local_route_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_LRH, tvb, offset, 8, ENC_NA);
1813 proto_item_set_text(local_route_header_item, "%s", "Local Route Header");
1814 local_route_header_tree = proto_item_add_subtree(local_route_header_item, ett_lrh);
1816 proto_tree_add_item(local_route_header_tree, hf_infiniband_virtual_lane, tvb, offset, 1, ENC_BIG_ENDIAN);
1818 proto_tree_add_item(local_route_header_tree, hf_infiniband_link_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1820 proto_tree_add_item(local_route_header_tree, hf_infiniband_service_level, tvb, offset, 1, ENC_BIG_ENDIAN);
1822 proto_tree_add_item(local_route_header_tree, hf_infiniband_reserved2, tvb, offset, 1, ENC_NA);
1823 proto_tree_add_item(local_route_header_tree, hf_infiniband_link_next_header, tvb, offset, 1, ENC_BIG_ENDIAN);
1826 /* Save Link Next Header... This tells us what the next header is. */
1827 lnh_val = tvb_get_guint8(tvb, offset);
1828 lnh_val = lnh_val & 0x03;
1832 proto_tree_add_item(local_route_header_tree, hf_infiniband_destination_local_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1835 /* Set destination in packet view. */
1836 dst_addr = wmem_alloc(pinfo->pool, sizeof(guint16));
1837 *((guint16*) dst_addr) = tvb_get_ntohs(tvb, offset);
1838 set_address(&pinfo->dst, AT_IB, sizeof(guint16), dst_addr);
1842 proto_tree_add_item(local_route_header_tree, hf_infiniband_reserved5, tvb, offset, 2, ENC_BIG_ENDIAN);
1844 packetLength = tvb_get_ntohs(tvb, offset); /* Get the Packet Length. This will determine payload size later on. */
1845 packetLength = packetLength & 0x07FF; /* Mask off top 5 bits, they are reserved */
1846 packetLength = packetLength * 4; /* Multiply by 4 to get true byte length. This is by specification. */
1847 /* PktLen is size in 4 byte words (byteSize /4). */
1849 proto_tree_add_item(local_route_header_tree, hf_infiniband_packet_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1851 proto_tree_add_item(local_route_header_tree, hf_infiniband_source_local_id, tvb, offset, 2, ENC_BIG_ENDIAN);
1853 /* Set Source in packet view. */
1854 src_addr = wmem_alloc(pinfo->pool, sizeof(guint16));
1855 *((guint16*) src_addr) = tvb_get_ntohs(tvb, offset);
1856 set_address(&pinfo->src, AT_IB, sizeof(guint16), src_addr);
1859 packetLength -= 8; /* Shave 8 bytes for the LRH. */
1863 /* Key off Link Next Header. This tells us what High Level Data Format we have */
1867 proto_item *global_route_header_item;
1868 proto_tree *global_route_header_tree;
1870 global_route_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_GRH, tvb, offset, 40, ENC_NA);
1871 proto_item_set_text(global_route_header_item, "%s", "Global Route Header");
1872 global_route_header_tree = proto_item_add_subtree(global_route_header_item, ett_grh);
1874 proto_tree_add_item(global_route_header_tree, hf_infiniband_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1875 proto_tree_add_item(global_route_header_tree, hf_infiniband_traffic_class, tvb, offset, 2, ENC_BIG_ENDIAN);
1876 proto_tree_add_item(global_route_header_tree, hf_infiniband_flow_label, tvb, offset, 4, ENC_BIG_ENDIAN);
1879 proto_tree_add_item(global_route_header_tree, hf_infiniband_payload_length, tvb, offset, 2, ENC_BIG_ENDIAN);
1882 nxtHdr = tvb_get_guint8(tvb, offset);
1884 proto_tree_add_item(global_route_header_tree, hf_infiniband_next_header, tvb, offset, 1, ENC_BIG_ENDIAN);
1886 proto_tree_add_item(global_route_header_tree, hf_infiniband_hop_limit, tvb, offset, 1, ENC_BIG_ENDIAN);
1888 proto_tree_add_item(global_route_header_tree, hf_infiniband_source_gid, tvb, offset, 16, ENC_NA);
1890 /* set source GID in packet view*/
1891 set_address_tvb(&pinfo->src, AT_IB, GID_SIZE, tvb, offset);
1894 proto_tree_add_item(global_route_header_tree, hf_infiniband_destination_gid, tvb, offset, 16, ENC_NA);
1895 /* set destination GID in packet view*/
1896 set_address_tvb(&pinfo->dst, AT_IB, GID_SIZE, tvb, offset);
1899 packetLength -= 40; /* Shave 40 bytes for GRH */
1903 /* Some kind of packet being transported globally with IBA, but locally it is not IBA - no BTH following. */
1907 /* otherwise fall through and start parsing BTH */
1910 proto_item *base_transport_header_item;
1911 proto_tree *base_transport_header_tree;
1913 /* Get the OpCode - this tells us what headers are following */
1914 info.opCode = tvb_get_guint8(tvb, offset);
1916 if ((info.opCode >> 5) == 0x2) {
1917 info.dctConnect = !(tvb_get_guint8(tvb, offset + 1) & 0x80);
1918 dctBthHeader = TRUE;
1922 base_transport_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_BTH, tvb, offset, bthSize, ENC_NA);
1923 proto_item_set_text(base_transport_header_item, "%s", "Base Transport Header");
1924 base_transport_header_tree = proto_item_add_subtree(base_transport_header_item, ett_bth);
1925 proto_tree_add_item(base_transport_header_tree, hf_infiniband_opcode, tvb, offset, 1, ENC_BIG_ENDIAN);
1928 /* since DCT uses the same opcodes as RD we will use another name mapping */
1929 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const((guint32)info.opCode, DctOpCodeMap, "Unknown OpCode"));
1932 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const((guint32)info.opCode, OpCodeMap, "Unknown OpCode"));
1936 proto_tree_add_item(base_transport_header_tree, hf_infiniband_solicited_event, tvb, offset, 1, ENC_BIG_ENDIAN);
1937 proto_tree_add_item(base_transport_header_tree, hf_infiniband_migreq, tvb, offset, 1, ENC_BIG_ENDIAN);
1938 proto_tree_add_item(base_transport_header_tree, hf_infiniband_pad_count, tvb, offset, 1, ENC_BIG_ENDIAN);
1939 proto_tree_add_item(base_transport_header_tree, hf_infiniband_transport_header_version, tvb, offset, 1, ENC_BIG_ENDIAN);
1941 proto_tree_add_item(base_transport_header_tree, hf_infiniband_partition_key, tvb, offset, 2, ENC_BIG_ENDIAN);
1943 proto_tree_add_item(base_transport_header_tree, hf_infiniband_reserved, tvb, offset, 1, ENC_NA);
1945 proto_tree_add_item_ret_uint(base_transport_header_tree, hf_infiniband_destination_qp, tvb, offset, 3, ENC_BIG_ENDIAN, &pinfo->destport);
1946 col_append_fstr(pinfo->cinfo, COL_INFO, "QP=0x%06x ", pinfo->destport);
1948 proto_tree_add_item(base_transport_header_tree, hf_infiniband_acknowledge_request, tvb, offset, 1, ENC_BIG_ENDIAN);
1949 proto_tree_add_item(base_transport_header_tree, hf_infiniband_reserved7, tvb, offset, 1, ENC_BIG_ENDIAN);
1951 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);
1953 offset += bthSize - 12;
1954 packetLength -= bthSize; /* Shave bthSize for Base Transport Header */
1958 /* Raw IPv6 Packet */
1959 dst_addr = wmem_strdup(pinfo->pool, "IPv6 over IB Packet");
1960 set_address(&pinfo->dst, AT_STRINGZ, (int)strlen((char *)dst_addr)+1, dst_addr);
1962 parse_IPvSix(all_headers_tree, tvb, &offset, pinfo);
1965 parse_RWH(all_headers_tree, tvb, &offset, pinfo, tree);
1968 /* Unknown Packet */
1969 RAWDATA_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_raw_data, tvb, offset, -1, ENC_NA);
1970 proto_item_set_text(RAWDATA_header_item, "%s", "Unknown Raw Data - IB Encapsulated");
1974 /* Base Transport header is hit quite often, however it is alone since it is the exception not the rule */
1975 /* Only IBA Local packets use it */
1978 /* Find our next header sequence based on the Opcode
1979 * Each case decrements the packetLength by the amount of bytes consumed by each header.
1980 * The find_next_header_sequence method could be used to automate this.
1981 * We need to keep track of this so we know much data to mark as payload/ICRC/VCRC values. */
1983 nextHeaderSequence = find_next_header_sequence(&info);
1985 /* find_next_header_sequence gives us the DEFINE value corresponding to the header order following */
1986 /* Enumerations are named intuitively, e.g. RDETH DETH PAYLOAD means there is an RDETH Header, DETH Header, and a packet payload */
1987 switch (nextHeaderSequence)
1989 case RDETH_DETH_PAYLD:
1990 parse_RDETH(all_headers_tree, tvb, &offset);
1991 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
1993 packetLength -= 4; /* RDETH */
1994 packetLength -= 8; /* DETH */
1996 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
1998 case RDETH_DETH_RETH_PAYLD:
1999 parse_RDETH(all_headers_tree, tvb, &offset);
2000 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2001 parse_RETH(all_headers_tree, tvb, &offset, &info);
2003 packetLength -= 4; /* RDETH */
2004 packetLength -= 8; /* DETH */
2005 packetLength -= 16; /* RETH */
2007 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2009 case RDETH_DETH_IMMDT_PAYLD:
2010 parse_RDETH(all_headers_tree, tvb, &offset);
2011 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2012 parse_IMMDT(all_headers_tree, tvb, &offset);
2014 packetLength -= 4; /* RDETH */
2015 packetLength -= 8; /* DETH */
2016 packetLength -= 4; /* IMMDT */
2018 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2020 case RDETH_DETH_RETH_IMMDT_PAYLD:
2021 parse_RDETH(all_headers_tree, tvb, &offset);
2022 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2023 parse_RETH(all_headers_tree, tvb, &offset, &info);
2024 parse_IMMDT(all_headers_tree, tvb, &offset);
2026 packetLength -= 4; /* RDETH */
2027 packetLength -= 8; /* DETH */
2028 packetLength -= 16; /* RETH */
2029 packetLength -= 4; /* IMMDT */
2031 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2033 case RDETH_DETH_RETH:
2034 parse_RDETH(all_headers_tree, tvb, &offset);
2035 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2036 parse_RETH(all_headers_tree, tvb, &offset, &info);
2038 /*packetLength -= 4;*/ /* RDETH */
2039 /*packetLength -= 8;*/ /* DETH */
2040 /*packetLength -= 16;*/ /* RETH */
2043 case RDETH_AETH_PAYLD:
2044 parse_RDETH(all_headers_tree, tvb, &offset);
2045 parse_AETH(all_headers_tree, tvb, &offset);
2047 packetLength -= 4; /* RDETH */
2048 packetLength -= 4; /* AETH */
2050 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2053 parse_RDETH(all_headers_tree, tvb, &offset);
2055 packetLength -= 4; /* RDETH */
2057 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2060 parse_AETH(all_headers_tree, tvb, &offset);
2062 /*packetLength -= 4;*/ /* RDETH */
2063 /*packetLength -= 4;*/ /* AETH */
2067 case RDETH_AETH_ATOMICACKETH:
2068 parse_RDETH(all_headers_tree, tvb, &offset);
2069 parse_AETH(all_headers_tree, tvb, &offset);
2070 parse_ATOMICACKETH(all_headers_tree, tvb, &offset);
2072 /*packetLength -= 4;*/ /* RDETH */
2073 /*packetLength -= 4;*/ /* AETH */
2074 /*packetLength -= 8;*/ /* AtomicAckETH */
2078 case RDETH_DETH_ATOMICETH:
2079 parse_RDETH(all_headers_tree, tvb, &offset);
2080 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2081 parse_ATOMICETH(all_headers_tree, tvb, &offset);
2083 /*packetLength -= 4;*/ /* RDETH */
2084 /*packetLength -= 8;*/ /* DETH */
2085 /*packetLength -= 28;*/ /* AtomicETH */
2089 parse_RDETH(all_headers_tree, tvb, &offset);
2090 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2092 /*packetLength -= 4;*/ /* RDETH */
2093 /*packetLength -= 8;*/ /* DETH */
2097 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2099 packetLength -= 8; /* DETH */
2101 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2105 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2108 parse_IMMDT(all_headers_tree, tvb, &offset);
2110 packetLength -= 4; /* IMMDT */
2112 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2114 case RETH_IMMDT_PAYLD:
2115 parse_RETH(all_headers_tree, tvb, &offset, &info);
2116 parse_IMMDT(all_headers_tree, tvb, &offset);
2118 packetLength -= 16; /* RETH */
2119 packetLength -= 4; /* IMMDT */
2121 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2124 parse_RETH(all_headers_tree, tvb, &offset, &info);
2126 packetLength -= 16; /* RETH */
2128 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2131 parse_RETH(all_headers_tree, tvb, &offset, &info);
2133 packetLength -= 16; /* RETH */
2134 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2138 parse_AETH(all_headers_tree, tvb, &offset);
2140 packetLength -= 4; /* AETH */
2142 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2145 parse_AETH(all_headers_tree, tvb, &offset);
2147 /*packetLength -= 4;*/ /* AETH */
2150 case AETH_ATOMICACKETH:
2151 parse_AETH(all_headers_tree, tvb, &offset);
2152 parse_ATOMICACKETH(all_headers_tree, tvb, &offset);
2154 /*packetLength -= 4;*/ /* AETH */
2155 /*packetLength -= 8;*/ /* AtomicAckETH */
2159 parse_ATOMICETH(all_headers_tree, tvb, &offset);
2161 /*packetLength -= 28;*/ /* AtomicETH */
2165 parse_IETH(all_headers_tree, tvb, &offset);
2167 packetLength -= 4; /* IETH */
2169 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2171 case DETH_IMMDT_PAYLD:
2172 parse_DETH(all_headers_tree, pinfo, tvb, &offset);
2173 parse_IMMDT(all_headers_tree, tvb, &offset);
2175 packetLength -= 8; /* DETH */
2176 packetLength -= 4; /* IMMDT */
2178 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2181 parse_DCCETH(all_headers_tree, tvb, &offset);
2182 packetLength -= 16; /* DCCETH */
2184 parse_PAYLOAD(all_headers_tree, pinfo, &info, tvb, &offset, packetLength, crclen, tree);
2188 parse_VENDOR(all_headers_tree, tvb, &offset);
2194 /* Display the ICRC/VCRC */
2195 /* Doing it this way rather than in a variety of places according to the specific packet */
2196 /* If we've already displayed it crc_length comes out 0 */
2197 crc_length = tvb_reported_length_remaining(tvb, offset);
2198 if (crc_length == 6)
2200 proto_tree_add_item(all_headers_tree, hf_infiniband_invariant_crc, tvb, offset, 4, ENC_BIG_ENDIAN);
2202 proto_tree_add_item(all_headers_tree, hf_infiniband_variant_crc, tvb, offset, 2, ENC_BIG_ENDIAN);
2205 else if (crc_length == 4)
2207 proto_tree_add_item(all_headers_tree, hf_infiniband_invariant_crc, tvb, offset, 4, ENC_BIG_ENDIAN);
2210 else if (crc_length == 2)
2212 proto_tree_add_item(all_headers_tree, hf_infiniband_variant_crc, tvb, offset, 2, ENC_BIG_ENDIAN);
2219 dissect_infiniband_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
2221 /* Top Level Item */
2222 proto_item *infiniband_link_packet;
2224 /* The Link Subtree */
2225 proto_tree *link_tree;
2227 proto_item *operand_item;
2228 gint offset = 0; /* Current Offset */
2229 guint8 operand; /* Link packet Operand */
2231 operand = tvb_get_guint8(tvb, offset);
2232 operand = (operand & 0xF0) >> 4;
2234 /* Mark the Packet type as Infiniband in the wireshark UI */
2235 /* Clear other columns */
2236 col_set_str(pinfo->cinfo, COL_PROTOCOL, "InfiniBand Link");
2237 col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
2238 val_to_str(operand, Operand_Description, "Unknown (0x%1x)"));
2240 /* Assigns column values */
2241 dissect_general_info(tvb, offset, pinfo, IB_PACKET_STARTS_WITH_LRH);
2243 /* Top Level Packet */
2244 infiniband_link_packet = proto_tree_add_item(tree, proto_infiniband_link, tvb, offset, -1, ENC_NA);
2246 /* Headers Level Tree */
2247 link_tree = proto_item_add_subtree(infiniband_link_packet, ett_link);
2249 operand_item = proto_tree_add_item(link_tree, hf_infiniband_link_op, tvb, offset, 2, ENC_BIG_ENDIAN);
2252 proto_item_set_text(operand_item, "%s", "Reserved");
2253 call_data_dissector(tvb, pinfo, link_tree);
2255 proto_tree_add_item(link_tree, hf_infiniband_link_fctbs, tvb, offset, 2, ENC_BIG_ENDIAN);
2258 proto_tree_add_item(link_tree, hf_infiniband_link_vl, tvb, offset, 2, ENC_BIG_ENDIAN);
2259 proto_tree_add_item(link_tree, hf_infiniband_link_fccl, tvb, offset, 2, ENC_BIG_ENDIAN);
2262 proto_tree_add_item(link_tree, hf_infiniband_link_lpcrc, tvb, offset, 2, ENC_BIG_ENDIAN);
2265 return tvb_captured_length(tvb);
2269 /* Description: Finds the header sequence that follows the Base Transport Header.
2270 * Somwhat inefficient (should be using a single key,value pair data structure)
2271 * But uses pure probablity to take a stab at better efficiency.
2272 * Searches largest header sequence groups first, and then finally resorts to single matches for unique header sequences
2273 * IN: OpCode: The OpCode from the Base Transport Header.
2274 * OUT: The Header Sequence enumeration. See Declarations for #defines from (0-22) */
2276 find_next_header_sequence(struct infinibandinfo* ibInfo)
2278 if (ibInfo->opCode == 0x55)
2279 return ibInfo->dctConnect ? DCCETH : PAYLD;
2281 if (contains(ibInfo->opCode, &opCode_PAYLD[0], (gint32)array_length(opCode_PAYLD)))
2284 if (contains(ibInfo->opCode, &opCode_IMMDT_PAYLD[0], (gint32)array_length(opCode_IMMDT_PAYLD)))
2287 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_PAYLD[0], (gint32)array_length(opCode_RDETH_DETH_PAYLD)))
2288 return RDETH_DETH_PAYLD;
2290 if (contains(ibInfo->opCode, &opCode_RETH_PAYLD[0], (gint32)array_length(opCode_RETH_PAYLD)))
2293 if (contains(ibInfo->opCode, &opCode_RDETH_AETH_PAYLD[0], (gint32)array_length(opCode_RDETH_AETH_PAYLD)))
2294 return RDETH_AETH_PAYLD;
2296 if (contains(ibInfo->opCode, &opCode_AETH_PAYLD[0], (gint32)array_length(opCode_AETH_PAYLD)))
2299 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_IMMDT_PAYLD[0], (gint32)array_length(opCode_RDETH_DETH_IMMDT_PAYLD)))
2300 return RDETH_DETH_IMMDT_PAYLD;
2302 if (contains(ibInfo->opCode, &opCode_RETH_IMMDT_PAYLD[0], (gint32)array_length(opCode_RETH_IMMDT_PAYLD)))
2303 return RETH_IMMDT_PAYLD;
2305 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_RETH_PAYLD[0], (gint32)array_length(opCode_RDETH_DETH_RETH_PAYLD)))
2306 return RDETH_DETH_RETH_PAYLD;
2308 if (contains(ibInfo->opCode, &opCode_ATOMICETH[0], (gint32)array_length(opCode_ATOMICETH)))
2311 if (contains(ibInfo->opCode, &opCode_IETH_PAYLD[0], (gint32)array_length(opCode_IETH_PAYLD)))
2314 if (contains(ibInfo->opCode, &opCode_RDETH_DETH_ATOMICETH[0], (gint32)array_length(opCode_RDETH_DETH_ATOMICETH)))
2315 return RDETH_DETH_ATOMICETH;
2317 if ((ibInfo->opCode ^ RC_ACKNOWLEDGE) == 0)
2320 if ((ibInfo->opCode ^ RC_RDMA_READ_REQUEST) == 0)
2323 if ((ibInfo->opCode ^ RC_ATOMIC_ACKNOWLEDGE) == 0)
2324 return AETH_ATOMICACKETH;
2326 if ((ibInfo->opCode ^ RD_RDMA_READ_RESPONSE_MIDDLE) == 0)
2329 if ((ibInfo->opCode ^ RD_ACKNOWLEDGE) == 0)
2332 if ((ibInfo->opCode ^ RD_ATOMIC_ACKNOWLEDGE) == 0)
2333 return RDETH_AETH_ATOMICACKETH;
2335 if ((ibInfo->opCode ^ RD_RDMA_WRITE_ONLY_IMM) == 0)
2336 return RDETH_DETH_RETH_IMMDT_PAYLD;
2338 if ((ibInfo->opCode ^ RD_RDMA_READ_REQUEST) == 0)
2339 return RDETH_DETH_RETH;
2341 if ((ibInfo->opCode ^ RD_RESYNC) == 0)
2344 if ((ibInfo->opCode ^ UD_SEND_ONLY) == 0)
2347 if ((ibInfo->opCode ^ UD_SEND_ONLY_IMM) == 0)
2348 return DETH_IMMDT_PAYLD;
2353 /* Description: Finds if a given value is present in an array. This is probably in a standard library somewhere,
2354 * But I'd rather define my own.
2355 * IN: OpCode: The OpCode you are looking for
2356 * IN: Codes: The organized array of OpCodes to look through
2357 * IN: Array length, because we're in C++...
2358 * OUT: Boolean indicating if that OpCode was found in OpCodes */
2360 contains(guint32 OpCode, guint32* Codes, gint32 length)
2363 for (i = 0; i < length; i++)
2365 if ((OpCode ^ Codes[i]) == 0)
2371 /* Parse RDETH - Reliable Datagram Extended Transport Header
2372 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2373 * IN: tvb - the data buffer from wireshark
2374 * IN/OUT: The current and updated offset */
2376 parse_RDETH(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2378 gint local_offset = *offset;
2379 /* RDETH - Reliable Datagram Extended Transport Header */
2380 proto_item *RDETH_header_item;
2381 proto_tree *RDETH_header_tree;
2383 RDETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_RDETH, tvb, local_offset, 4, ENC_NA);
2384 proto_item_set_text(RDETH_header_item, "%s", "RDETH - Reliable Datagram Extended Transport Header");
2385 RDETH_header_tree = proto_item_add_subtree(RDETH_header_item, ett_rdeth);
2387 proto_tree_add_item(RDETH_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
2389 proto_tree_add_item(RDETH_header_tree, hf_infiniband_ee_context, tvb, local_offset, 3, ENC_BIG_ENDIAN);
2391 *offset = local_offset;
2394 /* Parse DETH - Datagram Extended Transport Header
2395 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2396 * IN: tvb - the data buffer from wireshark
2397 * IN/OUT: The current and updated offset */
2399 parse_DETH(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, gint *offset)
2401 gint local_offset = *offset;
2402 /* DETH - Datagram Extended Transport Header */
2403 proto_item *DETH_header_item;
2404 proto_tree *DETH_header_tree;
2406 DETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_DETH, tvb, local_offset, 8, ENC_NA);
2407 proto_item_set_text(DETH_header_item, "%s", "DETH - Datagram Extended Transport Header");
2408 DETH_header_tree = proto_item_add_subtree(DETH_header_item, ett_deth);
2410 proto_tree_add_item(DETH_header_tree, hf_infiniband_queue_key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2412 proto_tree_add_item(DETH_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
2414 proto_tree_add_item(DETH_header_tree, hf_infiniband_source_qp, tvb, local_offset, 3, ENC_BIG_ENDIAN);
2415 pinfo->srcport = tvb_get_ntoh24(tvb, local_offset);
2418 *offset = local_offset;
2421 /* Parse DETH - DC Connected Extended Transport Header
2422 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2423 * IN: dctConnect - True if this is a DCT-Connect packet.
2424 * IN: tvb - the data buffer from wireshark
2425 * IN/OUT: The current and updated offset */
2427 parse_DCCETH(proto_tree *parentTree _U_, tvbuff_t *tvb _U_, gint *offset)
2429 /* Do nothing just skip the header size */
2433 /* Parse RETH - RDMA Extended Transport Header
2434 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2435 * IN: tvb - the data buffer from wireshark
2436 * IN/OUT: The current and updated offset
2437 * OUT: Updated info->reth_remote_key
2438 * OUT: Updated info->reth_dma_length */
2440 parse_RETH(proto_tree * parentTree, tvbuff_t *tvb, gint *offset,
2441 struct infinibandinfo *info)
2443 gint local_offset = *offset;
2444 /* RETH - RDMA Extended Transport Header */
2445 proto_item *RETH_header_item;
2446 proto_tree *RETH_header_tree;
2448 RETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_RETH, tvb, local_offset, 16, ENC_NA);
2449 proto_item_set_text(RETH_header_item, "%s", "RETH - RDMA Extended Transport Header");
2450 RETH_header_tree = proto_item_add_subtree(RETH_header_item, ett_reth);
2452 proto_tree_add_item(RETH_header_tree, hf_infiniband_virtual_address, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2454 proto_tree_add_item_ret_uint(RETH_header_tree, hf_infiniband_remote_key, tvb, local_offset, 4, ENC_BIG_ENDIAN, &info->reth_remote_key);
2456 proto_tree_add_item_ret_uint(RETH_header_tree, hf_infiniband_dma_length, tvb, local_offset, 4, ENC_BIG_ENDIAN, &info->reth_dma_length);
2459 *offset = local_offset;
2462 /* Parse AtomicETH - Atomic Extended Transport Header
2463 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2464 * IN: tvb - the data buffer from wireshark
2465 * IN/OUT: The current and updated offset */
2467 parse_ATOMICETH(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2469 gint local_offset = *offset;
2470 /* AtomicETH - Atomic Extended Transport Header */
2471 proto_item *ATOMICETH_header_item;
2472 proto_tree *ATOMICETH_header_tree;
2474 ATOMICETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_AtomicETH, tvb, local_offset, 28, ENC_NA);
2475 proto_item_set_text(ATOMICETH_header_item, "%s", "AtomicETH - Atomic Extended Transport Header");
2476 ATOMICETH_header_tree = proto_item_add_subtree(ATOMICETH_header_item, ett_atomiceth);
2478 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_virtual_address, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2480 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_remote_key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
2482 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_swap_or_add_data, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2484 proto_tree_add_item(ATOMICETH_header_tree, hf_infiniband_compare_data, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2486 *offset = local_offset;
2489 /* Parse AETH - ACK Extended Transport Header
2490 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2491 * IN: tvb - the data buffer from wireshark
2492 * IN/OUT: The current and updated offset */
2494 parse_AETH(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2496 gint local_offset = *offset;
2497 /* AETH - ACK Extended Transport Header */
2498 proto_item *AETH_header_item;
2499 proto_tree *AETH_header_tree;
2500 proto_item *AETH_syndrome_item;
2501 proto_tree *AETH_syndrome_tree;
2504 AETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_AETH, tvb, local_offset, 4, ENC_NA);
2505 proto_item_set_text(AETH_header_item, "%s", "AETH - ACK Extended Transport Header");
2506 AETH_header_tree = proto_item_add_subtree(AETH_header_item, ett_aeth);
2508 AETH_syndrome_item = proto_tree_add_item(AETH_header_tree, hf_infiniband_syndrome, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2509 AETH_syndrome_tree = proto_item_add_subtree(AETH_syndrome_item, ett_aeth_syndrome);
2510 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2511 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_opcode, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2512 opcode = ((tvb_get_guint8(tvb, local_offset) & AETH_SYNDROME_OPCODE) >> 5);
2513 proto_item_append_text(AETH_syndrome_item, ", %s", val_to_str_const(opcode, aeth_syndrome_opcode_vals, "Unknown"));
2516 case AETH_SYNDROME_OPCODE_ACK:
2517 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_credit_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2519 case AETH_SYNDROME_OPCODE_RNR_NAK:
2520 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_timer, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2522 case AETH_SYNDROME_OPCODE_RES:
2523 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_reserved_value, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2525 case AETH_SYNDROME_OPCODE_NAK:
2526 proto_tree_add_item(AETH_syndrome_tree, hf_infiniband_syndrome_error_code, tvb, local_offset, 1, ENC_BIG_ENDIAN);
2531 proto_tree_add_item(AETH_header_tree, hf_infiniband_message_sequence_number, tvb, local_offset, 3, ENC_BIG_ENDIAN);
2534 *offset = local_offset;
2537 /* Parse AtomicAckEth - Atomic ACK Extended Transport Header
2538 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2539 * IN: tvb - the data buffer from wireshark
2540 * IN/OUT: The current and updated offset */
2542 parse_ATOMICACKETH(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2544 gint local_offset = *offset;
2545 /* AtomicAckEth - Atomic ACK Extended Transport Header */
2546 proto_item *ATOMICACKETH_header_item;
2547 proto_tree *ATOMICACKETH_header_tree;
2549 ATOMICACKETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_AtomicAckETH, tvb, local_offset, 8, ENC_NA);
2550 proto_item_set_text(ATOMICACKETH_header_item, "%s", "ATOMICACKETH - Atomic ACK Extended Transport Header");
2551 ATOMICACKETH_header_tree = proto_item_add_subtree(ATOMICACKETH_header_item, ett_atomicacketh);
2552 proto_tree_add_item(ATOMICACKETH_header_tree, hf_infiniband_original_remote_data, tvb, local_offset, 8, ENC_BIG_ENDIAN);
2554 *offset = local_offset;
2557 /* Parse IMMDT - Immediate Data Extended Transport Header
2558 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2559 * IN: tvb - the data buffer from wireshark
2560 * IN/OUT: The current and updated offset */
2562 parse_IMMDT(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2564 gint local_offset = *offset;
2565 /* IMMDT - Immediate Data Extended Transport Header */
2566 proto_item *IMMDT_header_item;
2567 proto_tree *IMMDT_header_tree;
2569 IMMDT_header_item = proto_tree_add_item(parentTree, hf_infiniband_IMMDT, tvb, local_offset, 4, ENC_NA);
2570 proto_item_set_text(IMMDT_header_item, "%s", "IMMDT - Immediate Data Extended Transport Header");
2571 IMMDT_header_tree = proto_item_add_subtree(IMMDT_header_item, ett_immdt);
2572 proto_tree_add_item(IMMDT_header_tree, hf_infiniband_IMMDT, tvb, local_offset, 4, ENC_NA);
2574 *offset = local_offset;
2577 /* Parse IETH - Invalidate Extended Transport Header
2578 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2579 * IN: tvb - the data buffer from wireshark
2580 * IN/OUT: The current and updated offset */
2582 parse_IETH(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2584 gint local_offset = *offset;
2585 /* IETH - Invalidate Extended Transport Header */
2586 proto_item *IETH_header_item;
2587 proto_tree *IETH_header_tree;
2589 IETH_header_item = proto_tree_add_item(parentTree, hf_infiniband_IETH, tvb, local_offset, 4, ENC_NA);
2590 proto_item_set_text(IETH_header_item, "%s", "IETH - Invalidate Extended Transport Header");
2591 IETH_header_tree = proto_item_add_subtree(IETH_header_item, ett_ieth);
2593 proto_tree_add_item(IETH_header_tree, hf_infiniband_IETH, tvb, local_offset, 4, ENC_NA);
2596 *offset = local_offset;
2599 static void update_sport(packet_info *pinfo)
2601 conversation_t *conv;
2602 conversation_infiniband_data *conv_data;
2604 conv = find_conversation(pinfo->num, &pinfo->dst, &pinfo->dst,
2605 ENDPOINT_IBQP, pinfo->destport, pinfo->destport, NO_ADDR_B|NO_PORT_B);
2609 conv_data = (conversation_infiniband_data *)conversation_get_proto_data(conv, proto_infiniband);
2613 pinfo->srcport = conv_data->src_qp;
2616 /* Parse Payload - Packet Payload / Invariant CRC / maybe Variant CRC
2617 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2618 * IN: pinfo - packet info from wireshark
2619 * IN: info - infiniband info passed to subdissectors
2620 * IN: tvb - the data buffer from wireshark
2621 * IN/OUT: offset - The current and updated offset
2622 * IN: length - Length of Payload
2623 * IN: top_tree - parent tree of Infiniband dissector */
2624 static void parse_PAYLOAD(proto_tree *parentTree,
2625 packet_info *pinfo, struct infinibandinfo *info,
2626 tvbuff_t *tvb, gint *offset, gint length, gint crclen, proto_tree *top_tree)
2628 gint local_offset = *offset;
2629 /* Payload - Packet Payload */
2630 guint8 management_class;
2631 tvbuff_t *volatile next_tvb;
2632 gint reported_length;
2633 heur_dtbl_entry_t *hdtbl_entry;
2634 gboolean dissector_found = FALSE;
2636 if (!tvb_bytes_exist(tvb, *offset, length)) /* previously consumed bytes + offset was all the data - none or corrupt payload */
2638 col_set_str(pinfo->cinfo, COL_INFO, "Invalid Packet Length from LRH! [Malformed Packet]");
2639 col_set_fence(pinfo->cinfo, COL_INFO);
2643 /* management datagrams are determined by the source/destination QPs */
2644 if (pinfo->srcport == 0 || pinfo->srcport == 1 || pinfo->destport == 0 || pinfo->destport == 1) /* management datagram */
2646 management_class = tvb_get_guint8(tvb, (*offset) + 1);
2648 if (((management_class >= (guint8)VENDOR_1_START) && (management_class <= (guint8)VENDOR_1_END))
2649 || ((management_class >= (guint8)VENDOR_2_START) && (management_class <= (guint8)VENDOR_2_END)))
2651 /* parse vendor specific */
2652 col_set_str(pinfo->cinfo, COL_INFO, "VENDOR (Unknown Attribute)");
2653 parse_VENDOR_MANAGEMENT(parentTree, tvb, offset);
2655 else if ((management_class >= (guint8)APPLICATION_START) && (management_class <= (guint8)APPLICATION_END))
2657 /* parse application specific */
2658 col_set_str(pinfo->cinfo, COL_INFO, "APP (Unknown Attribute)");
2659 parse_APPLICATION_MANAGEMENT(parentTree, tvb, offset);
2661 else if (((management_class == (guint8)0x00) || (management_class == (guint8)0x02))
2662 || ((management_class >= (guint8)0x50) && (management_class <= (guint8)0x80))
2663 || ((management_class >= (guint8)0x82)))
2665 /* parse reserved classes */
2666 col_set_str(pinfo->cinfo, COL_INFO, "RESERVED (Unknown Attribute)");
2667 parse_RESERVED_MANAGEMENT(parentTree, tvb, offset);
2669 else /* we have a normal management_class */
2671 switch (management_class)
2673 case SUBN_LID_ROUTED:
2674 /* parse subn man lid routed */
2675 parse_SUBN_LID_ROUTED(parentTree, pinfo, tvb, &local_offset);
2677 case SUBN_DIRECTED_ROUTE:
2678 /* parse subn directed route */
2679 parse_SUBN_DIRECTED_ROUTE(parentTree, pinfo, tvb, &local_offset);
2682 /* parse sub admin */
2683 parse_SUBNADMN(parentTree, pinfo, tvb, &local_offset);
2686 /* parse performance */
2687 parse_PERF(parentTree, tvb, pinfo, &local_offset);
2690 /* parse baseboard mgmt */
2691 col_set_str(pinfo->cinfo, COL_INFO, "BM (Unknown Attribute)");
2692 parse_BM(parentTree, tvb, &local_offset);
2695 /* parse device management */
2696 col_set_str(pinfo->cinfo, COL_INFO, "DEV_MGT (Unknown Attribute)");
2697 parse_DEV_MGT(parentTree, tvb, &local_offset);
2700 /* parse communication management */
2701 parse_COM_MGT(parentTree, pinfo, tvb, &local_offset, top_tree);
2704 /* parse snmp tunneling */
2705 col_set_str(pinfo->cinfo, COL_INFO, "SNMP (Unknown Attribute)");
2706 parse_SNMP(parentTree, tvb, &local_offset);
2713 else /* Normal Data Packet - Parse as such */
2715 /* update sport for the packet, for dissectors that performs
2716 * exact match on saddr, dadr, sport, dport tuple.
2718 update_sport(pinfo);
2720 info->payload_tree = parentTree;
2722 /* Calculation for Payload:
2723 * (tvb_length) Length of entire packet - (local_offset) Starting byte of Payload Data
2724 * offset addition is more complex for the payload.
2725 * We need the total length of the packet, - length of previous headers, + offset where payload started.
2726 * We also need to reserve 6 bytes for the CRCs which are not actually part of the payload. */
2727 reported_length = tvb_reported_length_remaining(tvb, local_offset);
2728 if (reported_length >= crclen)
2729 reported_length -= crclen;
2730 next_tvb = tvb_new_subset_length(tvb, local_offset, reported_length);
2732 if (try_heuristic_first)
2734 if (dissector_try_heuristic(heur_dissectors_payload, next_tvb, pinfo, top_tree, &hdtbl_entry, info))
2735 dissector_found = TRUE;
2738 if (dissector_found == FALSE)
2740 if (dissector_try_payload_new(subdissector_table, next_tvb, pinfo, top_tree, TRUE, info))
2742 dissector_found = TRUE;
2746 if (!try_heuristic_first)
2748 if (dissector_try_heuristic(heur_dissectors_payload, next_tvb, pinfo, top_tree, &hdtbl_entry, info))
2749 dissector_found = TRUE;
2754 if (dissector_found == FALSE)
2756 /* No sub-dissector found.
2757 Label rest of packet as "Data" */
2758 call_data_dissector(next_tvb, pinfo, top_tree);
2761 /* Will contain ICRC <and maybe VCRC> = 4 or 4+2 (crclen) */
2762 local_offset = tvb_reported_length(tvb) - crclen;
2765 *offset = local_offset;
2768 /* Parse VENDOR - Parse a vendor specific or unknown header sequence
2769 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2770 * IN: tvb - the data buffer from wireshark
2771 * IN/OUT: The current and updated offset */
2772 static void parse_VENDOR(proto_tree * parentTree, tvbuff_t *tvb, gint *offset)
2774 gint local_offset = *offset;
2775 proto_item *VENDOR_header_item;
2776 proto_tree *VENDOR_header_tree;
2778 VENDOR_header_item = proto_tree_add_item(parentTree, hf_infiniband_vendor, tvb, local_offset, 4, ENC_NA);
2779 proto_item_set_text(VENDOR_header_item, "%s", "Vendor Specific or Unknown Header Sequence");
2780 VENDOR_header_tree = proto_item_add_subtree(VENDOR_header_item, ett_vendor);
2781 proto_tree_add_item(VENDOR_header_tree, hf_infiniband_vendor, tvb, local_offset, -1, ENC_NA);
2782 *offset = local_offset;
2785 /* Parse IPv6 - Parse an IPv6 Packet
2786 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2787 * IN: tvb - the data buffer from wireshark
2788 * IN/OUT: The current and updated offset
2789 * IN: pinfo - packet info from wireshark */
2790 static void parse_IPvSix(proto_tree *parentTree, tvbuff_t *tvb, gint *offset, packet_info *pinfo)
2794 /* (- 2) for VCRC which lives at the end of the packet */
2795 ipv6_tvb = tvb_new_subset_length(tvb, *offset,
2796 tvb_reported_length_remaining(tvb, *offset) - 2);
2797 call_dissector(ipv6_handle, ipv6_tvb, pinfo, parentTree);
2798 *offset = tvb_reported_length(tvb) - 2;
2800 /* Display the VCRC */
2801 proto_tree_add_item(parentTree, hf_infiniband_variant_crc, tvb, *offset, 2, ENC_BIG_ENDIAN);
2804 /* Parse EtherType - Parse a generic IP packaet with an EtherType of IP or ARP
2805 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2806 * IN: tvb - the data buffer from wireshark
2807 * IN/OUT: The current and updated offset
2808 * IN: pinfo - packet info from wireshark
2809 * IN: top_tree - parent tree of Infiniband dissector */
2810 static void parse_RWH(proto_tree *ah_tree, tvbuff_t *tvb, gint *offset, packet_info *pinfo, proto_tree *top_tree)
2815 /* RWH - Raw Header */
2816 proto_item *RWH_header_item;
2817 proto_tree *RWH_header_tree;
2819 gint captured_length, reported_length;
2821 RWH_header_item = proto_tree_add_item(ah_tree, hf_infiniband_RWH, tvb, *offset, 4, ENC_NA);
2822 proto_item_set_text(RWH_header_item, "%s", "RWH - Raw Header");
2823 RWH_header_tree = proto_item_add_subtree(RWH_header_item, ett_rwh);
2825 proto_tree_add_item(RWH_header_tree, hf_infiniband_reserved, tvb,
2826 *offset, 2, ENC_NA);
2830 ether_type = tvb_get_ntohs(tvb, *offset);
2831 proto_tree_add_uint(RWH_header_tree, hf_infiniband_etype, tvb, *offset, 2,
2835 /* Get the captured length and reported length of the data
2836 * after the Ethernet type. */
2837 captured_length = tvb_captured_length_remaining(tvb, *offset);
2838 reported_length = tvb_reported_length_remaining(tvb, *offset);
2840 /* Construct a tvbuff for the payload after the Ethernet type,
2841 * not including the FCS. */
2842 if ((captured_length >= 0) && (reported_length >= 0)) {
2843 if (reported_length >= 2)
2844 reported_length -= 2;
2847 next_tvb = tvb_new_subset_length(tvb, *offset, reported_length);
2848 if (!dissector_try_uint(ethertype_dissector_table, ether_type,
2849 next_tvb, pinfo, top_tree))
2850 call_data_dissector(next_tvb, pinfo, top_tree);
2852 *offset = tvb_reported_length(tvb) - 2;
2853 /* Display the VCRC */
2854 proto_tree_add_item(ah_tree, hf_infiniband_variant_crc, tvb, *offset, 2, ENC_BIG_ENDIAN);
2858 /* Parse a Mellanox EoIB Encapsulation Header and the associated Ethernet frame
2859 * IN: parentTree to add the dissection to - in this code the all_headers_tree
2860 * IN: tvb - the data buffer from wireshark
2861 * IN: The current offset
2862 * IN: pinfo - packet info from wireshark
2863 * IN: top_tree - parent tree of Infiniband dissector */
2864 static gboolean dissect_mellanox_eoib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2866 proto_item *header_item;
2867 proto_tree *header_subtree;
2868 tvbuff_t *encap_tvb;
2870 gboolean more_segments;
2871 struct infinibandinfo *info = (struct infinibandinfo *)data;
2873 if (((info->opCode & 0xE0) >> 5) != TRANSPORT_UD)
2876 if ((tvb_get_guint8(tvb, offset) & 0xF0) != 0xC0)
2879 if (tvb_reported_length(tvb) < 4) {
2880 /* not even large enough to contain the eoib encap header. error! */
2884 header_item = proto_tree_add_item(tree, proto_mellanox_eoib, tvb, offset, 4, ENC_NA);
2885 header_subtree = proto_item_add_subtree(header_item, ett_eoib);
2887 proto_tree_add_item(header_subtree, hf_infiniband_ver, tvb, offset, 2, ENC_BIG_ENDIAN);
2888 proto_tree_add_item(header_subtree, hf_infiniband_tcp_chk, tvb, offset, 2, ENC_BIG_ENDIAN);
2889 proto_tree_add_item(header_subtree, hf_infiniband_ip_chk, tvb, offset, 2, ENC_BIG_ENDIAN);
2890 proto_tree_add_item(header_subtree, hf_infiniband_fcs, tvb, offset, 2, ENC_BIG_ENDIAN);
2891 proto_tree_add_item(header_subtree, hf_infiniband_ms, tvb, offset, 2, ENC_BIG_ENDIAN);
2892 proto_tree_add_item(header_subtree, hf_infiniband_seg_off, tvb, offset, 2, ENC_BIG_ENDIAN);
2893 more_segments = tvb_get_ntohs(tvb, offset) & (MELLANOX_MORE_SEGMENT_FLAG | MELLANOX_SEGMENT_FLAG);
2895 proto_tree_add_item(header_subtree, hf_infiniband_seg_id, tvb, offset, 2, ENC_BIG_ENDIAN);
2898 encap_tvb = tvb_new_subset_remaining(tvb, offset);
2900 if (more_segments) {
2901 /* this is a fragment of an encapsulated Ethernet jumbo frame, parse as data */
2902 call_data_dissector(encap_tvb, pinfo, tree);
2904 /* non-fragmented frames can be fully parsed */
2905 call_dissector(eth_handle, encap_tvb, pinfo, tree);
2911 /* IBA packet data could be anything in principle, however it is common
2912 * practice to carry non-IBA data encapsulated with an EtherType header,
2913 * similar to the RWH header. There is no way to identify these frames
2916 static gboolean dissect_eth_over_ib(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2918 guint16 etype, reserved;
2919 const char *saved_proto;
2921 struct infinibandinfo *info = (struct infinibandinfo *)data;
2922 volatile gboolean dissector_found = FALSE;
2924 if (tvb_reported_length(tvb) < 4) {
2925 /* not even large enough to contain the eoib encap header. error! */
2929 etype = tvb_get_ntohs(tvb, 0);
2930 reserved = tvb_get_ntohs(tvb, 2);
2935 next_tvb = tvb_new_subset_remaining(tvb, 4);
2937 /* Look for sub-dissector, and call it if found.
2938 Catch exceptions, so that if the reported length of "next_tvb"
2939 was reduced by some dissector before an exception was thrown,
2940 we can still put in an item for the trailer. */
2941 saved_proto = pinfo->current_proto;
2944 dissector_found = dissector_try_uint(ethertype_dissector_table,
2945 etype, next_tvb, pinfo, tree);
2947 CATCH_NONFATAL_ERRORS {
2948 /* Somebody threw an exception that means that there
2949 was a problem dissecting the payload; that means
2950 that a dissector was found, so we don't need to
2951 dissect the payload as data or update the protocol
2954 Just show the exception and then drive on to show
2955 the trailer, after noting that a dissector was found
2956 and restoring the protocol value that was in effect
2957 before we called the subdissector.
2960 show_exception(next_tvb, pinfo, tree, EXCEPT_CODE, GET_MESSAGE);
2961 dissector_found = TRUE;
2962 pinfo->current_proto = saved_proto;
2966 if (dissector_found) {
2967 proto_item *PAYLOAD_header_item;
2968 proto_tree *PAYLOAD_header_tree;
2970 /* now create payload entry to show Ethertype */
2971 PAYLOAD_header_item = proto_tree_add_item(info->payload_tree, hf_infiniband_payload, tvb, 0,
2972 tvb_reported_length(tvb) - 6, ENC_NA);
2973 proto_item_set_text(PAYLOAD_header_item, "%s", "IBA Payload - appears to be EtherType encapsulated");
2974 PAYLOAD_header_tree = proto_item_add_subtree(PAYLOAD_header_item, ett_payload);
2976 proto_tree_add_uint(PAYLOAD_header_tree, hf_infiniband_etype, tvb, 0, 2, etype);
2977 proto_tree_add_item(PAYLOAD_header_tree, hf_infiniband_reserved, tvb, 2, 2, ENC_NA);
2980 return dissector_found;
2983 /* Parse Subnet Management (LID Routed)
2984 * IN: parentTree to add the dissection to
2985 * IN: pinfo - packet info from wireshark
2986 * IN: tvb - the data buffer from wireshark
2987 * IN/OUT: The current and updated offset */
2988 static void parse_SUBN_LID_ROUTED(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, gint *offset)
2990 /* Parse the Common MAD Header */
2993 proto_item *SUBN_LID_ROUTED_header_item;
2994 proto_tree *SUBN_LID_ROUTED_header_tree;
2996 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
2998 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3002 local_offset = *offset;
3004 /* local_offset - 24 here because when we come out of parse_MAD_Common, the offset it sitting at the data section. */
3005 SUBN_LID_ROUTED_header_item = proto_tree_add_item(parentTree, hf_infiniband_SMP_LID, tvb, local_offset - 24, 256, ENC_NA);
3006 proto_item_set_text(SUBN_LID_ROUTED_header_item, "%s", "SMP (LID Routed) ");
3007 SUBN_LID_ROUTED_header_tree = proto_item_add_subtree(SUBN_LID_ROUTED_header_item, ett_subn_lid_routed);
3008 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_m_key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3010 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_reserved, tvb, local_offset, 32, ENC_NA);
3013 label_SUBM_Method(SUBN_LID_ROUTED_header_item, &MadData, pinfo);
3014 label_SUBM_Attribute(SUBN_LID_ROUTED_header_item, &MadData, pinfo);
3016 /* 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. */
3017 if (!parse_SUBM_Attribute(SUBN_LID_ROUTED_header_tree, tvb, &local_offset, &MadData))
3019 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
3023 proto_tree_add_item(SUBN_LID_ROUTED_header_tree, hf_infiniband_reserved, tvb, local_offset, 128, ENC_NA);
3024 local_offset += 128;
3025 *offset = local_offset;
3028 /* Parse Subnet Management (Directed Route)
3029 * IN: parentTree to add the dissection to
3030 * IN: tvb - the data buffer from wireshark
3031 * IN/OUT: The current and updated offset */
3032 static void parse_SUBN_DIRECTED_ROUTE(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, gint *offset)
3034 /* Parse the Common MAD Header */
3037 proto_item *SUBN_DIRECTED_ROUTE_header_item;
3038 proto_tree *SUBN_DIRECTED_ROUTE_header_tree;
3040 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3042 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3046 local_offset = *offset;
3048 /* local_offset - 24 here because when we come out of parse_MAD_Common, the offset it sitting at the data section.
3049 * We need to go backwards because this particular SMP uses the class specific portion of the Common MAD Header */
3050 SUBN_DIRECTED_ROUTE_header_item = proto_tree_add_item(parentTree, hf_infiniband_SMP_DIRECTED, tvb, local_offset - 24, 256, ENC_NA);
3051 proto_item_set_text(SUBN_DIRECTED_ROUTE_header_item, "%s", "SMP (Directed Route) ");
3052 SUBN_DIRECTED_ROUTE_header_tree = proto_item_add_subtree(SUBN_DIRECTED_ROUTE_header_item, ett_subn_directed_route);
3054 label_SUBM_Method(SUBN_DIRECTED_ROUTE_header_item, &MadData, pinfo);
3055 label_SUBM_Attribute(SUBN_DIRECTED_ROUTE_header_item, &MadData, pinfo);
3057 /* Place us at offset 4, the "D" Bit (Direction bit for Directed Route SMPs) */
3059 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_d, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3060 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_smp_status, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3062 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_hop_pointer, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3064 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_hop_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3066 local_offset += 16; /* Skip over the rest of the Common MAD Header... It's already dissected by parse_MAD_Common */
3067 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_m_key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3069 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_dr_slid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3071 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_dr_dlid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3073 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_reserved, tvb, local_offset, 28, ENC_NA);
3076 /* 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. */
3077 if (!parse_SUBM_Attribute(SUBN_DIRECTED_ROUTE_header_tree, tvb, &local_offset, &MadData))
3079 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
3083 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_initial_path, tvb, local_offset, 64, ENC_NA);
3085 proto_tree_add_item(SUBN_DIRECTED_ROUTE_header_tree, hf_infiniband_return_path, tvb, local_offset, 64, ENC_NA);
3087 *offset = local_offset;
3090 /* Parse Subnet Administration
3091 * IN: parentTree to add the dissection to
3092 * IN: pinfo - packet info from wireshark
3093 * IN: tvb - the data buffer from wireshark
3094 * IN/OUT: The current and updated offset */
3095 static void parse_SUBNADMN(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, gint *offset)
3097 /* Parse the Common MAD Header */
3100 proto_item *SUBNADMN_header_item;
3101 proto_tree *SUBNADMN_header_tree;
3103 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3105 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3108 if (!parse_RMPP(parentTree, tvb, offset))
3110 /* TODO: Mark Corrupt Packet */
3113 local_offset = *offset;
3115 SUBNADMN_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset - 36, 256, ENC_NA);
3116 proto_item_set_text(SUBNADMN_header_item, "%s", "SA ");
3117 SUBNADMN_header_tree = proto_item_add_subtree(SUBNADMN_header_item, ett_subnadmin);
3119 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_sm_key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3121 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_attribute_offset, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3123 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
3125 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_component_mask, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3128 label_SUBA_Method(SUBNADMN_header_item, &MadData, pinfo);
3129 label_SUBA_Attribute(SUBNADMN_header_item, &MadData, pinfo);
3131 if (!parse_SUBA_Attribute(SUBNADMN_header_tree, tvb, &local_offset, &MadData))
3133 proto_tree_add_item(SUBNADMN_header_tree, hf_infiniband_subnet_admin_data, tvb, local_offset, 200, ENC_NA);
3134 local_offset += 200;
3136 *offset = local_offset;
3139 /* Parse Performance Management
3140 * IN: parentTree to add the dissection to
3141 * IN: tvb - the data buffer from wireshark
3142 * IN: pinfo - the pinfo struct from wireshark
3143 * IN/OUT: The current and updated offset */
3144 static void parse_PERF(proto_tree *parentTree, tvbuff_t *tvb, packet_info *pinfo, gint *offset)
3146 /* Parse the Common MAD Header */
3149 proto_item *PERF_header_item;
3151 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3153 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3157 local_offset = *offset; /* offset now points to the start of the MAD data field */
3159 switch (MadData.attributeID) {
3160 case 0x0001: /* (ClassPortInfo) */
3161 col_set_str(pinfo->cinfo, COL_INFO, "PERF (ClassPortInfo)");
3162 proto_tree_add_item(parentTree, hf_infiniband_PerfMgt_ClassPortInfo, tvb, local_offset, 40, ENC_NA);
3164 *offset = local_offset;
3165 parse_ClassPortInfo(parentTree, tvb, offset);
3167 case ATTR_PORT_COUNTERS:
3168 parse_PERF_PortCounters(parentTree, tvb, pinfo, &local_offset);
3170 case ATTR_PORT_COUNTERS_EXT:
3171 parse_PERF_PortCountersExtended(parentTree, tvb, pinfo, &local_offset);
3174 col_set_str(pinfo->cinfo, COL_INFO, "PERF (Unknown Attribute)");
3175 PERF_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3176 local_offset += MAD_DATA_SIZE;
3177 proto_item_set_text(PERF_header_item, "%s", "PERF - Performance Management MAD (Dissector Not Implemented)");
3181 *offset = local_offset;
3184 /* Parse Baseboard Management
3185 * IN: parentTree to add the dissection to
3186 * IN: tvb - the data buffer from wireshark
3187 * IN/OUT: The current and updated offset */
3188 static void parse_BM(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
3190 /* Parse the Common MAD Header */
3193 proto_item *BM_header_item;
3195 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3197 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3200 local_offset = *offset;
3202 BM_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3203 local_offset += MAD_DATA_SIZE;
3204 proto_item_set_text(BM_header_item, "%s", "BM - Baseboard Management MAD (Dissector Not Implemented)");
3205 *offset = local_offset;
3208 /* Parse Device Management
3209 * IN: parentTree to add the dissection to
3210 * IN: tvb - the data buffer from wireshark
3211 * IN/OUT: The current and updated offset */
3212 static void parse_DEV_MGT(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
3214 /* Parse the Common MAD Header */
3217 proto_item *DEVM_header_item;
3219 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3221 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3224 local_offset = *offset;
3225 DEVM_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3226 local_offset += MAD_DATA_SIZE;
3227 proto_item_set_text(DEVM_header_item, "%s", "DEV_MGT - Device Management MAD (Dissector Not Implemented)");
3228 *offset = local_offset;
3231 static gboolean parse_CM_Req_ServiceID(proto_tree *parent_tree, tvbuff_t *tvb, gint *offset, guint64 serviceid)
3233 proto_item *service_id_item;
3234 proto_tree *service_id_tree;
3235 gint local_offset = *offset;
3238 if ((serviceid & RDMA_IP_CM_SID_PREFIX_MASK) == RDMA_IP_CM_SID_PREFIX) {
3239 service_id_item = proto_tree_add_item(parent_tree, hf_cm_req_service_id, tvb, local_offset, 8, ENC_NA);
3240 proto_item_set_text(service_id_item, "%s", "IP CM ServiceID");
3241 service_id_tree = proto_item_add_subtree(service_id_item, ett_cm_sid);
3243 proto_tree_add_item(service_id_tree, hf_cm_req_service_id_prefix, tvb, local_offset, 5, ENC_NA);
3245 proto_tree_add_item(service_id_tree, hf_cm_req_service_id_protocol, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3247 proto_tree_add_item(service_id_tree, hf_cm_req_service_id_dport, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3251 proto_tree_add_item(parent_tree, hf_cm_req_service_id, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3255 *offset = local_offset;
3259 static guint64 make_hash_key(guint64 transcationID, address *addr)
3263 hash_key = transcationID;
3264 hash_key = add_address_to_hash64(hash_key, addr);
3268 static connection_context* lookup_connection(guint64 transcationID, address *addr)
3270 connection_context *connection;
3273 hash_key = make_hash_key(transcationID, addr);
3275 connection = (connection_context *)g_hash_table_lookup(CM_context_table, &hash_key);
3279 static void remove_connection(guint64 transcationID, address *addr)
3283 hash_key = make_hash_key(transcationID, addr);
3285 g_hash_table_remove(CM_context_table, &hash_key);
3289 create_conv_and_add_proto_data(packet_info *pinfo, guint64 service_id,
3290 gboolean client_to_server,
3291 address *addr, const guint16 lid,
3292 const guint32 port, const guint32 src_port,
3293 const guint options, guint8 *mad_data)
3295 conversation_t *conv;
3296 conversation_infiniband_data *proto_data;
3298 proto_data = wmem_new(wmem_file_scope(), conversation_infiniband_data);
3299 proto_data->service_id = service_id;
3300 proto_data->client_to_server = client_to_server;
3301 proto_data->src_qp = src_port;
3302 memcpy(&proto_data->mad_private_data[0], mad_data, MAD_DATA_SIZE);
3303 conv = conversation_new(pinfo->num, addr, addr,
3304 ENDPOINT_IBQP, port, port, options);
3305 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3307 /* next, register the conversation using the LIDs */
3308 set_address(addr, AT_IB, sizeof(guint16), wmem_memdup(pinfo->pool, &lid, sizeof lid));
3309 conv = conversation_new(pinfo->num, addr, addr,
3310 ENDPOINT_IBQP, port, port, options);
3311 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3314 static void save_conversation_info(packet_info *pinfo, guint8 *local_gid, guint8 *remote_gid,
3315 guint32 local_qpn, guint32 local_lid, guint32 remote_lid,
3316 guint64 serviceid, MAD_Data *MadData)
3318 /* the following saves information about the conversation this packet defines,
3319 so there's no point in doing it more than once per packet */
3320 if (!pinfo->fd->visited)
3322 connection_context *connection;
3323 conversation_infiniband_data *proto_data;
3324 conversation_t *conv;
3325 guint64 *hash_key = (guint64 *)g_malloc(sizeof(guint64));
3327 /* create a new connection context and store it in the hash table */
3328 connection = (connection_context *)g_malloc(sizeof(connection_context));
3330 if (pinfo->dst.type == AT_IPv4) {
3331 memcpy(&(connection->req_gid), local_gid, 4);
3332 memcpy(&(connection->resp_gid), remote_gid, 4);
3334 memcpy(&(connection->req_gid), local_gid, GID_SIZE);
3335 memcpy(&(connection->resp_gid), remote_gid, GID_SIZE);
3337 connection->req_lid = local_lid;
3338 connection->resp_lid = remote_lid;
3339 connection->req_qp = local_qpn;
3340 connection->resp_qp = 0; /* not currently known. we'll fill this in later */
3341 connection->service_id = serviceid;
3343 /* save the context to the context hash table, for retrieval when the corresponding
3344 CM REP message arrives */
3345 *hash_key = make_hash_key(MadData->transactionID, &pinfo->src);
3346 g_hash_table_replace(CM_context_table, hash_key, connection);
3348 /* Now we create a conversation for the CM exchange. This uses both
3349 sides of the conversation since CM packets also include the source
3351 proto_data = wmem_new(wmem_file_scope(), conversation_infiniband_data);
3352 proto_data->service_id = connection->service_id;
3353 proto_data->client_to_server = TRUE;
3355 conv = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
3356 ENDPOINT_IBQP, pinfo->srcport, pinfo->destport, 0);
3357 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3359 /* create unidirection conversation for packets that will flow from
3362 create_conv_and_add_proto_data(pinfo, connection->service_id, FALSE,
3363 &pinfo->src, connection->req_lid,
3364 connection->req_qp, 0, NO_ADDR2|NO_PORT2,
3369 static void parse_IP_CM_Req_Msg(proto_tree *parent_tree, tvbuff_t *tvb, gint local_offset)
3371 proto_item *private_data_item;
3372 proto_tree *private_data_tree;
3375 private_data_item = proto_tree_add_item(parent_tree, hf_cm_req_ip_cm_req_msg, tvb, local_offset, 92, ENC_NA);
3376 proto_item_set_text(private_data_item, "%s", "IP CM Private Data");
3377 private_data_tree = proto_item_add_subtree(private_data_item, ett_cm_ipcm);
3379 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_majv, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3380 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_minv, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3383 ipv = (tvb_get_guint8(tvb, local_offset) & 0xf0) >> 4;
3385 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_ipv, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3386 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_res, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3388 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sport, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3392 /* skip first 12 bytes of zero for sip */
3393 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sip4, tvb, local_offset + 12, 4, ENC_NA);
3395 /* skip first 12 bytes of zero for dip */
3396 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip4, tvb, local_offset + 12, 4, ENC_NA);
3398 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_sip6, tvb, local_offset, 16, ENC_NA);
3400 proto_tree_add_item(private_data_tree, hf_cm_req_ip_cm_dip6, tvb, local_offset, 16, ENC_NA);
3404 /* finally add the consumer specific private data as undecoded data */
3405 proto_tree_add_item(private_data_tree, hf_ip_cm_req_consumer_private_data,
3406 tvb, local_offset, 56, ENC_NA);
3409 static void parse_CM_Req(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, gint *offset,
3410 MAD_Data *MadData, proto_tree *CM_header_tree, struct infinibandinfo *info)
3413 heur_dtbl_entry_t *hdtbl_entry;
3414 guint8 *local_gid, *remote_gid;
3422 local_offset = *offset;
3424 proto_tree_add_item(CM_header_tree, hf_cm_req_local_comm_id, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3426 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
3429 serviceid = tvb_get_ntoh64(tvb, local_offset);
3430 ip_cm_sid = parse_CM_Req_ServiceID(CM_header_tree, tvb, &local_offset, serviceid);
3432 proto_tree_add_item(CM_header_tree, hf_cm_req_local_ca_guid, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3434 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
3436 proto_tree_add_item(CM_header_tree, hf_cm_req_local_qkey, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3438 proto_tree_add_item(CM_header_tree, hf_cm_req_local_qpn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3439 local_qpn = tvb_get_ntoh24(tvb, local_offset);
3441 proto_tree_add_item(CM_header_tree, hf_cm_req_respo_res, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3443 proto_tree_add_item(CM_header_tree, hf_cm_req_local_eecn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3445 proto_tree_add_item(CM_header_tree, hf_cm_req_init_depth, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3447 proto_tree_add_item(CM_header_tree, hf_cm_req_remote_eecn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3449 proto_tree_add_item(CM_header_tree, hf_cm_req_remote_cm_resp_to, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3450 proto_tree_add_item(CM_header_tree, hf_cm_req_transp_serv_type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3451 proto_tree_add_item(CM_header_tree, hf_cm_req_e2e_flow_ctrl, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3453 proto_tree_add_item(CM_header_tree, hf_cm_req_start_psn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3455 proto_tree_add_item(CM_header_tree, hf_cm_req_local_cm_resp_to, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3456 proto_tree_add_item(CM_header_tree, hf_cm_req_retry_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3458 proto_tree_add_item(CM_header_tree, hf_cm_req_pkey, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3460 proto_tree_add_item(CM_header_tree, hf_cm_req_path_pp_mtu, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3461 proto_tree_add_item(CM_header_tree, hf_cm_req_rdc_exists, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3462 proto_tree_add_item(CM_header_tree, hf_cm_req_rnr_retry_count, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3464 proto_tree_add_item(CM_header_tree, hf_cm_req_max_cm_retries, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3465 proto_tree_add_item(CM_header_tree, hf_cm_req_srq, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3466 proto_tree_add_item(CM_header_tree, hf_cm_req_extended_transport, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3468 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3469 local_lid = tvb_get_ntohs(tvb, local_offset);
3471 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3472 remote_lid = tvb_get_ntohs(tvb, local_offset);
3475 if (pinfo->dst.type == AT_IPv4) {
3476 local_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), 4);
3477 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_gid_ipv4, tvb, local_offset + 12, 4, ENC_NA);
3478 (*(guint32*)local_gid) = tvb_get_ipv4(tvb, local_offset + 12);
3481 remote_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), 4);
3482 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_gid_ipv4, tvb, local_offset + 12, 4, ENC_NA);
3483 (*(guint32*)remote_gid) = tvb_get_ipv4(tvb, local_offset + 12);
3485 local_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), GID_SIZE);
3486 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_gid, tvb, local_offset, 16, ENC_NA);
3487 tvb_get_ipv6(tvb, local_offset, (ws_in6_addr*)local_gid);
3490 remote_gid = (guint8 *)wmem_alloc(wmem_packet_scope(), GID_SIZE);
3491 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_remote_gid, tvb, local_offset, 16, ENC_NA);
3492 tvb_get_ipv6(tvb, local_offset, (ws_in6_addr*)remote_gid);
3496 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_flow_label, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3497 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_reserved0, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3498 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_packet_rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3500 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_traffic_class, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3502 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_hop_limit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3504 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_sl, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3505 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_subnet_local, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3506 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_reserved1, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3508 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_local_ack_to, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3509 proto_tree_add_item(CM_header_tree, hf_cm_req_primary_reserved2, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3511 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_local_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3513 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_remote_lid, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3515 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_local_gid, tvb, local_offset, 16, ENC_NA);
3517 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_remote_gid, tvb, local_offset, 16, ENC_NA);
3519 proto_tree_add_item(CM_header_tree, hf_cm_req_flow_label, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3520 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_reserved0, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3521 proto_tree_add_item(CM_header_tree, hf_cm_req_packet_rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3523 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_traffic_class, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3525 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_hop_limit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3527 proto_tree_add_item(CM_header_tree, hf_cm_req_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3528 proto_tree_add_item(CM_header_tree, hf_cm_req_subnet_local, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3529 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_reserved1, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3531 proto_tree_add_item(CM_header_tree, hf_cm_req_local_ACK_timeout, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3532 proto_tree_add_item(CM_header_tree, hf_cm_req_alt_reserved2, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3535 save_conversation_info(pinfo, local_gid, remote_gid, local_qpn, local_lid, remote_lid, serviceid, MadData);
3538 /* decode IP CM service specific private data */
3539 parse_IP_CM_Req_Msg(CM_header_tree, tvb, local_offset);
3540 /* ip_cm.req is 36 in length */
3541 next_tvb = tvb_new_subset_length(tvb, local_offset+36, 56);
3543 /* Add the undecoded private data anyway as RDMA CM private data */
3544 proto_tree_add_item(CM_header_tree, hf_cm_req_private_data, tvb, local_offset, 92, ENC_NA);
3545 next_tvb = tvb_new_subset_length(tvb, local_offset, 92);
3548 /* give a chance for subdissectors to analyze the private data */
3549 dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, top_tree, &hdtbl_entry, info);
3552 *offset = local_offset;
3555 static void create_bidi_conv(packet_info *pinfo, connection_context *connection)
3557 conversation_t *conv;
3558 conversation_infiniband_data *proto_data;
3560 proto_data = wmem_new(wmem_file_scope(), conversation_infiniband_data);
3561 proto_data->service_id = connection->service_id;
3562 proto_data->client_to_server = FALSE;
3563 memset(&proto_data->mad_private_data[0], 0, MAD_DATA_SIZE);
3564 conv = conversation_new(pinfo->num, &pinfo->src, &pinfo->dst,
3565 ENDPOINT_IBQP, connection->resp_qp,
3566 connection->req_qp, 0);
3567 conversation_add_proto_data(conv, proto_infiniband, proto_data);
3571 attach_connection_to_pinfo(packet_info *pinfo, connection_context *connection,
3575 resp_addr; /* we'll fill these in and pass them to conversation_new */
3577 /* RC traffic never(?) includes a field indicating the source QPN, so
3578 the destination host knows it only from previous context (a single
3579 QPN on the host that is part of an RC can only receive traffic from
3580 that RC). For this reason we do not register conversations with both
3581 sides, but rather we register the same conversation twice - once for
3582 each side of the Reliable Connection. */
3584 if (pinfo->dst.type == AT_IPv4) {
3585 set_address(&req_addr, AT_IPv4, 4, connection->req_gid);
3586 set_address(&resp_addr, AT_IPv4, 4, connection->resp_gid);
3587 } else if (pinfo->dst.type == AT_IPv6) {
3588 set_address(&req_addr, AT_IPv6, GID_SIZE, connection->req_gid);
3589 set_address(&resp_addr, AT_IPv6, GID_SIZE, connection->resp_gid);
3591 set_address(&req_addr, AT_IB, GID_SIZE, connection->req_gid);
3592 set_address(&resp_addr, AT_IB, GID_SIZE, connection->resp_gid);
3595 /* create conversations:
3596 * first for client to server direction so that upper level protocols
3597 * can do appropriate dissection depending on the message direction.
3599 create_conv_and_add_proto_data(pinfo, connection->service_id, TRUE,
3600 &resp_addr, connection->resp_lid,
3601 connection->resp_qp, connection->req_qp,
3602 NO_ADDR2|NO_PORT2, &MadData->data[0]);
3603 /* now create bidirectional connection that can be looked upon
3604 * by ULP for stateful context in both directions.
3606 create_bidi_conv(pinfo, connection);
3609 static void update_passive_conv_info(packet_info *pinfo,
3610 connection_context *connection)
3612 conversation_t *conv;
3613 conversation_infiniband_data *conv_data;
3615 conv = find_conversation(pinfo->num, &pinfo->dst, &pinfo->dst,
3616 ENDPOINT_IBQP, connection->req_qp, connection->req_qp,
3617 NO_ADDR_B|NO_PORT_B);
3619 return; /* nothing to do with no conversation context */
3621 conv_data = (conversation_infiniband_data *)conversation_get_proto_data(conv, proto_infiniband);
3624 conv_data->src_qp = connection->resp_qp;
3627 static void update_conversation_info(packet_info *pinfo,
3631 /* the following saves information about the conversation this packet defines,
3632 so there's no point in doing it more than once per packet */
3633 if (!pinfo->fd->visited) {
3634 /* get the previously saved context for this connection */
3635 connection_context *connection;
3637 connection = lookup_connection(MadData->transactionID, &pinfo->dst);
3639 /* if an appropriate connection was not found there's something wrong, but nothing we can
3640 do about it here - so just skip saving the context */
3642 connection->resp_qp = remote_qpn;
3643 update_passive_conv_info(pinfo, connection);
3644 attach_connection_to_pinfo(pinfo, connection, MadData);
3649 static void parse_CM_Rsp(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, gint *offset,
3650 MAD_Data *MadData, proto_tree *CM_header_tree, struct infinibandinfo *info)
3653 heur_dtbl_entry_t *hdtbl_entry;
3657 local_offset = *offset;
3659 proto_tree_add_item(CM_header_tree, hf_cm_rep_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3661 proto_tree_add_item(CM_header_tree, hf_cm_rep_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3663 proto_tree_add_item(CM_header_tree, hf_cm_rep_localqkey, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3665 proto_tree_add_item(CM_header_tree, hf_cm_rep_localqpn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3666 remote_qpn = tvb_get_ntoh24(tvb, local_offset);
3668 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3670 proto_tree_add_item(CM_header_tree, hf_cm_rep_localeecontnum, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3672 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3674 proto_tree_add_item(CM_header_tree, hf_cm_rep_startingpsn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3676 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3678 proto_tree_add_item(CM_header_tree, hf_cm_rep_responderres, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3680 proto_tree_add_item(CM_header_tree, hf_cm_rep_initiatordepth, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3682 proto_tree_add_item(CM_header_tree, hf_cm_rep_tgtackdelay, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3683 proto_tree_add_item(CM_header_tree, hf_cm_rep_failoveracc, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3684 proto_tree_add_item(CM_header_tree, hf_cm_rep_e2eflowctl, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3686 proto_tree_add_item(CM_header_tree, hf_cm_rep_rnrretrycount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3687 proto_tree_add_item(CM_header_tree, hf_cm_rep_srq, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3688 proto_tree_add_item(CM_header_tree, hf_cm_rep_reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3690 proto_tree_add_item(CM_header_tree, hf_cm_rep_localcaguid, tvb, local_offset, 8, ENC_BIG_ENDIAN);
3692 proto_tree_add_item(CM_header_tree, hf_cm_rep_privatedata, tvb, local_offset, 196, ENC_NA);
3694 update_conversation_info(pinfo, remote_qpn, MadData);
3696 /* give a chance for subdissectors to get the private data */
3697 next_tvb = tvb_new_subset_length(tvb, local_offset, 196);
3698 dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, top_tree, &hdtbl_entry, info);
3700 local_offset += 196;
3701 *offset = local_offset;
3704 static connection_context*
3705 try_connection_dissectors(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb,
3706 address *addr, MAD_Data *MadData, struct infinibandinfo *info,
3707 gint pdata_offset, gint pdata_length)
3710 heur_dtbl_entry_t *hdtbl_entry;
3711 connection_context *connection;
3713 connection = lookup_connection(MadData->transactionID, addr);
3715 next_tvb = tvb_new_subset_length(tvb, pdata_offset, pdata_length);
3716 dissector_try_heuristic(heur_dissectors_cm_private, next_tvb, pinfo, top_tree,
3717 &hdtbl_entry, info);
3721 static void parse_CM_Rtu(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, gint *offset,
3722 MAD_Data *MadData, proto_tree *CM_header_tree,
3723 struct infinibandinfo *info)
3727 local_offset = *offset;
3728 proto_tree_add_item(CM_header_tree, hf_cm_rtu_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3730 proto_tree_add_item(CM_header_tree, hf_cm_rtu_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3732 proto_tree_add_item(CM_header_tree, hf_cm_rtu_privatedata, tvb, local_offset, 224, ENC_NA);
3733 try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->src, MadData, info, local_offset, 224);
3734 local_offset += 224;
3735 *offset = local_offset;
3738 static void parse_CM_Rej(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, gint *offset,
3739 MAD_Data *MadData, proto_tree *CM_header_tree,
3740 struct infinibandinfo *info)
3744 local_offset = *offset;
3745 proto_tree_add_item(CM_header_tree, hf_cm_rej_local_commid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3747 proto_tree_add_item(CM_header_tree, hf_cm_rej_remote_commid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3749 proto_tree_add_item(CM_header_tree, hf_cm_rej_msg_rej, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3750 proto_tree_add_item(CM_header_tree, hf_cm_rej_msg_reserved0, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3752 proto_tree_add_item(CM_header_tree, hf_cm_rej_rej_info_len, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3753 proto_tree_add_item(CM_header_tree, hf_cm_rej_msg_reserved1, tvb, local_offset, 1, ENC_BIG_ENDIAN);
3755 proto_tree_add_item(CM_header_tree, hf_cm_rej_reason, tvb, local_offset, 2, ENC_BIG_ENDIAN);
3757 proto_tree_add_item(CM_header_tree, hf_cm_rej_add_rej_info, tvb, local_offset, 72, ENC_NA);
3759 proto_tree_add_item(CM_header_tree, hf_cm_rej_private_data, tvb, local_offset, 148, ENC_NA);
3761 try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->dst, MadData, info, local_offset, 148);
3762 local_offset += 148;
3763 *offset = local_offset;
3766 static void parse_CM_DReq(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, gint *offset,
3767 MAD_Data *MadData, proto_tree *CM_header_tree,
3768 struct infinibandinfo *info)
3772 local_offset = *offset;
3773 proto_tree_add_item(CM_header_tree, hf_cm_dreq_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3775 proto_tree_add_item(CM_header_tree, hf_cm_dreq_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3777 proto_tree_add_item(CM_header_tree, hf_cm_dreq_remote_qpn, tvb, local_offset, 3, ENC_BIG_ENDIAN);
3779 proto_tree_add_item(CM_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
3781 proto_tree_add_item(CM_header_tree, hf_cm_dreq_privatedata, tvb, local_offset, 220, ENC_NA);
3782 try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->src, MadData, info, local_offset, 220);
3783 local_offset += 220;
3784 *offset = local_offset;
3787 static void parse_CM_DRsp(proto_tree *top_tree, packet_info *pinfo, tvbuff_t *tvb, gint *offset,
3788 MAD_Data *MadData, proto_tree *CM_header_tree,
3789 struct infinibandinfo *info)
3791 connection_context *connection;
3794 local_offset = *offset;
3795 proto_tree_add_item(CM_header_tree, hf_cm_drsp_localcommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3797 proto_tree_add_item(CM_header_tree, hf_cm_drsp_remotecommid, tvb, local_offset, 4, ENC_BIG_ENDIAN);
3799 proto_tree_add_item(CM_header_tree, hf_cm_drsp_privatedata, tvb, local_offset, 224, ENC_NA);
3801 /* connection is closing so remove entry from the connection table */
3802 connection = try_connection_dissectors(top_tree, pinfo, tvb, &pinfo->dst, MadData, info, local_offset, 224);
3804 remove_connection(MadData->transactionID, &pinfo->dst);
3806 local_offset += 224;
3807 *offset = local_offset;
3810 /* Parse Communication Management
3811 * IN: parentTree to add the dissection to
3812 * IN: tvb - the data buffer from wireshark
3813 * IN/OUT: The current and updated offset */
3814 static void parse_COM_MGT(proto_tree *parentTree, packet_info *pinfo, tvbuff_t *tvb, gint *offset, proto_tree* top_tree)
3817 struct infinibandinfo info = { 0, FALSE, 0, NULL, 0, 0, 0 };
3820 proto_item *CM_header_item;
3821 proto_tree *CM_header_tree;
3823 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3825 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3828 local_offset = *offset;
3830 CM_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3832 label = val_to_str_const(MadData.attributeID, CM_Attributes, "(Unknown CM Attribute)");
3834 proto_item_set_text(CM_header_item, "CM %s", label);
3835 col_add_fstr(pinfo->cinfo, COL_INFO, "CM: %s", label);
3837 CM_header_tree = proto_item_add_subtree(CM_header_item, ett_cm);
3839 info.payload_tree = parentTree;
3840 switch (MadData.attributeID) {
3842 info.cm_attribute_id = ATTR_CM_REQ;
3843 parse_CM_Req(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3846 info.cm_attribute_id = ATTR_CM_REP;
3847 parse_CM_Rsp(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3850 info.cm_attribute_id = ATTR_CM_RTU;
3851 parse_CM_Rtu(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3854 info.cm_attribute_id = ATTR_CM_REJ;
3855 parse_CM_Rej(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3858 info.cm_attribute_id = ATTR_CM_DREQ;
3859 parse_CM_DReq(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3862 info.cm_attribute_id = ATTR_CM_DRSP;
3863 parse_CM_DRsp(top_tree, pinfo, tvb, &local_offset, &MadData, CM_header_tree, &info);
3866 proto_item_append_text(CM_header_item, " (Dissector Not Implemented)");
3867 local_offset += MAD_DATA_SIZE;
3871 *offset = local_offset;
3874 /* Parse SNMP Tunneling
3875 * IN: parentTree to add the dissection to
3876 * IN: tvb - the data buffer from wireshark
3877 * IN/OUT: The current and updated offset */
3878 static void parse_SNMP(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
3880 /* Parse the Common MAD Header */
3883 proto_item *SNMP_header_item;
3885 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3887 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3890 local_offset = *offset;
3892 SNMP_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3893 local_offset += MAD_DATA_SIZE;
3894 proto_item_set_text(SNMP_header_item, "%s", "SNMP - SNMP Tunneling MAD (Dissector Not Implemented)");
3895 *offset = local_offset;
3898 /* Parse Vendor Specific Management Packets
3899 * IN: parentTree to add the dissection to
3900 * IN: tvb - the data buffer from wireshark
3901 * IN/OUT: The current and updated offset */
3902 static void parse_VENDOR_MANAGEMENT(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
3904 /* Parse the Common MAD Header */
3907 proto_item *VENDOR_header_item;
3909 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3911 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3914 local_offset = *offset;
3916 VENDOR_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3917 local_offset += MAD_DATA_SIZE;
3918 proto_item_set_text(VENDOR_header_item, "%s", "VENDOR - Vendor Specific Management MAD (Dissector Not Implemented)");
3919 *offset = local_offset;
3922 /* Parse Application Specific Management Packets
3923 * IN: parentTree to add the dissection to
3924 * IN: tvb - the data buffer from wireshark
3925 * IN/OUT: The current and updated offset */
3926 static void parse_APPLICATION_MANAGEMENT(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
3928 /* Parse the Common MAD Header */
3931 proto_item *APP_header_item;
3933 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3935 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3938 local_offset = *offset;
3939 APP_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
3940 local_offset += MAD_DATA_SIZE;
3941 proto_item_set_text(APP_header_item, "%s", "APP - Application Specific MAD (Dissector Not Implemented)");
3942 *offset = local_offset;
3945 /* Parse Reserved Management Packets.
3947 * This is an !ERROR CONDITION!
3948 * It means that the Management Class value used was defined as a reserved value for furture use.
3949 * This method is here since we will want to report this information directly to the UI without blowing up Wireshark.
3951 * IN: parentTree to add the dissection to
3952 * IN: tvb - the data buffer from wireshark
3953 * IN/OUT: The current and updated offset */
3954 static void parse_RESERVED_MANAGEMENT(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
3956 /* Parse the Common MAD Header */
3959 proto_item *RESV_header_item;
3961 if (!parse_MAD_Common(parentTree, tvb, offset, &MadData))
3963 /* TODO: Mark Corrupt Packet - Not enough bytes exist for at least the Common MAD header which is present in all MAD packets */
3966 local_offset = *offset;
3967 RESV_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 256, ENC_NA);
3968 local_offset += 256;
3969 proto_item_set_text(RESV_header_item, "%s", "RESERVED - Reserved MAD Type (Possible Device Error)");
3970 *offset = local_offset;
3973 /* Parse the common MAD Header
3974 * IN: parentTree to add the dissection to
3975 * IN: tvb - the data buffer from wireshark
3976 * IN/OUT: The current and updated offset
3977 * IN/OUT: MadData - the data from the MAD header */
3978 static gboolean parse_MAD_Common(proto_tree *parentTree, tvbuff_t *tvb, gint *offset, MAD_Data* MadData)
3980 gint local_offset = *offset;
3981 proto_item *MAD_header_item;
3982 proto_tree *MAD_header_tree;
3984 if (MadData == NULL)
3986 if (!tvb_bytes_exist(tvb, *offset, 256))
3989 /* Get the Management Class to decide between LID Routed and Direct Route */
3990 MadData->managementClass = tvb_get_guint8(tvb, local_offset + 1);
3991 MadData->classVersion = tvb_get_guint8(tvb, local_offset + 2);
3992 MadData->method = tvb_get_guint8(tvb, local_offset + 3);
3993 MadData->status = tvb_get_guint8(tvb, local_offset + 4);
3994 MadData->classSpecific = tvb_get_ntohs(tvb, local_offset + 6);
3995 MadData->transactionID = tvb_get_ntoh64(tvb, local_offset + 8);
3996 MadData->attributeID = tvb_get_ntohs(tvb, local_offset + 16);
3997 MadData->attributeModifier = tvb_get_ntohl(tvb, local_offset + 20);
3998 tvb_memcpy(tvb, MadData->data, local_offset + 24, MAD_DATA_SIZE);
4000 /* Populate the Dissector Tree */
4002 MAD_header_item = proto_tree_add_item(parentTree, hf_infiniband_MAD, tvb, local_offset, 256, ENC_NA);
4003 proto_item_set_text(MAD_header_item, "%s", "MAD Header - Common Management Datagram");
4004 MAD_header_tree = proto_item_add_subtree(MAD_header_item, ett_mad);
4006 proto_tree_add_item(MAD_header_tree, hf_infiniband_base_version, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4008 proto_tree_add_item(MAD_header_tree, hf_infiniband_mgmt_class, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4010 proto_tree_add_item(MAD_header_tree, hf_infiniband_class_version, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4012 proto_tree_add_item(MAD_header_tree, hf_infiniband_method, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4014 proto_tree_add_item(MAD_header_tree, hf_infiniband_status, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4016 proto_tree_add_item(MAD_header_tree, hf_infiniband_class_specific, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4018 proto_tree_add_item(MAD_header_tree, hf_infiniband_transaction_id, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4020 proto_tree_add_item(MAD_header_tree, hf_infiniband_attribute_id, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4022 proto_tree_add_item(MAD_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
4024 proto_tree_add_item(MAD_header_tree, hf_infiniband_attribute_modifier, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4026 proto_tree_add_item(MAD_header_tree, hf_infiniband_data, tvb, local_offset, MAD_DATA_SIZE, ENC_NA);
4027 *offset = local_offset; /* Move the offset to the start of the Data field - this will be where the other parsers start. */
4032 /* Parse the RMPP (Reliable Multi-Packet Transaction Protocol
4033 * IN: parentTree to add the dissection to
4034 * IN: tvb - the data buffer from wireshark
4035 * IN/OUT: The current and updated offset */
4036 static gboolean parse_RMPP(proto_tree *parentTree, tvbuff_t *tvb, gint *offset)
4038 gint local_offset = *offset;
4039 guint8 RMPP_Type = tvb_get_guint8(tvb, local_offset + 1);
4040 proto_item *RMPP_header_item;
4041 proto_tree *RMPP_header_tree;
4043 RMPP_header_item = proto_tree_add_item(parentTree, hf_infiniband_RMPP, tvb, local_offset, 12, ENC_NA);
4044 proto_item_set_text(RMPP_header_item, "%s", val_to_str(RMPP_Type, RMPP_Packet_Types, "Reserved RMPP Type! (0x%02x)"));
4045 RMPP_header_tree = proto_item_add_subtree(RMPP_header_item, ett_rmpp);
4047 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_version, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4049 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4051 proto_tree_add_item(RMPP_header_tree, hf_infiniband_r_resp_time, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4052 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_flags, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4054 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_status, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4059 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_data1, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4061 proto_tree_add_item(RMPP_header_tree, hf_infiniband_rmpp_data2, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4065 proto_tree_add_item(RMPP_header_tree, hf_infiniband_segment_number, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4067 proto_tree_add_item(RMPP_header_tree, hf_infiniband_payload_length32, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4069 proto_tree_add_item(RMPP_header_tree, hf_infiniband_transferred_data, tvb, local_offset, 220, ENC_NA);
4072 proto_tree_add_item(RMPP_header_tree, hf_infiniband_segment_number, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4074 proto_tree_add_item(RMPP_header_tree, hf_infiniband_new_window_last, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4076 proto_tree_add_item(RMPP_header_tree, hf_infiniband_reserved, tvb, local_offset, 220, ENC_NA);
4080 proto_tree_add_item(RMPP_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
4082 proto_tree_add_item(RMPP_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
4084 proto_tree_add_item(RMPP_header_tree, hf_infiniband_optional_extended_error_data, tvb, local_offset, 220, ENC_NA);
4089 *offset = local_offset;
4093 /* Parse the Method from the MAD Common Header.
4094 * Simply used to generate the identifier.
4095 * IN: SubMItem - the item to append the method label to.
4096 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4097 * IN: pinfo - packet info from wireshark. */
4098 static void label_SUBM_Method(proto_item *SubMItem, MAD_Data *MadHeader, packet_info *pinfo)
4100 const char *label = val_to_str_const(MadHeader->method, SUBM_Methods, "(Unknown SubManagement Method!)");
4102 proto_item_append_text(SubMItem, "%s", label);
4103 col_append_str(pinfo->cinfo, COL_INFO, label);
4106 /* Parse the SA Method from the MAD Common Header.
4107 * Simply used to generate the identifier.
4108 * IN: SubAItem - the item to append the method label to.
4109 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4110 * IN: pinfo - packet info from wireshark. */
4111 static void label_SUBA_Method(proto_item *SubAItem, MAD_Data *MadHeader, packet_info *pinfo)
4113 const char *label = val_to_str_const(MadHeader->method, SUBA_Methods, "(Unknown SubAdministration Method!)");
4115 proto_item_append_text(SubAItem, "%s", label);
4116 col_append_str(pinfo->cinfo, COL_INFO, label);
4119 /* Parse the Attribute from the MAD Common Header
4120 * Simply used to generate the identifier.
4121 * IN: SubMItem - the item to append the Attribute label to.
4122 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4123 * IN: pinfo - packet info from wireshark. */
4124 static void label_SUBM_Attribute(proto_item *SubMItem, MAD_Data *MadHeader, packet_info *pinfo)
4126 const char *label = val_to_str_const(MadHeader->attributeID, SUBM_Attributes, "(Unknown SubManagement Attribute!)");
4128 proto_item_append_text(SubMItem, "%s", &label[11]);
4129 col_append_str(pinfo->cinfo, COL_INFO, &label[11]);
4132 /* Parse the SA Attribute from the MAD Common Header
4133 * Simply used to generate the identifier.
4134 * IN: SubAItem - the item to append the Attribute label to.
4135 * IN: MadHeader - the MadData structure that contains the information from the Common MAD header.
4136 * IN: pinfo - packet info from wireshark. */
4137 static void label_SUBA_Attribute(proto_item *SubAItem, MAD_Data *MadHeader, packet_info *pinfo)
4139 const char *label = val_to_str_const(MadHeader->attributeID, SUBA_Attributes, "(Unknown SubAdministration Attribute!)");
4141 proto_item_append_text(SubAItem, "%s", &label[11]);
4142 col_append_str(pinfo->cinfo, COL_INFO, &label[11]);
4145 /* Parse the attribute from a Subnet Management Packet.
4146 * IN: Parent Tree to add the item to in the dissection tree
4147 * IN: tvbuff, offset - the data and where it is.
4148 * IN: MAD_Data the data from the Common MAD Header that provides the information we need */
4149 static gboolean parse_SUBM_Attribute(proto_tree *parentTree, tvbuff_t *tvb, gint *offset, MAD_Data *MadHeader)
4151 guint16 attributeID = MadHeader->attributeID;
4152 proto_item *SUBM_Attribute_header_item;
4153 proto_tree *SUBM_Attribute_header_tree;
4155 SUBM_Attribute_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, *offset, 64, ENC_NA);
4156 proto_item_set_text(SUBM_Attribute_header_item, "%s", val_to_str(attributeID, SUBM_Attributes, "Unknown Attribute Type! (0x%02x)"));
4157 SUBM_Attribute_header_tree = proto_item_add_subtree(SUBM_Attribute_header_item, ett_subm_attribute);
4160 switch (attributeID)
4163 parse_NoticesAndTraps(SUBM_Attribute_header_tree , tvb, offset);
4166 parse_NodeDescription(SUBM_Attribute_header_tree , tvb, offset);
4169 parse_NodeInfo(SUBM_Attribute_header_tree , tvb, offset);
4172 parse_SwitchInfo(SUBM_Attribute_header_tree , tvb, offset);
4175 parse_GUIDInfo(SUBM_Attribute_header_tree , tvb, offset);
4178 parse_PortInfo(SUBM_Attribute_header_tree , tvb, offset);
4181 parse_P_KeyTable(SUBM_Attribute_header_tree , tvb, offset);
4184 parse_SLtoVLMappingTable(SUBM_Attribute_header_tree , tvb, offset);
4187 parse_VLArbitrationTable(SUBM_Attribute_header_tree , tvb, offset);
4190 parse_LinearForwardingTable(SUBM_Attribute_header_tree , tvb, offset);
4193 parse_RandomForwardingTable(SUBM_Attribute_header_tree , tvb, offset);
4196 parse_MulticastForwardingTable(SUBM_Attribute_header_tree , tvb, offset);
4199 parse_LinkSpeedWidthPairsTable(SUBM_Attribute_header_tree , tvb, offset);
4202 parse_SMInfo(SUBM_Attribute_header_tree , tvb, offset);
4205 parse_VendorDiag(SUBM_Attribute_header_tree , tvb, offset);
4208 parse_LedInfo(SUBM_Attribute_header_tree , tvb, offset);
4219 /* Parse the attribute from a Subnet Administration Packet.
4220 * IN: Parent Tree to add the item to in the dissection tree
4221 * IN: tvbuff, offset - the data and where it is.
4222 * IN: MAD_Data the data from the Common MAD Header that provides the information we need */
4223 static gboolean parse_SUBA_Attribute(proto_tree *parentTree, tvbuff_t *tvb, gint *offset, MAD_Data *MadHeader)
4225 guint16 attributeID = MadHeader->attributeID;
4226 proto_item *SUBA_Attribute_header_item;
4227 proto_tree *SUBA_Attribute_header_tree;
4229 SUBA_Attribute_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, *offset, 200, ENC_NA);
4230 proto_item_set_text(SUBA_Attribute_header_item, "%s", val_to_str(attributeID, SUBA_Attributes, "Unknown Attribute Type! (0x%02x)"));
4231 SUBA_Attribute_header_tree = proto_item_add_subtree(SUBA_Attribute_header_item, ett_suba_attribute);
4233 /* Skim off the RID fields should they be present */
4234 parse_RID(SUBA_Attribute_header_tree, tvb, offset, MadHeader);
4236 /* Parse the rest of the attributes */
4237 switch (MadHeader->attributeID)
4239 case 0x0001: /* (ClassPortInfo) */
4240 parse_ClassPortInfo(SUBA_Attribute_header_tree, tvb, offset);
4242 case 0x0002: /* (Notice) */
4243 parse_NoticesAndTraps(SUBA_Attribute_header_tree, tvb, offset);
4245 case 0x0003: /* (InformInfo) */
4246 parse_InformInfo(SUBA_Attribute_header_tree, tvb, offset);
4248 case 0x0011: /* (NodeRecord) */
4249 parse_NodeInfo(SUBA_Attribute_header_tree, tvb, offset);
4251 parse_NodeDescription(SUBA_Attribute_header_tree, tvb, offset);
4253 case 0x0012: /* (PortInfoRecord) */
4254 parse_PortInfo(SUBA_Attribute_header_tree, tvb, offset);
4256 case 0x0013: /* (SLtoVLMappingTableRecord) */
4257 parse_SLtoVLMappingTable(SUBA_Attribute_header_tree, tvb, offset);
4259 case 0x0014: /* (SwitchInfoRecord) */
4260 parse_SwitchInfo(SUBA_Attribute_header_tree, tvb, offset);
4262 case 0x0015: /*(LinearForwardingTableRecord) */
4263 parse_LinearForwardingTable(SUBA_Attribute_header_tree, tvb, offset);
4265 case 0x0016: /* (RandomForwardingTableRecord) */
4266 parse_RandomForwardingTable(SUBA_Attribute_header_tree, tvb, offset);
4268 case 0x0017: /* (MulticastForwardingTableRecord) */
4269 parse_MulticastForwardingTable(SUBA_Attribute_header_tree, tvb, offset);
4271 case 0x0018: /* (SMInfoRecord) */
4272 parse_SMInfo(SUBA_Attribute_header_tree, tvb, offset);
4274 case 0x0019: /* (LinkSpeedWidthPairsTableRecord) */
4275 parse_LinkSpeedWidthPairsTable(SUBA_Attribute_header_tree, tvb, offset);
4277 case 0x00F3: /*(InformInfoRecord) */
4278 parse_InformInfo(SUBA_Attribute_header_tree, tvb, offset);
4280 case 0x0020: /* (LinkRecord) */
4281 parse_LinkRecord(SUBA_Attribute_header_tree, tvb, offset);
4283 case 0x0030: /* (GuidInfoRecord) */
4284 parse_GUIDInfo(SUBA_Attribute_header_tree, tvb, offset);
4286 case 0x0031: /*(ServiceRecord) */
4287 parse_ServiceRecord(SUBA_Attribute_header_tree, tvb, offset);
4289 case 0x0033: /* (P_KeyTableRecord) */
4290 parse_P_KeyTable(SUBA_Attribute_header_tree, tvb, offset);
4292 case 0x0035: /* (PathRecord) */
4293 parse_PathRecord(SUBA_Attribute_header_tree, tvb, offset);
4295 case 0x0036: /* (VLArbitrationTableRecord) */
4296 parse_VLArbitrationTable(SUBA_Attribute_header_tree, tvb, offset);
4298 case 0x0038: /* (MCMemberRecord) */
4299 parse_MCMemberRecord(SUBA_Attribute_header_tree, tvb, offset);
4301 case 0x0039: /* (TraceRecord) */
4302 parse_TraceRecord(SUBA_Attribute_header_tree, tvb, offset);
4304 case 0x003A: /* (MultiPathRecord) */
4305 parse_MultiPathRecord(SUBA_Attribute_header_tree, tvb, offset);
4307 case 0x003B: /* (ServiceAssociationRecord) */
4308 parse_ServiceAssociationRecord(SUBA_Attribute_header_tree, tvb, offset);
4310 default: /* (Unknown SubAdministration Attribute!) */
4311 /* We've already labeled as unknown in item construction */
4319 /* Subnet Management Attribute Parsing Methods.
4320 * Also Parsing for Attributes common to both SM/SA.
4321 * The Subnet Admin Parsing methods will call some of these methods when an attribute is present within an SA MAD
4325 /* Parse ClassPortInfo Attribute Field
4326 * IN: parentTree - The tree to add the dissection to
4327 * tvb - The tvbbuff of packet data
4328 * offset - The offset in TVB where the attribute begins */
4329 static int parse_ClassPortInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4331 gint local_offset = *offset;
4332 proto_tree *ClassPortInfo_header_tree;
4337 ClassPortInfo_header_tree = parentTree;
4339 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_BaseVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4341 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_ClassVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4343 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_CapabilityMask, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4345 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_CapabilityMask2, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4348 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RespTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4350 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectGID, tvb, local_offset, 16, ENC_NA);
4352 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectTC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4354 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectSL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4355 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectFL, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4357 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4359 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectP_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4361 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_Reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4363 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectQP, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4365 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_RedirectQ_Key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4368 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapGID, tvb, local_offset, 16, ENC_NA);
4370 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapTC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4372 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapSL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4373 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapFL, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4375 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4377 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapP_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4379 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_Reserved, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4381 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapQP, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4383 proto_tree_add_item(ClassPortInfo_header_tree, hf_infiniband_ClassPortInfo_TrapQ_Key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4386 return local_offset;
4389 /* Parse NoticeDataDetails Attribute Field
4390 * IN: parentTree - The tree to add the dissection to
4391 * tvb - The tvbbuff of packet data
4392 * offset - The offset in TVB where the attribute begins
4393 * trapNumber - The Trap ID of the Trap Data being Dissected */
4395 static gint parse_NoticeDataDetails(proto_tree* parentTree, tvbuff_t* tvb, gint *offset, guint16 trapNumber)
4397 gint local_offset = *offset;
4398 proto_item *DataDetails_header_item;
4399 proto_tree *DataDetails_header_tree;
4404 DataDetails_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 54, ENC_NA);
4405 DataDetails_header_tree = proto_item_add_subtree(DataDetails_header_item, ett_datadetails);
4411 proto_item_set_text(DataDetails_header_item, "%s", "Trap 64 DataDetails");
4413 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4417 proto_item_set_text(DataDetails_header_item, "%s", "Trap 65 DataDetails");
4419 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4423 proto_item_set_text(DataDetails_header_item, "%s", "Trap 66 DataDetails");
4425 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4429 proto_item_set_text(DataDetails_header_item, "%s", "Trap 67 DataDetails");
4431 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR, tvb, local_offset, 16, ENC_NA);
4435 proto_item_set_text(DataDetails_header_item, "%s", "Trap 68 DataDetails");
4436 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_COMP_MASK, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4438 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_WAIT_FOR_REPATH, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4441 proto_item_set_text(DataDetails_header_item, "%s", "Trap 69 DataDetails");
4442 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_COMP_MASK, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4444 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_WAIT_FOR_REPATH, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4447 proto_item_set_text(DataDetails_header_item, "%s", "Trap 128 DataDetails");
4448 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4452 proto_item_set_text(DataDetails_header_item, "%s", "Trap 129 DataDetails");
4454 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4456 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4460 proto_item_set_text(DataDetails_header_item, "%s", "Trap 130 DataDetails");
4462 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4464 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4468 proto_item_set_text(DataDetails_header_item, "%s", "Trap 131 DataDetails");
4470 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4472 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4476 proto_item_set_text(DataDetails_header_item, "%s", "Trap 144 DataDetails");
4478 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4481 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_OtherLocalChanges, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4483 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_CAPABILITYMASK, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4486 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LinkSpeecEnabledChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4487 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LinkWidthEnabledChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4488 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_NodeDescriptionChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4491 proto_item_set_text(DataDetails_header_item, "%s", "Trap 145 DataDetails");
4493 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4496 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SYSTEMIMAGEGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4500 proto_item_set_text(DataDetails_header_item, "%s", "Trap 256 DataDetails");
4502 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4504 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRSLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4506 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_METHOD, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4509 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_ATTRIBUTEID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4511 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_ATTRIBUTEMODIFIER, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4513 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_MKEY, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4516 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRNotice, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4517 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRPathTruncated, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4518 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRHopCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4520 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DRNoticeReturnPath, tvb, local_offset, 30, ENC_NA);
4524 proto_item_set_text(DataDetails_header_item, "%s", "Trap 257 DataDetails");
4526 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR1, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4528 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR2, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4530 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_KEY, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4532 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4534 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP1, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4537 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP2, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4539 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR1, tvb, local_offset, 16, ENC_NA);
4541 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR2, tvb, local_offset, 16, ENC_NA);
4545 proto_item_set_text(DataDetails_header_item, "%s", "Trap 258 DataDetails");
4547 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR1, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4549 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR2, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4551 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_KEY, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4553 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN); local_offset += 1;
4554 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP1, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4557 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP2, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4559 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR1, tvb, local_offset, 16, ENC_NA);
4561 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR2, tvb, local_offset, 16, ENC_NA);
4565 proto_item_set_text(DataDetails_header_item, "%s", "Trap 259 DataDetails");
4566 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_DataValid, tvb, local_offset, 2, ENC_NA);
4568 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR1, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4570 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_LIDADDR2, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4572 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PKEY, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4574 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4576 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP1, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4579 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_QP2, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4581 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR1, tvb, local_offset, 16, ENC_NA);
4583 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_GIDADDR2, tvb, local_offset, 16, ENC_NA);
4585 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_SWLIDADDR, tvb, local_offset, 2, ENC_NA);
4587 proto_tree_add_item(DataDetails_header_tree, hf_infiniband_Trap_PORTNO, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4591 proto_item_set_text(DataDetails_header_item, "%s", "Vendor Specific Subnet Management Trap");
4596 return local_offset;
4599 /* Parse NoticesAndTraps Attribute
4600 * IN: parentTree - The tree to add the dissection to
4601 * tvb - The tvbbuff of packet data
4602 * offset - The offset in TVB where the attribute begins */
4603 static void parse_NoticesAndTraps(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4605 gint local_offset = *offset;
4606 proto_item *NoticesAndTraps_header_item;
4607 proto_tree *NoticesAndTraps_header_tree;
4608 guint16 trapNumber = tvb_get_ntohs(tvb, local_offset + 4);
4613 NoticesAndTraps_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
4614 proto_item_set_text(NoticesAndTraps_header_item, "%s", val_to_str(trapNumber, Trap_Description, "Unknown or Vendor Specific Trap Number! (0x%02x)"));
4615 NoticesAndTraps_header_tree = proto_item_add_subtree(NoticesAndTraps_header_item, ett_noticestraps);
4617 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_IsGeneric, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4618 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_Type, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4620 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_ProducerTypeVendorID, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4622 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_TrapNumberDeviceID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4624 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_IssuerLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4626 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_NoticeToggle, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4627 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_NoticeCount, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4630 parse_NoticeDataDetails(NoticesAndTraps_header_tree, tvb, &local_offset, trapNumber);
4631 proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_DataDetails, tvb, local_offset, 54, ENC_NA);
4634 #if 0 /* Only Defined For GMPs not SMPs which is not part of this dissector phase */
4635 *proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_IssuerGID, tvb, local_offset, 16, ENC_NA);
4637 *proto_tree_add_item(NoticesAndTraps_header_tree, hf_infiniband_Notice_ClassTrapSpecificData, tvb, local_offset, 1, ENC_NA);
4643 /* Parse NodeDescription Attribute
4644 * IN: parentTree - The tree to add the dissection to
4645 * tvb - The tvbbuff of packet data
4646 * offset - The offset in TVB where the attribute begins */
4647 static void parse_NodeDescription(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4649 gint local_offset = *offset;
4650 proto_tree *NodeDescription_header_tree;
4655 NodeDescription_header_tree = parentTree;
4656 proto_tree_add_item(NodeDescription_header_tree, hf_infiniband_NodeDescription_NodeString, tvb, local_offset, 64, ENC_ASCII|ENC_NA);
4659 /* Parse NodeInfo Attribute
4660 * IN: parentTree - The tree to add the dissection to
4661 * tvb - The tvbbuff of packet data
4662 * offset - The offset in TVB where the attribute begins */
4663 static int parse_NodeInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4665 gint local_offset = *offset;
4666 proto_tree *NodeInfo_header_tree;
4671 NodeInfo_header_tree = parentTree;
4673 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_BaseVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4675 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_ClassVersion, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4677 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_NodeType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4679 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_NumPorts, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4681 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_SystemImageGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4683 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_NodeGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4685 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_PortGUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4687 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_PartitionCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4689 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_DeviceID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4691 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_Revision, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4693 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_LocalPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4695 proto_tree_add_item(NodeInfo_header_tree, hf_infiniband_NodeInfo_VendorID, tvb, local_offset, 3, ENC_BIG_ENDIAN);
4698 return local_offset;
4702 /* Parse SwitchInfo Attribute
4703 * IN: parentTree - The tree to add the dissection to
4704 * tvb - The tvbbuff of packet data
4705 * offset - The offset in TVB where the attribute begins */
4706 static int parse_SwitchInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4708 gint local_offset = *offset;
4709 proto_tree *SwitchInfo_header_tree;
4714 SwitchInfo_header_tree = parentTree;
4716 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LinearFDBCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4718 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_RandomFDBCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4720 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_MulticastFDBCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4722 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LinearFDBTop, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4724 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_DefaultPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4726 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_DefaultMulticastPrimaryPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4728 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_DefaultMulticastNotPrimaryPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4730 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LifeTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4731 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_PortStateChange, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4732 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_OptimizedSLtoVLMappingProgramming, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4734 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_LIDsPerPort, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4736 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_PartitionEnforcementCap, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4738 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_InboundEnforcementCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4739 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_OutboundEnforcementCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4740 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_FilterRawInboundCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4741 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_FilterRawOutboundCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4742 proto_tree_add_item(SwitchInfo_header_tree, hf_infiniband_SwitchInfo_EnhancedPortZero, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4745 return local_offset;
4748 /* Parse GUIDInfo Attribute
4749 * IN: parentTree - The tree to add the dissection to
4750 * tvb - The tvbbuff of packet data
4751 * offset - The offset in TVB where the attribute begins */
4752 static int parse_GUIDInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4754 gint local_offset = *offset;
4755 proto_tree *GUIDInfo_header_tree;
4756 proto_item *tempItemLow;
4762 GUIDInfo_header_tree = parentTree;
4764 for (i = 0; i < 8; i++)
4766 tempItemLow = proto_tree_add_item(GUIDInfo_header_tree, hf_infiniband_GUIDInfo_GUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4768 proto_item_append_text(tempItemLow, "(%u)", i);
4770 return local_offset;
4773 /* Parse PortInfo Attribute
4774 * IN: parentTree - The tree to add the dissection to
4775 * tvb - The tvbbuff of packet data
4776 * offset - The offset in TVB where the attribute begins */
4777 static int parse_PortInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
4779 gint local_offset = *offset;
4780 proto_tree *PortInfo_header_tree;
4781 proto_item *PortInfo_CapabilityMask_item;
4782 proto_tree *PortInfo_CapabilityMask_tree;
4783 proto_item *temp_item;
4789 PortInfo_header_tree = parentTree;
4791 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_Key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4793 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_GidPrefix, tvb, local_offset, 8, ENC_BIG_ENDIAN);
4795 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4797 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MasterSMLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4800 /* Capability Mask Flags */
4801 PortInfo_CapabilityMask_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_CapabilityMask, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4802 PortInfo_CapabilityMask_tree = proto_item_add_subtree(PortInfo_CapabilityMask_item, ett_portinfo_capmask);
4804 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SM, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4805 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_NoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4806 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_TrapSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4807 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_OptionalIPDSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4808 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_AutomaticMigrationSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4809 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SLMappingSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4810 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_MKeyNVRAM, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4811 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_PKeyNVRAM, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4812 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_LEDInfoSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4813 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SMdisabled, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4814 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SystemImageGUIDSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4815 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_PKeySwitchExternalPortTrapSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4816 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_CommunicationManagementSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4817 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_SNMPTunnelingSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4818 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_ReinitSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4819 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_DeviceManagementSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4820 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_VendorClassSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4821 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_DRNoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4822 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_CapabilityMaskNoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4823 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_BootManagementSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4824 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_LinkRoundTripLatencySupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4825 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_ClientRegistrationSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4826 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_OtherLocalChangesNoticeSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4827 proto_tree_add_item(PortInfo_CapabilityMask_tree, hf_infiniband_PortInfo_CapabilityMask_LinkSpeedWIdthPairsTableSupported, tvb, local_offset, 4, ENC_BIG_ENDIAN);
4829 /* End Capability Mask Flags */
4832 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_DiagCode, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4833 temp_val = tvb_get_ntohs(tvb, local_offset);
4835 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, DiagCode, "Reserved DiagCode! Possible Error"));
4839 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_KeyLeasePeriod, tvb, local_offset, 2, ENC_BIG_ENDIAN);
4841 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LocalPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4844 /* LinkWidthEnabled */
4845 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkWidthEnabled, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4846 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4848 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkWidthEnabled, "Reserved LinkWidthEnabled Value! Possible Error"));
4850 /* End LinkWidthEnabled */
4852 /* LinkWidthSupported */
4853 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkWidthSupported, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4854 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4856 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkWidthSupported, "Reserved LinkWidthSupported Value! Possible Error"));
4858 /* End LinkWidthSupported */
4860 /* LinkWidthActive */
4861 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkWidthActive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4862 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4864 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkWidthActive, "Reserved LinkWidthActive Value! Possible Error"));
4866 /* End LinkWidthActive */
4868 /* LinkSpeedSupported */
4869 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkSpeedSupported, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4870 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4872 /* 4 bit values = mask and shift */
4873 temp_val = temp_val & 0x00F0;
4874 temp_val = temp_val >> 4;
4876 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkSpeedSupported, "Reserved LinkWidthSupported Value! Possible Error"));
4877 /* End LinkSpeedSupported */
4880 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PortState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4881 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4883 /* 4 bit values = mask and shift */
4884 temp_val = temp_val & 0x000F;
4885 /*temp_val = temp_val >> 4 */
4887 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, PortState, "Reserved PortState Value! Possible Error"));
4891 /* PortPhysicalState */
4892 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PortPhysicalState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4893 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4895 /* 4 bit values = mask and shift */
4896 temp_val = temp_val & 0x00F0;
4897 temp_val = temp_val >> 4;
4899 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, PortPhysicalState, "Reserved PortPhysicalState Value! Possible Error"));
4900 /* End PortPhysicalState */
4902 /* LinkDownDefaultState */
4903 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkDownDefaultState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4904 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4906 /* 4 bit values = mask and shift */
4907 temp_val = temp_val & 0x000F;
4908 /*temp_val = temp_val >> 4 */
4910 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkDownDefaultState, "Reserved LinkDownDefaultState Value! Possible Error"));
4912 /* End LinkDownDefaultState */
4914 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_KeyProtectBits, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4915 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LMC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4918 /* LinkSpeedActive */
4919 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkSpeedActive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4920 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4922 /* 4 bit values = mask and shift */
4923 temp_val = temp_val & 0x00F0;
4924 temp_val = temp_val >> 4;
4926 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkSpeedActive, "Reserved LinkSpeedActive Value! Possible Error"));
4927 /* End LinkSpeedActive */
4929 /* LinkSpeedEnabled */
4930 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkSpeedEnabled, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4931 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4933 /* 4 bit values = mask and shift */
4934 temp_val = temp_val & 0x000F;
4935 /*temp_val = temp_val >> 4 */
4937 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, LinkSpeedEnabled, "Reserved LinkSpeedEnabled Value! Possible Error"));
4939 /* End LinkSpeedEnabled */
4942 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_NeighborMTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4943 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4945 /* 4 bit values = mask and shift */
4946 temp_val = temp_val & 0x00F0;
4947 temp_val = temp_val >> 4;
4949 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, NeighborMTU, "Reserved NeighborMTU Value! Possible Error"));
4951 /* End NeighborMTU */
4953 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MasterSMSL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4957 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4958 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4960 /* 4 bit values = mask and shift */
4961 temp_val = temp_val & 0x00F0;
4962 temp_val = temp_val >> 4;
4964 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, VLCap, "Reserved VLCap Value! Possible Error"));
4968 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_InitType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4970 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLHighLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4972 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLArbitrationHighCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4974 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLArbitrationLowCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4976 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_InitTypeReply, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4979 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MTUCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4980 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4982 /* 4 bit values = mask and shift */
4983 temp_val = temp_val & 0x000F;
4984 /*temp_val = temp_val >> 4 */
4986 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, MTUCap, "Reserved MTUCap Value! Possible Error"));
4990 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_VLStallCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4991 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_HOQLife, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4994 /* OperationalVLs */
4995 temp_item = proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_OperationalVLs, tvb, local_offset, 1, ENC_BIG_ENDIAN);
4996 temp_val = (guint16)tvb_get_guint8(tvb, local_offset);
4998 /* 4 bit values = mask and shift */
4999 temp_val = temp_val & 0x00F0;
5000 temp_val = temp_val >> 4;
5002 proto_item_append_text(temp_item, ", %s", val_to_str_const(temp_val, OperationalVLs, "Reserved OperationalVLs Value! Possible Error"));
5003 /* End OperationalVLs */
5005 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PartitionEnforcementInbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5006 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_PartitionEnforcementOutbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5007 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_FilterRawInbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5008 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_FilterRawOutbound, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5010 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_M_KeyViolations, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5012 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_P_KeyViolations, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5014 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_Q_KeyViolations, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5016 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_GUIDCap, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5018 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_ClientReregister, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5019 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_SubnetTimeOut, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5021 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_RespTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5023 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LocalPhyErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5024 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_OverrunErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5026 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_MaxCreditHint, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5027 local_offset += 3; /* 2 + 1 Reserved */
5028 proto_tree_add_item(PortInfo_header_tree, hf_infiniband_PortInfo_LinkRoundTripLatency, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5031 return local_offset;
5034 /* Parse P_KeyTable Attribute
5035 * IN: parentTree - The tree to add the dissection to
5036 * tvb - The tvbbuff of packet data
5037 * offset - The offset in TVB where the attribute begins */
5038 static void parse_P_KeyTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5040 gint local_offset = *offset;
5042 proto_item *P_KeyTable_header_item;
5043 proto_tree *P_KeyTable_header_tree;
5044 proto_item *tempItemLow;
5045 proto_item *tempItemHigh;
5050 P_KeyTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_P_KeyTable_P_KeyTableBlock, tvb, local_offset, 64, ENC_NA);
5051 proto_item_set_text(P_KeyTable_header_item, "%s", "P_KeyTable");
5052 P_KeyTable_header_tree = proto_item_add_subtree(P_KeyTable_header_item, ett_pkeytable);
5054 for (i = 0; i < 32; i++)
5056 tempItemLow = proto_tree_add_item(P_KeyTable_header_tree, hf_infiniband_P_KeyTable_MembershipType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5057 tempItemHigh = proto_tree_add_item(P_KeyTable_header_tree, hf_infiniband_P_KeyTable_P_KeyBase, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5059 proto_item_append_text(tempItemLow, "(%u)", i);
5060 proto_item_append_text(tempItemHigh, "(%u)", i+1);
5064 /* Parse SLtoVLMappingTable Attribute
5065 * IN: parentTree - The tree to add the dissection to
5066 * tvb - The tvbbuff of packet data
5067 * offset - The offset in TVB where the attribute begins */
5068 static void parse_SLtoVLMappingTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5070 gint local_offset = *offset;
5071 proto_item *SLtoVLMappingTable_header_item;
5072 proto_tree *SLtoVLMappingTable_header_tree;
5073 proto_item *tempItemLow;
5074 proto_item *tempItemHigh;
5080 SLtoVLMappingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5081 proto_item_set_text(SLtoVLMappingTable_header_item, "%s", "SLtoVLMappingTable");
5082 SLtoVLMappingTable_header_tree = proto_item_add_subtree(SLtoVLMappingTable_header_item, ett_sltovlmapping);
5084 for (i = 0; i < 8; i++)
5086 tempItemLow = proto_tree_add_item(SLtoVLMappingTable_header_tree, hf_infiniband_SLtoVLMappingTable_SLtoVL_HighBits, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5087 tempItemHigh = proto_tree_add_item(SLtoVLMappingTable_header_tree, hf_infiniband_SLtoVLMappingTable_SLtoVL_LowBits, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5089 proto_item_append_text(tempItemLow, "(%u)", i);
5090 proto_item_append_text(tempItemHigh, "(%u)", i+1);
5094 /* Parse VLArbitrationTable Attribute
5095 * IN: parentTree - The tree to add the dissection to
5096 * tvb - The tvbbuff of packet data
5097 * offset - The offset in TVB where the attribute begins */
5098 static void parse_VLArbitrationTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5100 gint local_offset = *offset;
5102 proto_item *VLArbitrationTable_header_item;
5103 proto_tree *VLArbitrationTable_header_tree;
5104 proto_item *tempItemLow;
5105 proto_item *tempItemHigh;
5110 VLArbitrationTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5111 proto_item_set_text(VLArbitrationTable_header_item, "%s", "VLArbitrationTable");
5112 VLArbitrationTable_header_tree = proto_item_add_subtree(VLArbitrationTable_header_item, ett_vlarbitrationtable);
5114 for (i = 0; i < 32; i++)
5116 tempItemLow = proto_tree_add_item(VLArbitrationTable_header_tree, hf_infiniband_VLArbitrationTable_VL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5118 tempItemHigh = proto_tree_add_item(VLArbitrationTable_header_tree, hf_infiniband_VLArbitrationTable_Weight, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5120 proto_item_append_text(tempItemLow, "(%u)", i);
5121 proto_item_append_text(tempItemHigh, "(%u)", i);
5125 /* Parse LinearForwardingTable Attribute
5126 * IN: parentTree - The tree to add the dissection to
5127 * tvb - The tvbbuff of packet data
5128 * offset - The offset in TVB where the attribute begins */
5129 static void parse_LinearForwardingTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5132 gint local_offset = *offset;
5133 proto_item *LinearForwardingTable_header_item;
5134 proto_tree *LinearForwardingTable_header_tree;
5135 proto_item *tempItemLow;
5140 LinearForwardingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5141 proto_item_set_text(LinearForwardingTable_header_item, "%s", "LinearForwardingTable");
5142 LinearForwardingTable_header_tree = proto_item_add_subtree(LinearForwardingTable_header_item, ett_linearforwardingtable);
5144 for (i = 0; i < 64; i++)
5146 tempItemLow = proto_tree_add_item(LinearForwardingTable_header_tree, hf_infiniband_LinearForwardingTable_Port, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5148 proto_item_append_text(tempItemLow, "(%u)", i);
5152 /* Parse RandomForwardingTable Attribute
5153 * IN: parentTree - The tree to add the dissection to
5154 * tvb - The tvbbuff of packet data
5155 * offset - The offset in TVB where the attribute begins */
5156 static void parse_RandomForwardingTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5159 gint local_offset = *offset;
5160 proto_item *RandomForwardingTable_header_item;
5161 proto_tree *RandomForwardingTable_header_tree;
5162 proto_item *tempItemLow;
5167 RandomForwardingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5168 proto_item_set_text(RandomForwardingTable_header_item, "%s", "RandomForwardingTable");
5169 RandomForwardingTable_header_tree = proto_item_add_subtree(RandomForwardingTable_header_item, ett_randomforwardingtable);
5171 for (i = 0; i < 16; i++)
5173 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5175 proto_item_append_text(tempItemLow, "(%u)", i);
5176 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_Valid, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5177 proto_item_append_text(tempItemLow, "(%u)", i);
5178 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_LMC, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5180 proto_item_append_text(tempItemLow, "(%u)", i);
5181 tempItemLow = proto_tree_add_item(RandomForwardingTable_header_tree, hf_infiniband_RandomForwardingTable_Port, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5183 proto_item_append_text(tempItemLow, "(%u)", i);
5187 /* Parse NoticesAndTraps Attribute
5188 * IN: parentTree - The tree to add the dissection to
5189 * tvb - The tvbbuff of packet data
5190 * offset - The offset in TVB where the attribute begins */
5191 static void parse_MulticastForwardingTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5194 gint local_offset = *offset;
5195 proto_item *MulticastForwardingTable_header_item;
5196 proto_tree *MulticastForwardingTable_header_tree;
5197 proto_item *tempItemLow;
5202 MulticastForwardingTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5203 proto_item_set_text(MulticastForwardingTable_header_item, "%s", "MulticastForwardingTable");
5204 MulticastForwardingTable_header_tree = proto_item_add_subtree(MulticastForwardingTable_header_item, ett_multicastforwardingtable);
5206 for (i = 0; i < 16; i++)
5208 tempItemLow = proto_tree_add_item(MulticastForwardingTable_header_tree, hf_infiniband_MulticastForwardingTable_PortMask, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5210 proto_item_append_text(tempItemLow, "(%u)", i);
5215 /* Parse SMInfo Attribute
5216 * IN: parentTree - The tree to add the dissection to
5217 * tvb - The tvbbuff of packet data
5218 * offset - The offset in TVB where the attribute begins */
5219 static int parse_SMInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5221 gint local_offset = *offset;
5222 proto_item *SMInfo_header_item;
5223 proto_tree *SMInfo_header_tree;
5228 SMInfo_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5229 proto_item_set_text(SMInfo_header_item, "%s", "SMInfo");
5230 SMInfo_header_tree = proto_item_add_subtree(SMInfo_header_item, ett_sminfo);
5232 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_GUID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5234 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_SM_Key, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5236 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_ActCount, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5238 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_Priority, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5239 proto_tree_add_item(SMInfo_header_tree, hf_infiniband_SMInfo_SMState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5241 return local_offset;
5244 /* Parse VendorDiag Attribute
5245 * IN: parentTree - The tree to add the dissection to
5246 * tvb - The tvbbuff of packet data
5247 * offset - The offset in TVB where the attribute begins */
5248 static int parse_VendorDiag(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5250 gint local_offset = *offset;
5251 proto_item *VendorDiag_header_item;
5252 proto_tree *VendorDiag_header_tree;
5257 VendorDiag_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5258 proto_item_set_text(VendorDiag_header_item, "%s", "VendorDiag");
5259 VendorDiag_header_tree = proto_item_add_subtree(VendorDiag_header_item, ett_vendordiag);
5261 proto_tree_add_item(VendorDiag_header_tree, hf_infiniband_VendorDiag_NextIndex, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5263 proto_tree_add_item(VendorDiag_header_tree, hf_infiniband_VendorDiag_DiagData, tvb, local_offset, 62, ENC_NA);
5266 return local_offset;
5269 /* Parse LedInfo Attribute
5270 * IN: parentTree - The tree to add the dissection to
5271 * tvb - The tvbbuff of packet data
5272 * offset - The offset in TVB where the attribute begins */
5273 static void parse_LedInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5275 gint local_offset = *offset;
5276 proto_item *LedInfo_header_item;
5277 proto_tree *LedInfo_header_tree;
5282 LedInfo_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5283 proto_item_set_text(LedInfo_header_item, "%s", "LedInfo");
5284 LedInfo_header_tree = proto_item_add_subtree(LedInfo_header_item, ett_ledinfo);
5286 proto_tree_add_item(LedInfo_header_tree, hf_infiniband_LedInfo_LedMask, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5289 /* Parse LinkSpeedWidthPairsTable Attribute
5290 * IN: parentTree - The tree to add the dissection to
5291 * tvb - The tvbbuff of packet data
5292 * offset - The offset in TVB where the attribute begins */
5293 static int parse_LinkSpeedWidthPairsTable(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5295 gint local_offset = *offset;
5296 proto_item *LinkSpeedWidthPairsTable_header_item;
5297 proto_tree *LinkSpeedWidthPairsTable_header_tree;
5302 LinkSpeedWidthPairsTable_header_item = proto_tree_add_item(parentTree, hf_infiniband_smp_data, tvb, local_offset, 64, ENC_NA);
5303 proto_item_set_text(LinkSpeedWidthPairsTable_header_item, "%s", "LinkSpeedWidthPairsTable");
5304 LinkSpeedWidthPairsTable_header_tree = proto_item_add_subtree(LinkSpeedWidthPairsTable_header_item, ett_linkspeedwidthpairs);
5306 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_NumTables, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5308 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_PortMask, tvb, local_offset, 32, ENC_NA);
5310 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_SpeedTwoFive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5312 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_SpeedFive, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5314 proto_tree_add_item(LinkSpeedWidthPairsTable_header_tree, hf_infiniband_LinkSpeedWidthPairsTable_SpeedTen, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5317 return local_offset;
5320 /* Parse RID Field from Subnet Administration Packets.
5321 * IN: SA_header_tree - the dissection tree of the subnet admin attribute.
5322 * tvb - the packet buffer
5323 * MadHeader - the Common MAD header from this packet.
5324 * IN/OUT: offset - the current and updated offset in the packet buffer */
5325 static void parse_RID(proto_tree* SA_header_tree, tvbuff_t* tvb, gint *offset, MAD_Data* MadHeader)
5327 gint local_offset = *offset;
5329 if (!SA_header_tree)
5333 switch (MadHeader->attributeID)
5337 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5339 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5343 /* PortInfoRecord */
5344 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_EndportLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5346 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_PortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5348 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5352 /* SLtoVLMappingTableRecord */
5353 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5355 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_InputPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5357 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_OutputPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5359 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5363 /* SwitchInfoRecord */
5364 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5366 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5370 /* LinearForwardingTableRecord */
5371 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5373 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_SixteenBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5375 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5379 /* RandomForwardingTableRecord */
5380 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5382 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_SixteenBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5384 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5388 /* MulticastForwardingTableRecord */
5389 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5391 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_Position, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5392 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_NineBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5394 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5398 /* VLArbitrationTableRecord */
5399 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5401 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_OutputPortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5403 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_EightBit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5405 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5410 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5412 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5416 /* P_KeyTableRecord */
5417 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5419 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_SixteenBit, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5421 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_PortNum, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5423 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 3, ENC_NA);
5427 /* InformInfoRecord */
5428 proto_tree_add_item(SA_header_tree, hf_infiniband_InformInfoRecord_SubscriberGID, tvb, local_offset, 16, ENC_NA);
5430 proto_tree_add_item(SA_header_tree, hf_infiniband_InformInfoRecord_Enum, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5432 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 6, ENC_NA);
5437 proto_tree_add_item(SA_header_tree, hf_infiniband_LinkRecord_FromLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5439 proto_tree_add_item(SA_header_tree, hf_infiniband_LinkRecord_FromPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5444 proto_tree_add_item(SA_header_tree, hf_infiniband_ServiceRecord_ServiceID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5446 proto_tree_add_item(SA_header_tree, hf_infiniband_ServiceRecord_ServiceGID, tvb, local_offset, 16, ENC_NA);
5448 proto_tree_add_item(SA_header_tree, hf_infiniband_ServiceRecord_ServiceP_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5453 /* MCMemberRecord */
5454 proto_tree_add_item(SA_header_tree, hf_infiniband_MCMemberRecord_MGID, tvb, local_offset, 16, ENC_NA);
5456 proto_tree_add_item(SA_header_tree, hf_infiniband_MCMemberRecord_PortGID, tvb, local_offset, 16, ENC_NA);
5460 /* GuidInfoRecord */
5461 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_LID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5463 proto_tree_add_item(SA_header_tree, hf_infiniband_SA_BlockNum_EightBit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5465 proto_tree_add_item(SA_header_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5472 *offset = local_offset;
5475 /* Parse InformInfo Attribute
5476 * IN: parentTree - The tree to add the dissection to
5477 * tvb - The tvbbuff of packet data
5478 * offset - The offset in TVB where the attribute begins */
5479 static int parse_InformInfo(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5481 gint local_offset = *offset;
5482 proto_item *InformInfo_header_item;
5483 proto_tree *InformInfo_header_tree;
5489 InformInfo_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 36, ENC_NA);
5490 proto_item_set_text(InformInfo_header_item, "%s", "InformInfo");
5491 InformInfo_header_tree = proto_item_add_subtree(InformInfo_header_item, ett_informinfo);
5493 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_GID, tvb, local_offset, 16, ENC_NA);
5495 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_LIDRangeBegin, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5497 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_LIDRangeEnd, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5499 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5501 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_IsGeneric, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5503 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_Subscribe, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5505 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_Type, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5507 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_TrapNumberDeviceID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5509 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_QPN, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5511 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_RespTimeValue, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5513 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5515 proto_tree_add_item(InformInfo_header_tree, hf_infiniband_InformInfo_ProducerTypeVendorID, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5518 return local_offset;
5520 /* Parse LinkRecord Attribute
5521 * IN: parentTree - The tree to add the dissection to
5522 * tvb - The tvbbuff of packet data
5523 * offset - The offset in TVB where the attribute begins */
5524 static int parse_LinkRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5526 gint local_offset = *offset;
5527 proto_item *LinkRecord_header_item;
5528 proto_tree *LinkRecord_header_tree;
5535 LinkRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 3, ENC_NA);
5536 proto_item_set_text(LinkRecord_header_item, "%s", "LinkRecord");
5537 LinkRecord_header_tree = proto_item_add_subtree(LinkRecord_header_item, ett_linkrecord);
5539 proto_tree_add_item(LinkRecord_header_tree, hf_infiniband_LinkRecord_ToPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5541 proto_tree_add_item(LinkRecord_header_tree, hf_infiniband_LinkRecord_ToLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5544 return local_offset;
5547 /* Parse ServiceRecord Attribute
5548 * IN: parentTree - The tree to add the dissection to
5549 * tvb - The tvbbuff of packet data
5550 * offset - The offset in TVB where the attribute begins */
5551 static int parse_ServiceRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5553 gint local_offset = *offset;
5554 proto_item *ServiceRecord_header_item;
5555 proto_tree *ServiceRecord_header_tree;
5556 proto_item *tempData;
5563 ServiceRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 176, ENC_NA);
5564 proto_item_set_text(ServiceRecord_header_item, "%s", "ServiceRecord");
5565 ServiceRecord_header_tree = proto_item_add_subtree(ServiceRecord_header_item, ett_servicerecord);
5567 proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceLease, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5569 proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceKey, tvb, local_offset, 16, ENC_NA);
5571 proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceName, tvb, local_offset, 64, ENC_NA);
5574 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5576 proto_item_append_text(tempData, "%s", "(ServiceData 8.1, 8.16)");
5577 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5579 proto_item_append_text(tempData, "%s", "(ServiceData 16.1, 16.8)");
5580 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5582 proto_item_append_text(tempData, "%s", "(ServiceData 32.1, 32.4)");
5583 tempData = proto_tree_add_item(ServiceRecord_header_tree, hf_infiniband_ServiceRecord_ServiceData, tvb, local_offset, 16, ENC_NA);
5585 proto_item_append_text(tempData, "%s", "(ServiceData 64.1, 64.2)");
5587 return local_offset;
5590 /* Parse PathRecord Attribute
5591 * IN: parentTree - The tree to add the dissection to
5592 * tvb - The tvbbuff of packet data
5593 * offset - The offset in TVB where the attribute begins */
5594 static int parse_PathRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5596 gint local_offset = *offset;
5597 proto_item *PathRecord_header_item;
5598 proto_tree *PathRecord_header_tree;
5605 PathRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 64, ENC_NA);
5606 proto_item_set_text(PathRecord_header_item, "%s", "PathRecord");
5607 PathRecord_header_tree = proto_item_add_subtree(PathRecord_header_item, ett_pathrecord);
5608 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 8, ENC_NA);
5611 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_DGID, tvb, local_offset, 16, ENC_NA);
5613 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_SGID, tvb, local_offset, 16, ENC_NA);
5615 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_DLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5617 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_SLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5619 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_RawTraffic, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5620 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_FlowLabel, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5622 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_HopLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5624 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_TClass, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5626 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_Reversible, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5627 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_NumbPath, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5629 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_P_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5631 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_SL, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5633 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_MTUSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5634 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_MTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5636 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_RateSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5637 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_Rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5639 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_PacketLifeTimeSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5640 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_PacketLifeTime, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5642 proto_tree_add_item(PathRecord_header_tree, hf_infiniband_PathRecord_Preference, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5645 return local_offset;
5647 /* Parse MCMemberRecord Attribute
5648 * IN: parentTree - The tree to add the dissection to
5649 * tvb - The tvbbuff of packet data
5650 * offset - The offset in TVB where the attribute begins */
5651 static int parse_MCMemberRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5653 gint local_offset = *offset;
5654 proto_item *MCMemberRecord_header_item;
5655 proto_tree *MCMemberRecord_header_tree;
5662 MCMemberRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 64, ENC_NA);
5663 proto_item_set_text(MCMemberRecord_header_item, "%s", "MCMemberRecord");
5664 MCMemberRecord_header_tree = proto_item_add_subtree(MCMemberRecord_header_item, ett_mcmemberrecord);
5666 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_Q_Key, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5668 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_MLID, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5670 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_MTUSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5671 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_MTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5673 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_TClass, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5675 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_P_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5677 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_RateSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5678 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_Rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5680 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_PacketLifeTimeSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5681 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_PacketLifeTime, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5683 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_SL, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5684 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_FlowLabel, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5686 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_HopLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5688 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_Scope, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5689 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_JoinState, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5691 proto_tree_add_item(MCMemberRecord_header_tree, hf_infiniband_MCMemberRecord_ProxyJoin, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5694 return local_offset;
5697 /* Parse TraceRecord Attribute
5698 * IN: parentTree - The tree to add the dissection to
5699 * tvb - The tvbbuff of packet data
5700 * offset - The offset in TVB where the attribute begins */
5701 static int parse_TraceRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5703 gint local_offset = *offset;
5704 proto_item *TraceRecord_header_item;
5705 proto_tree *TraceRecord_header_tree;
5712 TraceRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 46, ENC_NA);
5713 proto_item_set_text(TraceRecord_header_item, "%s", "TraceRecord");
5714 TraceRecord_header_tree = proto_item_add_subtree(TraceRecord_header_item, ett_tracerecord);
5716 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_GIDPrefix, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5718 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_IDGeneration, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5720 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5722 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_NodeType, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5724 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_NodeID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5726 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_ChassisID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5728 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_EntryPortID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5730 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_ExitPortID, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5732 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_EntryPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5734 proto_tree_add_item(TraceRecord_header_tree, hf_infiniband_TraceRecord_ExitPort, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5737 return local_offset;
5739 /* Parse MultiPathRecord Attribute
5740 * IN: parentTree - The tree to add the dissection to
5741 * tvb - The tvbbuff of packet data
5742 * offset - The offset in TVB where the attribute begins */
5743 static int parse_MultiPathRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5745 gint local_offset = *offset;
5746 proto_item *MultiPathRecord_header_item;
5747 proto_tree *MultiPathRecord_header_tree;
5758 MultiPathRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 200, ENC_NA);
5759 proto_item_set_text(MultiPathRecord_header_item, "%s", "MultiPathRecord");
5760 MultiPathRecord_header_tree = proto_item_add_subtree(MultiPathRecord_header_item, ett_multipathrecord);
5762 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_RawTraffic, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5763 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_FlowLabel, tvb, local_offset, 3, ENC_BIG_ENDIAN);
5765 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_HopLimit, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5767 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_TClass, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5769 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_Reversible, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5770 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_NumbPath, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5772 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_P_Key, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5774 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SL, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5776 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_MTUSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5777 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_MTU, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5779 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_RateSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5780 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_Rate, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5782 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_PacketLifeTimeSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5783 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_PacketLifeTime, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5785 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5787 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_IndependenceSelector, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5788 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_GIDScope, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5791 SDGIDCount = tvb_get_guint8(tvb, local_offset);
5792 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SGIDCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5794 DGIDCount = tvb_get_guint8(tvb, local_offset);
5795 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_DGIDCount, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5797 proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_reserved, tvb, local_offset, 7, ENC_NA);
5800 for (i = 0; i < SDGIDCount; i++)
5802 SDGID = proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SDGID, tvb, local_offset, 16, ENC_NA);
5804 proto_item_set_text(SDGID, "(%s%u)", "SGID", i);
5806 for (i = 0; i < DGIDCount; i++)
5808 SDGID = proto_tree_add_item(MultiPathRecord_header_tree, hf_infiniband_MultiPathRecord_SDGID, tvb, local_offset, 16, ENC_NA);
5810 proto_item_set_text(SDGID, "(%s%u)", "DGID", i);
5813 return local_offset;
5815 /* Parse ServiceAssociationRecord Attribute
5816 * IN: parentTree - The tree to add the dissection to
5817 * tvb - The tvbbuff of packet data
5818 * offset - The offset in TVB where the attribute begins */
5819 static int parse_ServiceAssociationRecord(proto_tree* parentTree, tvbuff_t* tvb, gint *offset)
5821 gint local_offset = *offset;
5822 proto_item *ServiceAssociationRecord_header_item;
5823 proto_tree *ServiceAssociationRecord_header_tree;
5830 ServiceAssociationRecord_header_item = proto_tree_add_item(parentTree, hf_infiniband_SA, tvb, local_offset, 80, ENC_NA);
5831 proto_item_set_text(ServiceAssociationRecord_header_item, "%s", "ServiceAssociationRecord");
5832 ServiceAssociationRecord_header_tree = proto_item_add_subtree(ServiceAssociationRecord_header_item, ett_serviceassocrecord);
5834 proto_tree_add_item(ServiceAssociationRecord_header_tree, hf_infiniband_ServiceAssociationRecord_ServiceKey, tvb, local_offset, 16, ENC_NA);
5836 proto_tree_add_item(ServiceAssociationRecord_header_tree, hf_infiniband_ServiceAssociationRecord_ServiceName, tvb, local_offset, 64, ENC_ASCII|ENC_NA);
5839 return local_offset;
5842 /* Parse PortCounters MAD from the Performance management class.
5843 * IN: parentTree - The tree to add the dissection to
5844 * tvb - The tvbbuff of packet data
5845 * offset - The offset in TVB where the attribute begins
5846 * pinfo - The packet info structure with column information */
5847 static int parse_PERF_PortCounters(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, gint *offset)
5849 proto_item *perf_item;
5850 proto_tree *perf_tree;
5851 gint local_offset = *offset;
5853 col_set_str(pinfo->cinfo, COL_INFO, "PERF (PortCounters)");
5855 perf_item = proto_tree_add_item(parentTree, hf_infiniband_PortCounters, tvb, local_offset, 40, ENC_NA);
5856 perf_tree = proto_item_add_subtree(perf_item, ett_perfclass);
5858 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 40, ENC_NA);
5860 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5862 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortSelect, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5864 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_CounterSelect, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5866 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_SymbolErrorCounter, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5868 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_LinkErrorRecoveryCounter, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5870 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_LinkDownedCounter, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5872 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvErrors, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5874 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvRemotePhysicalErrors, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5876 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvSwitchRelayErrors, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5878 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitDiscards, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5880 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitConstraintErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5882 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvConstraintErrors, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5884 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5886 proto_tree_add_bits_item(perf_tree, hf_infiniband_PortCounters_LocalLinkIntegrityErrors, tvb, local_offset*8, 4, ENC_BIG_ENDIAN);
5887 proto_tree_add_bits_item(perf_tree, hf_infiniband_PortCounters_ExcessiveBufferOverrunErrors, tvb, local_offset*8 + 4, 4, ENC_BIG_ENDIAN);
5889 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 2, ENC_NA);
5891 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_VL15Dropped, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5893 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitData, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5895 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvData, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5897 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortXmitPkts, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5899 proto_tree_add_item(perf_tree, hf_infiniband_PortCounters_PortRcvPkts, tvb, local_offset, 4, ENC_BIG_ENDIAN);
5902 *offset = local_offset; /* update caller's offset to point to end of the PortCounters payload */
5903 return local_offset;
5906 /* Parse PortCountersExtended MAD from the Performance management class.
5907 * IN: parentTree - The tree to add the dissection to
5908 * tvb - The tvbbuff of packet data
5909 * offset - The offset in TVB where the attribute begins
5910 * pinfo - The packet info structure with column information */
5911 static int parse_PERF_PortCountersExtended(proto_tree* parentTree, tvbuff_t* tvb, packet_info *pinfo, gint *offset)
5913 proto_item *perf_item;
5914 proto_tree *perf_tree;
5915 gint local_offset = *offset;
5917 col_set_str(pinfo->cinfo, COL_INFO, "PERF (PortCountersExtended)");
5919 perf_item = proto_tree_add_item(parentTree, hf_infiniband_PortCountersExt, tvb, local_offset, 72, ENC_NA);
5920 perf_tree = proto_item_add_subtree(perf_item, ett_perfclass);
5922 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 40, ENC_NA);
5924 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 1, ENC_NA);
5926 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortSelect, tvb, local_offset, 1, ENC_BIG_ENDIAN);
5928 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_CounterSelect, tvb, local_offset, 2, ENC_BIG_ENDIAN);
5930 proto_tree_add_item(perf_tree, hf_infiniband_reserved, tvb, local_offset, 4, ENC_NA);
5932 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortXmitData, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5934 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortRcvData, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5936 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortXmitPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5938 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortRcvPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5940 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortUnicastXmitPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5942 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortUnicastRcvPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5944 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortMulticastXmitPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5946 proto_tree_add_item(perf_tree, hf_infiniband_PortCountersExt_PortMulticastRcvPkts, tvb, local_offset, 8, ENC_BIG_ENDIAN);
5949 *offset = local_offset; /* update caller's offset to point to end of the PortCountersExt payload */
5950 return local_offset;
5953 /* dissect_general_info
5954 * Used to extract very few values from the packet in the case that full dissection is disabled by the user.
5956 * tvb - The tvbbuff of packet data
5957 * offset - The offset in TVB where the attribute begins
5958 * pinfo - The packet info structure with column information
5959 * starts_with - regular IB packet starts with LRH, ROCE starts with GRH and RROCE starts with BTH,
5960 * this tells the parser what headers of (LRH/GRH) to skip. */
5961 static void dissect_general_info(tvbuff_t *tvb, gint offset, packet_info *pinfo, ib_packet_start_header starts_with)
5963 guint8 lnh_val = 0; /* The Link Next Header Value. Tells us which headers are coming */
5964 gboolean bthFollows = FALSE; /* Tracks if we are parsing a BTH. This is a significant decision point */
5965 guint8 virtualLane = 0; /* The Virtual Lane of the current Packet */
5966 gint32 nextHeaderSequence = -1; /* defined by this dissector. #define which indicates the upcoming header sequence from OpCode */
5967 guint8 nxtHdr = 0; /* that must be available for that header. */
5968 guint8 management_class = 0;
5971 /* BTH - Base Trasport Header */
5972 struct infinibandinfo info = { 0, FALSE, 0, NULL, 0, 0, 0 };
5974 void *src_addr, /* the address to be displayed in the source/destination columns */
5975 *dst_addr; /* (lid/gid number) will be stored here */
5977 if (starts_with == IB_PACKET_STARTS_WITH_GRH) {
5978 /* this is a RoCE packet, skip LRH parsing */
5979 lnh_val = IBA_GLOBAL;
5982 else if (starts_with == IB_PACKET_STARTS_WITH_BTH) {
5983 /* this is a RRoCE packet, skip LRH/GRH parsing and go directly to BTH */
5984 lnh_val = IBA_LOCAL;
5988 virtualLane = tvb_get_guint8(tvb, offset);
5989 virtualLane = virtualLane & 0xF0;
5992 /* Save Link Next Header... This tells us what the next header is. */
5993 lnh_val = tvb_get_guint8(tvb, offset);
5994 lnh_val = lnh_val & 0x03;
5997 /* Set destination in packet view. */
5998 dst_addr = wmem_alloc(pinfo->pool, sizeof(guint16));
5999 *((guint16*) dst_addr) = tvb_get_ntohs(tvb, offset);
6000 set_address(&pinfo->dst, AT_IB, sizeof(guint16), dst_addr);
6004 /* Set Source in packet view. */
6005 src_addr = wmem_alloc(pinfo->pool, sizeof(guint16));
6006 *((guint16*) src_addr) = tvb_get_ntohs(tvb, offset);
6007 set_address(&pinfo->src, AT_IB, sizeof(guint16), src_addr);
6017 nxtHdr = tvb_get_guint8(tvb, offset);
6020 /* Set source GID in packet view. */
6021 set_address_tvb(&pinfo->src, AT_IB, GID_SIZE, tvb, offset);
6024 /* Set destination GID in packet view. */
6025 set_address_tvb(&pinfo->dst, AT_IB, GID_SIZE, tvb, offset);
6030 /* Some kind of packet being transported globally with IBA, but locally it is not IBA - no BTH following. */
6035 * Fall through switch and start parsing Local Headers and BTH
6042 /* Get the OpCode - this tells us what headers are following */
6043 info.opCode = tvb_get_guint8(tvb, offset);
6044 if ((info.opCode >> 5) == 0x2) {
6045 info.dctConnect = !(tvb_get_guint8(tvb, offset + 1) & 0x80);
6048 col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(info.opCode, OpCodeMap, "Unknown OpCode"));
6052 /* Raw IPv6 Packet */
6053 dst_addr = wmem_strdup(pinfo->pool, "IPv6 over IB Packet");
6054 set_address(&pinfo->dst, AT_STRINGZ, (int)strlen((char *)dst_addr)+1, dst_addr);
6064 /* Find our next header sequence based on the Opcode
6065 * Since we're not doing dissection here, we just need the proper offsets to get our labels in packet view */
6067 nextHeaderSequence = find_next_header_sequence(&info);
6068 switch (nextHeaderSequence)
6070 case RDETH_DETH_PAYLD:
6071 offset += 4; /* RDETH */
6072 offset += 8; /* DETH */
6074 case RETH_IMMDT_PAYLD:
6075 offset += 16; /* RETH */
6076 offset += 4; /* IMMDT */
6078 case RDETH_DETH_RETH_PAYLD:
6079 offset += 4; /* RDETH */
6080 offset += 8; /* DETH */
6081 offset += 16; /* RETH */
6083 case RDETH_DETH_IMMDT_PAYLD:
6084 offset += 4; /* RDETH */
6085 offset += 8; /* DETH */
6086 offset += 4; /* IMMDT */
6088 case RDETH_DETH_RETH_IMMDT_PAYLD:
6089 offset += 4; /* RDETH */
6090 offset += 8; /* DETH */
6091 offset += 16; /* RETH */
6092 offset += 4; /* IMMDT */
6094 case RDETH_DETH_RETH:
6095 offset += 4; /* RDETH */
6096 offset += 8; /* DETH */
6097 offset += 16; /* RETH */
6099 case RDETH_AETH_PAYLD:
6100 offset += 4; /* RDETH */
6101 offset += 4; /* AETH */
6104 offset += 4; /* RDETH */
6107 offset += 4; /* RDETH */
6108 offset += 4; /* AETH */
6110 case RDETH_AETH_ATOMICACKETH:
6111 offset += 4; /* RDETH */
6112 offset += 4; /* AETH */
6113 offset += 8; /* AtomicAckETH */
6115 case RDETH_DETH_ATOMICETH:
6116 offset += 4; /* RDETH */
6117 offset += 8; /* DETH */
6118 offset += 28; /* AtomicETH */
6121 offset += 4; /* RDETH */
6122 offset += 8; /* DETH */
6125 offset += 8; /* DETH */
6130 offset += 4; /* IMMDT */
6133 offset += 16; /* RETH */
6136 offset += 16; /* RETH */
6139 offset += 4; /* AETH */
6142 offset += 4; /* AETH */
6144 case AETH_ATOMICACKETH:
6145 offset += 4; /* AETH */
6146 offset += 8; /* AtomicAckETH */
6149 offset += 28; /* AtomicETH */
6152 offset += 4; /* IETH */
6154 case DETH_IMMDT_PAYLD:
6155 offset += 8; /* DETH */
6156 offset += 4; /* IMMDT */
6159 offset += 16; /* DCCETH */
6165 if (virtualLane == 0xF0)
6167 management_class = tvb_get_guint8(tvb, offset + 1);
6168 if (((management_class >= (guint8)VENDOR_1_START) && (management_class <= (guint8)VENDOR_1_END))
6169 || ((management_class >= (guint8)VENDOR_2_START) && (management_class <= (guint8)VENDOR_2_END)))
6173 else if ((management_class >= (guint8)APPLICATION_START) && (management_class <= (guint8)APPLICATION_END))
6177 else if (((management_class == (guint8)0x00) || (management_class == (guint8)0x02))
6178 || ((management_class >= (guint8)0x50) && (management_class <= (guint8)0x80))
6179 || ((management_class >= (guint8)0x82)))
6183 else /* we have a normal management_class */
6185 if (parse_MAD_Common(NULL, tvb, &offset, &MadData)) {
6186 label_SUBM_Method(NULL, &MadData, pinfo);
6187 label_SUBM_Attribute(NULL, &MadData, pinfo);
6196 infiniband_shutdown(void)
6198 g_hash_table_destroy(CM_context_table);
6201 /* Protocol Registration */
6202 void proto_register_infiniband(void)
6204 module_t *infiniband_module;
6206 /* Field dissector structures.
6207 * For reserved fields, reservedX denotes the reserved field is X bits in length.
6208 * e.g. reserved2 is a reserved field 2 bits in length.
6209 * The third parameter is a filter string associated for this field.
6210 * So for instance, to filter packets for a given virtual lane,
6211 * The filter (infiniband.LRH.vl == 3) or something similar would be used. */
6213 /* XXX: ToDo: Verify against Infiniband 1.2.1 Specification */
6214 /* Fields verified/corrected: Those after comment "XX: All following ..." */
6216 /* meanings for MAD method field */
6217 static const value_string mad_method_str[] = {
6220 { 0x81, "GetResp()" },
6223 { 0x06, "Report()" },
6224 { 0x86, "ReportResp()" },
6225 { 0x07, "TrapRepress()" },
6226 { 0x12, "GetTable()" },
6227 { 0x92, "GetTableResp()" },
6228 { 0x13, "GetTraceTable()" },
6229 { 0x14, "GetMulti()" },
6230 { 0x94, "GetMultiResp()" },
6231 { 0x15, "Delete()" },
6232 { 0x95, "DeleteResp()" },
6236 static hf_register_info hf[] = {
6237 /* Local Route Header (LRH) */
6238 { &hf_infiniband_LRH, {
6239 "Local Route Header", "infiniband.lrh",
6240 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6242 { &hf_infiniband_virtual_lane, {
6243 "Virtual Lane", "infiniband.lrh.vl",
6244 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
6246 { &hf_infiniband_link_version, {
6247 "Link Version", "infiniband.lrh.lver",
6248 FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}
6250 { &hf_infiniband_service_level, {
6251 "Service Level", "infiniband.lrh.sl",
6252 FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}
6254 { &hf_infiniband_reserved2, {
6255 "Reserved (2 bits)", "infiniband.lrh.reserved2",
6256 FT_UINT8, BASE_DEC, NULL, 0x0C, NULL, HFILL}
6258 { &hf_infiniband_link_next_header, {
6259 "Link Next Header", "infiniband.lrh.lnh",
6260 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
6262 { &hf_infiniband_destination_local_id, {
6263 "Destination Local ID", "infiniband.lrh.dlid",
6264 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6266 { &hf_infiniband_reserved5, {
6267 "Reserved (5 bits)", "infiniband.lrh.reserved5",
6268 FT_UINT16, BASE_DEC, NULL, 0xF800, NULL, HFILL}
6270 { &hf_infiniband_packet_length, {
6271 "Packet Length", "infiniband.lrh.pktlen",
6272 FT_UINT16, BASE_DEC, NULL, 0x07FF, NULL, HFILL}
6274 { &hf_infiniband_source_local_id, {
6275 "Source Local ID", "infiniband.lrh.slid",
6276 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6279 /* Global Route Header (GRH) */
6280 { &hf_infiniband_GRH, {
6281 "Global Route Header", "infiniband.grh",
6282 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6284 { &hf_infiniband_ip_version, {
6285 "IP Version", "infiniband.grh.ipver",
6286 FT_UINT8, BASE_DEC, NULL, 0xF0, NULL, HFILL}
6288 { &hf_infiniband_traffic_class, {
6289 "Traffic Class", "infiniband.grh.tclass",
6290 FT_UINT16, BASE_DEC, NULL, 0x0FF0, NULL, HFILL}
6292 { &hf_infiniband_flow_label, {
6293 "Flow Label", "infiniband.grh.flowlabel",
6294 FT_UINT32, BASE_DEC, NULL, 0x000FFFFF, NULL, HFILL}
6296 { &hf_infiniband_payload_length, {
6297 "Payload Length", "infiniband.grh.paylen",
6298 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6300 { &hf_infiniband_next_header, {
6301 "Next Header", "infiniband.grh.nxthdr",
6302 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
6304 { &hf_infiniband_hop_limit, {
6305 "Hop Limit", "infiniband.grh.hoplmt",
6306 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
6308 { &hf_infiniband_source_gid, {
6309 "Source GID", "infiniband.grh.sgid",
6310 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6312 { &hf_infiniband_destination_gid, {
6313 "Destination GID", "infiniband.grh.dgid",
6314 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6317 /* Base Transport Header (BTH) */
6318 { &hf_infiniband_BTH, {
6319 "Base Transport Header", "infiniband.bth",
6320 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6322 { &hf_infiniband_opcode, {
6323 "Opcode", "infiniband.bth.opcode",
6324 FT_UINT8, BASE_DEC, VALS(bth_opcode_tbl), 0x0, NULL, HFILL}
6326 { &hf_infiniband_solicited_event, {
6327 "Solicited Event", "infiniband.bth.se",
6328 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6330 { &hf_infiniband_migreq, {
6331 "MigReq", "infiniband.bth.m",
6332 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
6334 { &hf_infiniband_pad_count, {
6335 "Pad Count", "infiniband.bth.padcnt",
6336 FT_UINT8, BASE_DEC, NULL, 0x30, NULL, HFILL}
6338 { &hf_infiniband_transport_header_version, {
6339 "Header Version", "infiniband.bth.tver",
6340 FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL}
6342 { &hf_infiniband_partition_key, {
6343 "Partition Key", "infiniband.bth.p_key",
6344 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6346 { &hf_infiniband_destination_qp, {
6347 "Destination Queue Pair", "infiniband.bth.destqp",
6348 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6350 { &hf_infiniband_acknowledge_request, {
6351 "Acknowledge Request", "infiniband.bth.a",
6352 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6354 { &hf_infiniband_reserved7, {
6355 "Reserved (7 bits)", "infiniband.bth.reserved7",
6356 FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL}
6358 { &hf_infiniband_packet_sequence_number, {
6359 "Packet Sequence Number", "infiniband.bth.psn",
6360 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
6363 /* Raw Header (RWH) */
6364 { &hf_infiniband_RWH, {
6365 "Raw Header", "infiniband.rwh",
6366 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6368 { &hf_infiniband_etype, {
6369 "Ethertype", "infiniband.rwh.etype",
6370 FT_UINT16, BASE_HEX, VALS(etype_vals), 0x0, "Type", HFILL }
6373 /* Reliable Datagram Extended Transport Header (RDETH) */
6374 { &hf_infiniband_RDETH, {
6375 "Reliable Datagram Extended Transport Header", "infiniband.rdeth",
6376 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6378 { &hf_infiniband_ee_context, {
6379 "E2E Context", "infiniband.rdeth.eecnxt",
6380 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
6383 /* Datagram Extended Transport Header (DETH) */
6384 { &hf_infiniband_DETH, {
6385 "Datagram Extended Transport Header", "infiniband.deth",
6386 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6388 { &hf_infiniband_queue_key, {
6389 "Queue Key", "infiniband.deth.q_key",
6390 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6392 { &hf_infiniband_source_qp, {
6393 "Source Queue Pair", "infiniband.deth.srcqp",
6394 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6397 /* RDMA Extended Transport Header (RETH) */
6398 { &hf_infiniband_RETH, {
6399 "RDMA Extended Transport Header", "infiniband.reth",
6400 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6402 { &hf_infiniband_virtual_address, {
6403 "Virtual Address", "infiniband.reth.va",
6404 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6406 { &hf_infiniband_remote_key, {
6407 "Remote Key", "infiniband.reth.r_key",
6408 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
6410 { &hf_infiniband_dma_length, {
6411 "DMA Length", "infiniband.reth.dmalen",
6412 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
6415 /* Atomic Extended Transport Header (AtomicETH) */
6416 { &hf_infiniband_AtomicETH, {
6417 "Atomic Extended Transport Header", "infiniband.atomiceth",
6418 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6421 { &hf_infiniband_virtual_address_AtomicETH, {
6422 "Virtual Address", "infiniband.atomiceth.va",
6423 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6425 { &hf_infiniband_remote_key_AtomicETH, {
6426 "Remote Key", "infiniband.atomiceth.r_key",
6427 FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}
6430 { &hf_infiniband_swap_or_add_data, {
6431 "Swap (Or Add) Data", "infiniband.atomiceth.swapdt",
6432 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6434 { &hf_infiniband_compare_data, {
6435 "Compare Data", "infiniband.atomiceth.cmpdt",
6436 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6439 /* ACK Extended Transport Header (AETH) */
6440 { &hf_infiniband_AETH, {
6441 "ACK Extended Transport Header", "infiniband.aeth",
6442 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6444 { &hf_infiniband_syndrome, {
6445 "Syndrome", "infiniband.aeth.syndrome",
6446 FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}
6448 { &hf_infiniband_syndrome_reserved, {
6449 "Reserved", "infiniband.aeth.syndrome.reserved",
6450 FT_UINT8, BASE_DEC, NULL, AETH_SYNDROME_RES, NULL, HFILL}
6452 { &hf_infiniband_syndrome_opcode, {
6453 "OpCode", "infiniband.aeth.syndrome.opcode",
6454 FT_UINT8, BASE_DEC, VALS(aeth_syndrome_opcode_vals), AETH_SYNDROME_OPCODE, NULL, HFILL}
6456 { &hf_infiniband_syndrome_credit_count, {
6457 "Credit Count", "infiniband.aeth.syndrome.credit_count",
6458 FT_UINT8, BASE_DEC, NULL, AETH_SYNDROME_VALUE, NULL, HFILL}
6460 { &hf_infiniband_syndrome_timer, {
6461 "Timer", "infiniband.aeth.syndrome.timer",
6462 FT_UINT8, BASE_DEC, VALS(aeth_syndrome_timer_code_vals), AETH_SYNDROME_VALUE, NULL, HFILL}
6464 { &hf_infiniband_syndrome_reserved_value, {
6465 "Reserved", "infiniband.aeth.syndrome.reserved_value",
6466 FT_UINT8, BASE_DEC, NULL, AETH_SYNDROME_VALUE, NULL, HFILL}
6468 { &hf_infiniband_syndrome_error_code, {
6469 "Error Code", "infiniband.aeth.syndrome.error_code",
6470 FT_UINT8, BASE_DEC, VALS(aeth_syndrome_nak_error_code_vals), AETH_SYNDROME_VALUE, NULL, HFILL}
6472 { &hf_infiniband_message_sequence_number, {
6473 "Message Sequence Number", "infiniband.aeth.msn",
6474 FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL}
6477 /* Atomic ACK Extended Transport Header (AtomicAckETH) */
6478 { &hf_infiniband_AtomicAckETH, {
6479 "Atomic ACK Extended Transport Header", "infiniband.atomicacketh",
6480 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6482 { &hf_infiniband_original_remote_data, {
6483 "Original Remote Data", "infiniband.atomicacketh.origremdt",
6484 FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL}
6487 /* Immediate Extended Transport Header (ImmDT) */
6488 { &hf_infiniband_IMMDT, {
6489 "Immediate Data", "infiniband.immdt",
6490 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6493 /* Invalidate Extended Transport Header (IETH) */
6494 { &hf_infiniband_IETH, {
6495 "RKey", "infiniband.ieth",
6496 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6500 { &hf_infiniband_payload, {
6501 "Payload", "infiniband.payload",
6502 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6504 { &hf_infiniband_invariant_crc, {
6505 "Invariant CRC", "infiniband.invariant.crc",
6506 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6508 { &hf_infiniband_variant_crc, {
6509 "Variant CRC", "infiniband.variant.crc",
6510 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6512 { &hf_infiniband_raw_data, {
6513 "Raw Data", "infiniband.rawdata",
6514 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6516 /* Unknown or Vendor Specific */
6517 { &hf_infiniband_vendor, {
6518 "Unknown/Vendor Specific Data", "infiniband.vendor",
6519 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6522 /* Common Reserved fields */
6523 { &hf_infiniband_reserved, {
6524 "Reserved", "infiniband.reserved",
6525 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6528 {&hf_cm_req_local_comm_id, {
6529 "Local Communication ID", "infiniband.cm.req",
6530 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6532 {&hf_cm_req_service_id, {
6533 "ServiceID", "infiniband.cm.req.serviceid",
6534 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6536 {&hf_cm_req_service_id_prefix, {
6537 "Prefix", "infiniband.cm.req.serviceid.prefix",
6538 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6540 {&hf_cm_req_service_id_protocol, {
6541 "Protocol", "infiniband.cm.req.serviceid.protocol",
6542 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6544 {&hf_cm_req_service_id_dport, {
6545 "Destination Port", "infiniband.cm.req.serviceid.dport",
6546 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6548 {&hf_cm_req_local_ca_guid, {
6549 "Local CA GUID", "infiniband.cm.req.localcaguid",
6550 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6552 {&hf_cm_req_local_qkey, {
6553 "Local Q_Key", "infiniband.cm.req.localqkey",
6554 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6556 {&hf_cm_req_local_qpn, {
6557 "Local QPN", "infiniband.cm.req.localqpn",
6558 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6560 {&hf_cm_req_respo_res, {
6561 "Responder Resources", "infiniband.cm.req.responderres",
6562 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6564 {&hf_cm_req_local_eecn, {
6565 "Local EECN", "infiniband.cm.req.localeecn",
6566 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6568 {&hf_cm_req_init_depth, {
6569 "Initiator Depth", "infiniband.cm.req.initdepth",
6570 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6572 {&hf_cm_req_remote_eecn, {
6573 "Remote EECN", "infiniband.cm.req.remoteeecn",
6574 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6576 {&hf_cm_req_remote_cm_resp_to, {
6577 "Remote CM Response Timeout", "infiniband.cm.req.remoteresptout",
6578 FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL}
6580 {&hf_cm_req_transp_serv_type, {
6581 "Transport Service Type", "infiniband.cm.req.transpsvctype",
6582 FT_UINT8, BASE_HEX, NULL, 0x06, NULL, HFILL}
6584 {&hf_cm_req_e2e_flow_ctrl, {
6585 "End-to-End Flow Control", "infiniband.cm.req.e2eflowctrl",
6586 FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL}
6588 {&hf_cm_req_start_psn, {
6589 "Starting PSN", "infiniband.cm.req.startpsn",
6590 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6592 {&hf_cm_req_local_cm_resp_to, {
6593 "Local CM Response Timeout", "infiniband.cm.req.localresptout",
6594 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6596 {&hf_cm_req_retry_count, {
6597 "Retry Count", "infiniband.cm.req.retrcount",
6598 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6601 "Partition Key", "infiniband.cm.req.pkey",
6602 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6604 {&hf_cm_req_path_pp_mtu, {
6605 "Path Packet Payload MTU", "infiniband.cm.req.pppmtu",
6606 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6608 {&hf_cm_req_rdc_exists, {
6609 "RDC Exists", "infiniband.cm.req.rdcexist",
6610 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6612 {&hf_cm_req_rnr_retry_count, {
6613 "RNR Retry Count", "infiniband.cm.req.rnrretrcount",
6614 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6616 {&hf_cm_req_max_cm_retries, {
6617 "Max CM Retries", "infiniband.cm.req.maxcmretr",
6618 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6621 "SRQ", "infiniband.cm.req.srq",
6622 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6624 {&hf_cm_req_extended_transport, {
6625 "Extended Transport", "infiniband.cm.req.ext_transport",
6626 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6628 {&hf_cm_req_primary_local_lid, {
6629 "Primary Local Port LID", "infiniband.cm.req.prim_locallid",
6630 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6632 {&hf_cm_req_primary_remote_lid, {
6633 "Primary Remote Port LID", "infiniband.cm.req.prim_remotelid",
6634 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6636 {&hf_cm_req_primary_local_gid, {
6637 "Primary Local Port GID", "infiniband.cm.req.prim_localgid",
6638 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6640 {&hf_cm_req_primary_remote_gid, {
6641 "Primary Remote Port GID", "infiniband.cm.req.prim_remotegid",
6642 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6644 {&hf_cm_req_primary_local_gid_ipv4, {
6645 "Primary Local Port GID", "infiniband.cm.req.prim_localgid_ipv4",
6646 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6648 {&hf_cm_req_primary_remote_gid_ipv4, {
6649 "Primary Remote Port GID", "infiniband.cm.req.prim_remotegid_ipv4",
6650 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6652 {&hf_cm_req_primary_flow_label, {
6653 "Primary Flow Label", "infiniband.cm.req.prim_flowlabel",
6654 FT_UINT32, BASE_HEX, NULL, 0xfffff000, NULL, HFILL}
6656 {&hf_cm_req_primary_reserved0, {
6657 "Reserved", "infiniband.cm.req.prim_reserved0",
6658 FT_UINT32, BASE_HEX, NULL, 0x0fc0, NULL, HFILL}
6660 {&hf_cm_req_primary_packet_rate, {
6661 "Primary Packet Rate", "infiniband.cm.req.prim_pktrate",
6662 FT_UINT32, BASE_HEX, NULL, 0x3f, NULL, HFILL}
6664 {&hf_cm_req_primary_traffic_class, {
6665 "Primary Traffic Class", "infiniband.cm.req.prim_tfcclass",
6666 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6668 {&hf_cm_req_primary_hop_limit, {
6669 "Primary Hop Limit", "infiniband.cm.req.prim_hoplim",
6670 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6672 {&hf_cm_req_primary_sl, {
6673 "Primary SL", "infiniband.cm.req.prim_sl",
6674 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6676 {&hf_cm_req_primary_subnet_local, {
6677 "Primary Subnet Local", "infiniband.cm.req.prim_subnetlocal",
6678 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6680 {&hf_cm_req_primary_reserved1, {
6681 "Reserved", "infiniband.cm.req.prim_reserved1",
6682 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6684 {&hf_cm_req_primary_local_ack_to, {
6685 "Primary Local ACK Timeout", "infiniband.cm.req.prim_localacktout",
6686 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6688 {&hf_cm_req_primary_reserved2, {
6689 "Reserved", "infiniband.cm.req.prim_reserved2",
6690 FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}
6692 {&hf_cm_req_alt_local_lid, {
6693 "Alternate Local Port LID", "infiniband.cm.req.alt_locallid",
6694 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6696 {&hf_cm_req_alt_remote_lid, {
6697 "Alternate Remote Port LID", "infiniband.cm.req.alt_remotelid",
6698 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
6700 {&hf_cm_req_alt_local_gid, {
6701 "Alternate Local Port GID", "infiniband.cm.req.alt_localgid",
6702 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6704 {&hf_cm_req_alt_remote_gid, {
6705 "Alternate Remote Port GID", "infiniband.cm.req.alt_remotegid",
6706 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6708 {&hf_cm_req_flow_label, {
6709 "Alternate Flow Label", "infiniband.cm.req.alt_flowlabel",
6710 FT_UINT32, BASE_HEX, NULL, 0xfffff000, NULL, HFILL}
6712 {&hf_cm_req_alt_reserved0, {
6713 "Reserved", "infiniband.cm.req.alt_reserved0",
6714 FT_UINT32, BASE_HEX, NULL, 0x0fc0, NULL, HFILL}
6716 {&hf_cm_req_packet_rate, {
6717 "Alternate Packet Rate", "infiniband.cm.req.alt_pktrate",
6718 FT_UINT32, BASE_HEX, NULL, 0x3f, NULL, HFILL}
6720 {&hf_cm_req_alt_traffic_class, {
6721 "Alternate Traffic Class", "infiniband.cm.req.alt_tfcclass",
6722 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6724 {&hf_cm_req_alt_hop_limit, {
6725 "Alternate Hop Limit", "infiniband.cm.req.alt_hoplim",
6726 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6729 "Alternate SL", "infiniband.cm.req.alt_sl",
6730 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6732 {&hf_cm_req_subnet_local, {
6733 "Alternate Subnet Local", "infiniband.cm.req.alt_subnetlocal",
6734 FT_UINT8, BASE_HEX, NULL, 0x8, NULL, HFILL}
6736 {&hf_cm_req_alt_reserved1, {
6737 "Reserved", "infiniband.cm.req.alt_reserved1",
6738 FT_UINT8, BASE_HEX, NULL, 0x7, NULL, HFILL}
6740 {&hf_cm_req_local_ACK_timeout, {
6741 "Alternate Local ACK Timeout", "infiniband.cm.req.alt_localacktout",
6742 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6744 {&hf_cm_req_alt_reserved2, {
6745 "Reserved", "infiniband.cm.req.alt_reserved1",
6746 FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}
6748 {&hf_cm_req_private_data, {
6749 "PrivateData", "infiniband.cm.req.private",
6750 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6752 {&hf_cm_req_ip_cm_req_msg, {
6753 "IP CM Request Msg", "infiniband.cm.req.ip_cm",
6754 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6756 {&hf_cm_req_ip_cm_majv, {
6757 "IP CM Major Version", "infiniband.cm.req.ip_cm.majv",
6758 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6760 {&hf_cm_req_ip_cm_minv, {
6761 "IP CM Minor Version", "infiniband.cm.req.ip_cm.minv",
6762 FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}
6764 {&hf_cm_req_ip_cm_ipv, {
6765 "IP CM IP Version", "infiniband.cm.req.ip_cm.ipv",
6766 FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL}
6768 {&hf_cm_req_ip_cm_res, {
6769 "IP CM Reserved", "infiniband.cm.req.ip_cm.reserved",
6770 FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}
6772 {&hf_cm_req_ip_cm_sport, {
6773 "IP CM Source Port", "infiniband.cm.req.ip_cm.sport",
6774 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6776 {&hf_cm_req_ip_cm_sip6, {
6777 "IP CM Source IP", "infiniband.cm.req.ip_cm.sip6",
6778 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6780 {&hf_cm_req_ip_cm_dip6, {
6781 "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip6",
6782 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
6784 {&hf_cm_req_ip_cm_sip4, {
6785 "IP CM Source IP", "infiniband.cm.req.ip_cm.sip4",
6786 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6788 {&hf_cm_req_ip_cm_dip4, {
6789 "IP CM Destination IP", "infiniband.cm.req.ip_cm.dip4",
6790 FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL}
6792 {&hf_ip_cm_req_consumer_private_data, {
6793 "IP CM Consumer PrivateData", "infiniband.cm.req.ip_cm.private",
6794 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6797 {&hf_cm_rep_localcommid, {
6798 "Local Communication ID", "infiniband.cm.rep",
6799 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6801 {&hf_cm_rep_remotecommid, {
6802 "Remote Communication ID", "infiniband.cm.rep.remotecommid",
6803 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6805 {&hf_cm_rep_localqkey, {
6806 "Local Q_Key", "infiniband.cm.rep.localqkey",
6807 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6809 {&hf_cm_rep_localqpn, {
6810 "Local QPN", "infiniband.cm.rep.localqpn",
6811 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6813 {&hf_cm_rep_localeecontnum, {
6814 "Local EE Context Number", "infiniband.cm.rep.localeecn",
6815 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6817 {&hf_cm_rep_startingpsn, {
6818 "Starting PSN", "infiniband.cm.rep.startpsn",
6819 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6821 {&hf_cm_rep_responderres, {
6822 "Responder Resources", "infiniband.cm.rep.respres",
6823 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6825 {&hf_cm_rep_initiatordepth, {
6826 "Initiator Depth", "infiniband.cm.rep.initdepth",
6827 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6829 {&hf_cm_rep_tgtackdelay, {
6830 "Target ACK Delay", "infiniband.cm.rep.tgtackdelay",
6831 FT_UINT8, BASE_HEX, NULL, 0xf8, NULL, HFILL}
6833 {&hf_cm_rep_failoveracc, {
6834 "Failover Accepted", "infiniband.cm.rep.failoveracc",
6835 FT_UINT8, BASE_HEX, NULL, 0x6, NULL, HFILL}
6837 {&hf_cm_rep_e2eflowctl, {
6838 "End-To-End Flow Control", "infiniband.cm.rep.e2eflowctrl",
6839 FT_UINT8, BASE_HEX, NULL, 0x1, NULL, HFILL}
6841 {&hf_cm_rep_rnrretrycount, {
6842 "RNR Retry Count", "infiniband.cm.rep.rnrretrcount",
6843 FT_UINT8, BASE_HEX, NULL, 0xe0, NULL, HFILL}
6846 "SRQ", "infiniband.cm.rep.srq",
6847 FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL}
6849 {&hf_cm_rep_reserved, {
6850 "Reserved", "infiniband.cm.rep.reserved",
6851 FT_UINT8, BASE_HEX, NULL, 0x0f, NULL, HFILL}
6853 {&hf_cm_rep_localcaguid, {
6854 "Local CA GUID", "infiniband.cm.rep.localcaguid",
6855 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6857 {&hf_cm_rep_privatedata, {
6858 "PrivateData", "infiniband.cm.rep.private",
6859 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6861 /* IB CM RTU Header */
6862 {&hf_cm_rtu_localcommid, {
6863 "Local Communication ID", "infiniband.cm.rtu.localcommid",
6864 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6866 {&hf_cm_rtu_remotecommid, {
6867 "Remote Communication ID", "infiniband.cm.rtu.remotecommid",
6868 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6870 {&hf_cm_rtu_privatedata, {
6871 "PrivateData", "infiniband.cm.rtu.private",
6872 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6875 {&hf_cm_rej_local_commid, {
6876 "Local Communication ID", "infiniband.cm.rej.localcommid",
6877 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6879 {&hf_cm_rej_remote_commid, {
6880 "Remote Communication ID", "infiniband.cm.rej.remotecommid",
6881 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6883 {&hf_cm_rej_msg_rej, {
6884 "Message REJected", "infiniband.cm.rej.msgrej",
6885 FT_UINT8, BASE_HEX, NULL, 0xc0, NULL, HFILL}
6887 {&hf_cm_rej_msg_reserved0, {
6888 "Reserved", "infiniband.cm.rej.reserved0",
6889 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
6891 {&hf_cm_rej_rej_info_len, {
6892 "Reject Info Length", "infiniband.cm.rej.rejinfolen",
6893 FT_UINT8, BASE_HEX, NULL, 0xfe, NULL, HFILL}
6895 {&hf_cm_rej_msg_reserved1, {
6896 "Reserved", "infiniband.cm.rej.reserved1",
6897 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
6899 {&hf_cm_rej_reason, {
6900 "Reason", "infiniband.cm.rej.reason",
6901 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6903 {&hf_cm_rej_add_rej_info, {
6904 "Additional Reject Information (ARI)", "infiniband.cm.rej.ari",
6905 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6907 {&hf_cm_rej_private_data, {
6908 "PrivateData", "infiniband.cm.rej.private",
6909 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6911 /* IB CM DREQ Header */
6912 {&hf_cm_dreq_localcommid, {
6913 "Local Communication ID", "infiniband.cm.dreq.localcommid",
6914 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6916 {&hf_cm_dreq_remotecommid, {
6917 "Remote Communication ID", "infiniband.cm.dreq.remotecommid",
6918 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6920 {&hf_cm_dreq_remote_qpn, {
6921 "Remote QPN/EECN", "infiniband.cm.req.remoteqpneecn",
6922 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6924 {&hf_cm_dreq_privatedata, {
6925 "PrivateData", "infiniband.cm.dreq.private",
6926 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6928 /* IB CM DRSP Header */
6929 {&hf_cm_drsp_localcommid, {
6930 "Local Communication ID", "infiniband.cm.drsp.localcommid",
6931 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6933 {&hf_cm_drsp_remotecommid, {
6934 "Remote Communication ID", "infiniband.cm.drsp.remotecommid",
6935 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6937 {&hf_cm_drsp_privatedata, {
6938 "PrivateData", "infiniband.cm.drsp.private",
6939 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6942 /* MAD Base Header */
6943 { &hf_infiniband_MAD, {
6944 "MAD (Management Datagram) Common Header", "infiniband.mad",
6945 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6947 { &hf_infiniband_base_version, {
6948 "Base Version", "infiniband.mad.baseversion",
6949 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6951 { &hf_infiniband_mgmt_class, {
6952 "Management Class", "infiniband.mad.mgmtclass",
6953 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6955 { &hf_infiniband_class_version, {
6956 "Class Version", "infiniband.mad.classversion",
6957 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6959 { &hf_infiniband_method, {
6960 "Method", "infiniband.mad.method",
6961 FT_UINT8, BASE_HEX, VALS(mad_method_str), 0x0, NULL, HFILL}
6963 { &hf_infiniband_status, {
6964 "Status", "infiniband.mad.status",
6965 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6967 { &hf_infiniband_class_specific, {
6968 "Class Specific", "infiniband.mad.classspecific",
6969 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6971 { &hf_infiniband_transaction_id, {
6972 "Transaction ID", "infiniband.mad.transactionid",
6973 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
6975 { &hf_infiniband_attribute_id, {
6976 "Attribute ID", "infiniband.mad.attributeid",
6977 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
6979 { &hf_infiniband_attribute_modifier, {
6980 "Attribute Modifier", "infiniband.mad.attributemodifier",
6981 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6983 { &hf_infiniband_data, {
6984 "MAD Data Payload", "infiniband.mad.data",
6985 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6989 { &hf_infiniband_RMPP, {
6990 "RMPP (Reliable Multi-Packet Transaction Protocol)", "infiniband.rmpp",
6991 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
6993 { &hf_infiniband_rmpp_version, {
6994 "RMPP Type", "infiniband.rmpp.rmppversion",
6995 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
6997 { &hf_infiniband_rmpp_type, {
6998 "RMPP Type", "infiniband.rmpp.rmpptype",
6999 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7001 { &hf_infiniband_r_resp_time, {
7002 "R Resp Time", "infiniband.rmpp.rresptime",
7003 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7005 { &hf_infiniband_rmpp_flags, {
7006 "RMPP Flags", "infiniband.rmpp.rmppflags",
7007 FT_UINT8, BASE_HEX, VALS(RMPP_Flags), 0x0F, NULL, HFILL}
7009 { &hf_infiniband_rmpp_status, {
7010 "RMPP Status", "infiniband.rmpp.rmppstatus",
7011 FT_UINT8, BASE_HEX, VALS(RMPP_Status), 0x0, NULL, HFILL}
7013 { &hf_infiniband_rmpp_data1, {
7014 "RMPP Data 1", "infiniband.rmpp.data1",
7015 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7017 { &hf_infiniband_rmpp_data2, {
7018 "RMPP Data 2", "infiniband.rmpp.data2",
7019 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7024 { &hf_infiniband_RMPP_DATA, {
7025 "RMPP Data (Reliable Multi-Packet Transaction Protocol)", "infiniband.rmpp.data",
7026 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7029 { &hf_infiniband_segment_number, {
7030 "Segment Number", "infiniband.rmpp.segmentnumber",
7031 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7033 { &hf_infiniband_payload_length32, {
7034 "Payload Length", "infiniband.rmpp.payloadlength",
7035 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7037 { &hf_infiniband_transferred_data, {
7038 "Transferred Data", "infiniband.rmpp.transferreddata",
7039 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7043 { &hf_infiniband_new_window_last, {
7044 "New Window Last", "infiniband.rmpp.newwindowlast",
7045 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7048 /* RMPP ABORT/STOP */
7049 { &hf_infiniband_optional_extended_error_data, {
7050 "Optional Extended Error Data", "infiniband.rmpp.extendederrordata",
7051 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7054 /* SMP Data (LID Routed) */
7055 { &hf_infiniband_SMP_LID, {
7056 "Subnet Management Packet (LID Routed)", "infiniband.smplid",
7057 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7059 { &hf_infiniband_m_key, {
7060 "M_Key", "infiniband.smplid.mkey",
7061 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7063 { &hf_infiniband_smp_data, {
7064 "SMP Data", "infiniband.smplid.smpdata",
7065 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7068 /* XX: All following verified/corrected against Infiniband 1.2.1 Specification */
7069 /* SMP Data Directed Route */
7070 { &hf_infiniband_SMP_DIRECTED, {
7071 "Subnet Management Packet (Directed Route)", "infiniband.smpdirected",
7072 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7074 { &hf_infiniband_smp_status, {
7075 "Status", "infiniband.smpdirected.smpstatus",
7076 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7078 { &hf_infiniband_hop_pointer, {
7079 "Hop Pointer", "infiniband.smpdirected.hoppointer",
7080 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7082 { &hf_infiniband_hop_count, {
7083 "Hop Count", "infiniband.smpdirected.hopcount",
7084 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7086 { &hf_infiniband_dr_slid, {
7087 "DrSLID", "infiniband.smpdirected.drslid",
7088 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7090 { &hf_infiniband_dr_dlid, {
7091 "DrDLID", "infiniband.smpdirected.drdlid",
7092 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7094 { &hf_infiniband_d, {
7095 "D (Direction Bit)", "infiniband.smpdirected.d",
7096 FT_UINT64, BASE_HEX, NULL, 0x8000, NULL, HFILL}
7098 { &hf_infiniband_initial_path, {
7099 "Initial Path", "infiniband.smpdirected.initialpath",
7100 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7102 { &hf_infiniband_return_path, {
7103 "Return Path", "infiniband.smpdirected.returnpath",
7104 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7108 { &hf_infiniband_SA, {
7109 "SA Packet (Subnet Administration)", "infiniband.sa.drdlid",
7110 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7112 { &hf_infiniband_sm_key, {
7113 "SM_Key (Verification Key)", "infiniband.sa.smkey",
7114 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7116 { &hf_infiniband_attribute_offset, {
7117 "Attribute Offset", "infiniband.sa.attributeoffset",
7118 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7120 { &hf_infiniband_component_mask, {
7121 "Component Mask", "infiniband.sa.componentmask",
7122 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7124 { &hf_infiniband_subnet_admin_data, {
7125 "Subnet Admin Data", "infiniband.sa.subnetadmindata",
7126 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7129 /* NodeDescription */
7130 { &hf_infiniband_NodeDescription_NodeString, {
7131 "NodeString", "infiniband.nodedescription.nodestring",
7132 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
7136 { &hf_infiniband_NodeInfo_BaseVersion, {
7137 "BaseVersion", "infiniband.nodeinfo.baseversion",
7138 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7140 { &hf_infiniband_NodeInfo_ClassVersion, {
7141 "ClassVersion", "infiniband.nodeinfo.classversion",
7142 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7144 { &hf_infiniband_NodeInfo_NodeType, {
7145 "NodeType", "infiniband.nodeinfo.nodetype",
7146 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7148 { &hf_infiniband_NodeInfo_NumPorts, {
7149 "NumPorts", "infiniband.nodeinfo.numports",
7150 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7152 { &hf_infiniband_NodeInfo_SystemImageGUID, {
7153 "SystemImageGUID", "infiniband.nodeinfo.systemimageguid",
7154 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7156 { &hf_infiniband_NodeInfo_NodeGUID, {
7157 "NodeGUID", "infiniband.nodeinfo.nodeguid",
7158 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7160 { &hf_infiniband_NodeInfo_PortGUID, {
7161 "PortGUID", "infiniband.nodeinfo.portguid",
7162 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7164 { &hf_infiniband_NodeInfo_PartitionCap, {
7165 "PartitionCap", "infiniband.nodeinfo.partitioncap",
7166 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7168 { &hf_infiniband_NodeInfo_DeviceID, {
7169 "DeviceID", "infiniband.nodeinfo.deviceid",
7170 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7172 { &hf_infiniband_NodeInfo_Revision, {
7173 "Revision", "infiniband.nodeinfo.revision",
7174 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7176 { &hf_infiniband_NodeInfo_LocalPortNum, {
7177 "LocalPortNum", "infiniband.nodeinfo.localportnum",
7178 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7180 { &hf_infiniband_NodeInfo_VendorID, {
7181 "VendorID", "infiniband.nodeinfo.vendorid",
7182 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7186 { &hf_infiniband_SwitchInfo_LinearFDBCap, {
7187 "LinearFDBCap", "infiniband.switchinfo.linearfdbcap",
7188 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7190 { &hf_infiniband_SwitchInfo_RandomFDBCap, {
7191 "RandomFDBCap", "infiniband.switchinfo.randomfdbcap",
7192 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7194 { &hf_infiniband_SwitchInfo_MulticastFDBCap, {
7195 "MulticastFDBCap", "infiniband.switchinfo.multicastfdbcap",
7196 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7198 { &hf_infiniband_SwitchInfo_LinearFDBTop, {
7199 "LinearFDBTop", "infiniband.switchinfo.linearfdbtop",
7200 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7202 { &hf_infiniband_SwitchInfo_DefaultPort, {
7203 "DefaultPort", "infiniband.switchinfo.defaultport",
7204 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7206 { &hf_infiniband_SwitchInfo_DefaultMulticastPrimaryPort, {
7207 "DefaultMulticastPrimaryPort", "infiniband.switchinfo.defaultmulticastprimaryport",
7208 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7210 { &hf_infiniband_SwitchInfo_DefaultMulticastNotPrimaryPort, {
7211 "DefaultMulticastNotPrimaryPort", "infiniband.switchinfo.defaultmulticastnotprimaryport",
7212 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7214 { &hf_infiniband_SwitchInfo_LifeTimeValue, {
7215 "LifeTimeValue", "infiniband.switchinfo.lifetimevalue",
7216 FT_UINT8, BASE_HEX, NULL, 0xF8, NULL, HFILL}
7218 { &hf_infiniband_SwitchInfo_PortStateChange, {
7219 "PortStateChange", "infiniband.switchinfo.portstatechange",
7220 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL}
7222 { &hf_infiniband_SwitchInfo_OptimizedSLtoVLMappingProgramming, {
7223 "OptimizedSLtoVLMappingProgramming", "infiniband.switchinfo.optimizedsltovlmappingprogramming",
7224 FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL}
7226 { &hf_infiniband_SwitchInfo_LIDsPerPort, {
7227 "LIDsPerPort", "infiniband.switchinfo.lidsperport",
7228 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7230 { &hf_infiniband_SwitchInfo_PartitionEnforcementCap, {
7231 "PartitionEnforcementCap", "infiniband.switchinfo.partitionenforcementcap",
7232 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7234 { &hf_infiniband_SwitchInfo_InboundEnforcementCap, {
7235 "InboundEnforcementCap", "infiniband.switchinfo.inboundenforcementcap",
7236 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7238 { &hf_infiniband_SwitchInfo_OutboundEnforcementCap, {
7239 "OutboundEnforcementCap", "infiniband.switchinfo.outboundenforcementcap",
7240 FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL}
7242 { &hf_infiniband_SwitchInfo_FilterRawInboundCap, {
7243 "FilterRawInboundCap", "infiniband.switchinfo.filterrawinboundcap",
7244 FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL}
7246 { &hf_infiniband_SwitchInfo_FilterRawOutboundCap, {
7247 "FilterRawOutboundCap", "infiniband.switchinfo.filterrawoutboundcap",
7248 FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL}
7250 { &hf_infiniband_SwitchInfo_EnhancedPortZero, {
7251 "EnhancedPortZero", "infiniband.switchinfo.enhancedportzero",
7252 FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL}
7257 { &hf_infiniband_GUIDInfo_GUIDBlock, {
7258 "GUIDBlock", "infiniband.switchinfo.guidblock",
7259 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7262 { &hf_infiniband_GUIDInfo_GUID, {
7263 "GUID", "infiniband.switchinfo.guid",
7264 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7268 { &hf_infiniband_PortInfo_M_Key, {
7269 "M_Key", "infiniband.portinfo.m_key",
7270 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7272 { &hf_infiniband_PortInfo_GidPrefix, {
7273 "GidPrefix", "infiniband.portinfo.guid",
7274 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7276 { &hf_infiniband_PortInfo_LID, {
7277 "LID", "infiniband.portinfo.lid",
7278 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7280 { &hf_infiniband_PortInfo_MasterSMLID, {
7281 "MasterSMLID", "infiniband.portinfo.mastersmlid",
7282 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7284 { &hf_infiniband_PortInfo_CapabilityMask, {
7285 "CapabilityMask", "infiniband.portinfo.capabilitymask",
7286 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7289 /* Capability Mask Flags */
7290 { &hf_infiniband_PortInfo_CapabilityMask_SM, {
7291 "SM", "infiniband.portinfo.capabilitymask.issm",
7292 FT_UINT32, BASE_HEX, NULL, 0x00000002, NULL, HFILL}
7294 { &hf_infiniband_PortInfo_CapabilityMask_NoticeSupported, {
7295 "NoticeSupported", "infiniband.portinfo.capabilitymask.noticesupported",
7296 FT_UINT32, BASE_HEX, NULL, 0x00000004, NULL, HFILL}
7298 { &hf_infiniband_PortInfo_CapabilityMask_TrapSupported, {
7299 "TrapSupported", "infiniband.portinfo.capabilitymask.trapsupported",
7300 FT_UINT32, BASE_HEX, NULL, 0x00000008, NULL, HFILL}
7302 { &hf_infiniband_PortInfo_CapabilityMask_OptionalIPDSupported, {
7303 "OptionalIPDSupported", "infiniband.portinfo.capabilitymask.optionalipdsupported",
7304 FT_UINT32, BASE_HEX, NULL, 0x00000010, NULL, HFILL}
7306 { &hf_infiniband_PortInfo_CapabilityMask_AutomaticMigrationSupported, {
7307 "AutomaticMigrationSupported", "infiniband.portinfo.capabilitymask.automaticmigrationsupported",
7308 FT_UINT32, BASE_HEX, NULL, 0x00000020, NULL, HFILL}
7310 { &hf_infiniband_PortInfo_CapabilityMask_SLMappingSupported, {
7311 "SLMappingSupported", "infiniband.portinfo.capabilitymask.slmappingsupported",
7312 FT_UINT32, BASE_HEX, NULL, 0x00000040, NULL, HFILL}
7314 { &hf_infiniband_PortInfo_CapabilityMask_MKeyNVRAM, {
7315 "MKeyNVRAM", "infiniband.portinfo.capabilitymask.mkeynvram",
7316 FT_UINT32, BASE_HEX, NULL, 0x00000080, NULL, HFILL}
7318 { &hf_infiniband_PortInfo_CapabilityMask_PKeyNVRAM, {
7319 "PKeyNVRAM", "infiniband.portinfo.capabilitymask.pkeynvram",
7320 FT_UINT32, BASE_HEX, NULL, 0x00000100, NULL, HFILL}
7322 { &hf_infiniband_PortInfo_CapabilityMask_LEDInfoSupported, {
7323 "LEDInfoSupported", "infiniband.portinfo.capabilitymask.ledinfosupported",
7324 FT_UINT32, BASE_HEX, NULL, 0x00000200, NULL, HFILL}
7326 { &hf_infiniband_PortInfo_CapabilityMask_SMdisabled, {
7327 "SMdisabled", "infiniband.portinfo.capabilitymask.smdisabled",
7328 FT_UINT32, BASE_HEX, NULL, 0x00000400, NULL, HFILL}
7330 { &hf_infiniband_PortInfo_CapabilityMask_SystemImageGUIDSupported, {
7331 "SystemImageGUIDSupported", "infiniband.portinfo.capabilitymask.systemimageguidsupported",
7332 FT_UINT32, BASE_HEX, NULL, 0x00000800, NULL, HFILL}
7334 { &hf_infiniband_PortInfo_CapabilityMask_PKeySwitchExternalPortTrapSupported, {
7335 "PKeySwitchExternalPortTrapSupported", "infiniband.portinfo.capabilitymask.pkeyswitchexternalporttrapsupported",
7336 FT_UINT32, BASE_HEX, NULL, 0x00001000, NULL, HFILL}
7338 { &hf_infiniband_PortInfo_CapabilityMask_CommunicationManagementSupported, {
7339 "CommunicationManagementSupported", "infiniband.portinfo.capabilitymask.communicationmanagementsupported",
7340 FT_UINT32, BASE_HEX, NULL, 0x00010000, NULL, HFILL}
7342 { &hf_infiniband_PortInfo_CapabilityMask_SNMPTunnelingSupported, {
7343 "SNMPTunnelingSupported", "infiniband.portinfo.capabilitymask.snmptunnelingsupported",
7344 FT_UINT32, BASE_HEX, NULL, 0x00020000, NULL, HFILL}
7346 { &hf_infiniband_PortInfo_CapabilityMask_ReinitSupported, {
7347 "ReinitSupported", "infiniband.portinfo.capabilitymask.reinitsupported",
7348 FT_UINT32, BASE_HEX, NULL, 0x00040000, NULL, HFILL}
7350 { &hf_infiniband_PortInfo_CapabilityMask_DeviceManagementSupported, {
7351 "DeviceManagementSupported", "infiniband.portinfo.capabilitymask.devicemanagementsupported",
7352 FT_UINT32, BASE_HEX, NULL, 0x00080000, NULL, HFILL}
7354 { &hf_infiniband_PortInfo_CapabilityMask_VendorClassSupported, {
7355 "VendorClassSupported", "infiniband.portinfo.capabilitymask.vendorclasssupported",
7356 FT_UINT32, BASE_HEX, NULL, 0x00100000, NULL, HFILL}
7358 { &hf_infiniband_PortInfo_CapabilityMask_DRNoticeSupported, {
7359 "DRNoticeSupported", "infiniband.portinfo.capabilitymask.drnoticesupported",
7360 FT_UINT32, BASE_HEX, NULL, 0x00200000, NULL, HFILL}
7362 { &hf_infiniband_PortInfo_CapabilityMask_CapabilityMaskNoticeSupported, {
7363 "CapabilityMaskNoticeSupported", "infiniband.portinfo.capabilitymask.capabilitymasknoticesupported",
7364 FT_UINT32, BASE_HEX, NULL, 0x00400000, NULL, HFILL}
7366 { &hf_infiniband_PortInfo_CapabilityMask_BootManagementSupported, {
7367 "BootManagementSupported", "infiniband.portinfo.capabilitymask.bootmanagementsupported",
7368 FT_UINT32, BASE_HEX, NULL, 0x00800000, NULL, HFILL}
7370 { &hf_infiniband_PortInfo_CapabilityMask_LinkRoundTripLatencySupported, {
7371 "LinkRoundTripLatencySupported", "infiniband.portinfo.capabilitymask.linkroundtriplatencysupported",
7372 FT_UINT32, BASE_HEX, NULL, 0x01000000, NULL, HFILL}
7374 { &hf_infiniband_PortInfo_CapabilityMask_ClientRegistrationSupported, {
7375 "ClientRegistrationSupported", "infiniband.portinfo.capabilitymask.clientregistrationsupported",
7376 FT_UINT32, BASE_HEX, NULL, 0x02000000, NULL, HFILL}
7378 { &hf_infiniband_PortInfo_CapabilityMask_OtherLocalChangesNoticeSupported, {
7379 "OtherLocalChangesNoticeSupported", "infiniband.portinfo.capabilitymask.otherlocalchangesnoticesupported",
7380 FT_UINT32, BASE_HEX, NULL, 0x04000000, NULL, HFILL}
7382 { &hf_infiniband_PortInfo_CapabilityMask_LinkSpeedWIdthPairsTableSupported, {
7383 "LinkSpeedWIdthPairsTableSupported", "infiniband.portinfo.capabilitymask.linkspeedwidthpairstablesupported",
7384 FT_UINT32, BASE_HEX, NULL, 0x08000000, NULL, HFILL}
7386 /* End Capability Mask Flags */
7389 { &hf_infiniband_PortInfo_DiagCode, {
7390 "DiagCode", "infiniband.portinfo.diagcode",
7391 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7393 { &hf_infiniband_PortInfo_M_KeyLeasePeriod, {
7394 "M_KeyLeasePeriod", "infiniband.portinfo.m_keyleaseperiod",
7395 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7397 { &hf_infiniband_PortInfo_LocalPortNum, {
7398 "LocalPortNum", "infiniband.portinfo.localportnum",
7399 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7401 { &hf_infiniband_PortInfo_LinkWidthEnabled, {
7402 "LinkWidthEnabled", "infiniband.portinfo.linkwidthenabled",
7403 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7405 { &hf_infiniband_PortInfo_LinkWidthSupported, {
7406 "LinkWidthSupported", "infiniband.portinfo.linkwidthsupported",
7407 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7409 { &hf_infiniband_PortInfo_LinkWidthActive, {
7410 "LinkWidthActive", "infiniband.portinfo.linkwidthactive",
7411 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7413 { &hf_infiniband_PortInfo_LinkSpeedSupported, {
7414 "LinkSpeedSupported", "infiniband.portinfo.linkspeedsupported",
7415 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7417 { &hf_infiniband_PortInfo_PortState, {
7418 "PortState", "infiniband.portinfo.portstate",
7419 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7421 { &hf_infiniband_PortInfo_PortPhysicalState, {
7422 "PortPhysicalState", "infiniband.portinfo.portphysicalstate",
7423 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7425 { &hf_infiniband_PortInfo_LinkDownDefaultState, {
7426 "LinkDownDefaultState", "infiniband.portinfo.linkdowndefaultstate",
7427 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7429 { &hf_infiniband_PortInfo_M_KeyProtectBits, {
7430 "M_KeyProtectBits", "infiniband.portinfo.m_keyprotectbits",
7431 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7433 { &hf_infiniband_PortInfo_LMC, {
7434 "LMC", "infiniband.portinfo.lmc",
7435 FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL}
7437 { &hf_infiniband_PortInfo_LinkSpeedActive, {
7438 "LinkSpeedActive", "infiniband.portinfo.linkspeedactive",
7439 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7441 { &hf_infiniband_PortInfo_LinkSpeedEnabled, {
7442 "LinkSpeedEnabled", "infiniband.portinfo.linkspeedenabled",
7443 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7445 { &hf_infiniband_PortInfo_NeighborMTU, {
7446 "NeighborMTU", "infiniband.portinfo.neighbormtu",
7447 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7449 { &hf_infiniband_PortInfo_MasterSMSL, {
7450 "MasterSMSL", "infiniband.portinfo.mastersmsl",
7451 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7453 { &hf_infiniband_PortInfo_VLCap, {
7454 "VLCap", "infiniband.portinfo.vlcap",
7455 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7457 { &hf_infiniband_PortInfo_InitType, {
7458 "InitType", "infiniband.portinfo.inittype",
7459 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7461 { &hf_infiniband_PortInfo_VLHighLimit, {
7462 "VLHighLimit", "infiniband.portinfo.vlhighlimit",
7463 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7465 { &hf_infiniband_PortInfo_VLArbitrationHighCap, {
7466 "VLArbitrationHighCap", "infiniband.portinfo.vlarbitrationhighcap",
7467 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7469 { &hf_infiniband_PortInfo_VLArbitrationLowCap, {
7470 "VLArbitrationLowCap", "infiniband.portinfo.vlarbitrationlowcap",
7471 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7473 { &hf_infiniband_PortInfo_InitTypeReply, {
7474 "InitTypeReply", "infiniband.portinfo.inittypereply",
7475 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7477 { &hf_infiniband_PortInfo_MTUCap, {
7478 "MTUCap", "infiniband.portinfo.mtucap",
7479 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7481 { &hf_infiniband_PortInfo_VLStallCount, {
7482 "VLStallCount", "infiniband.portinfo.vlstallcount",
7483 FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL}
7485 { &hf_infiniband_PortInfo_HOQLife, {
7486 "HOQLife", "infiniband.portinfo.hoqlife",
7487 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7489 { &hf_infiniband_PortInfo_OperationalVLs, {
7490 "OperationalVLs", "infiniband.portinfo.operationalvls",
7491 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7493 { &hf_infiniband_PortInfo_PartitionEnforcementInbound, {
7494 "PartitionEnforcementInbound", "infiniband.portinfo.partitionenforcementinbound",
7495 FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL}
7497 { &hf_infiniband_PortInfo_PartitionEnforcementOutbound, {
7498 "PartitionEnforcementOutbound", "infiniband.portinfo.partitionenforcementoutbound",
7499 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL}
7501 { &hf_infiniband_PortInfo_FilterRawInbound, {
7502 "FilterRawInbound", "infiniband.portinfo.filterrawinbound",
7503 FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}
7505 { &hf_infiniband_PortInfo_FilterRawOutbound, {
7506 "FilterRawOutbound", "infiniband.portinfo.filterrawoutbound",
7507 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
7509 { &hf_infiniband_PortInfo_M_KeyViolations, {
7510 "M_KeyViolations", "infiniband.portinfo.m_keyviolations",
7511 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7513 { &hf_infiniband_PortInfo_P_KeyViolations, {
7514 "P_KeyViolations", "infiniband.portinfo.p_keyviolations",
7515 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7517 { &hf_infiniband_PortInfo_Q_KeyViolations, {
7518 "Q_KeyViolations", "infiniband.portinfo.q_keyviolations",
7519 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7521 { &hf_infiniband_PortInfo_GUIDCap, {
7522 "GUIDCap", "infiniband.portinfo.guidcap",
7523 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7525 { &hf_infiniband_PortInfo_ClientReregister, {
7526 "ClientReregister", "infiniband.portinfo.clientreregister",
7527 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7529 { &hf_infiniband_PortInfo_SubnetTimeOut, {
7530 "SubnetTimeOut", "infiniband.portinfo.subnettimeout",
7531 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7533 { &hf_infiniband_PortInfo_RespTimeValue, {
7534 "RespTimeValue", "infiniband.portinfo.resptimevalue",
7535 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7537 { &hf_infiniband_PortInfo_LocalPhyErrors, {
7538 "LocalPhyErrors", "infiniband.portinfo.localphyerrors",
7539 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7541 { &hf_infiniband_PortInfo_OverrunErrors, {
7542 "OverrunErrors", "infiniband.portinfo.overrunerrors",
7543 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7545 { &hf_infiniband_PortInfo_MaxCreditHint, {
7546 "MaxCreditHint", "infiniband.portinfo.maxcredithint",
7547 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7549 { &hf_infiniband_PortInfo_LinkRoundTripLatency, {
7550 "LinkRoundTripLatency", "infiniband.portinfo.linkroundtriplatency",
7551 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7555 { &hf_infiniband_P_KeyTable_P_KeyTableBlock, {
7556 "P_KeyTableBlock", "infiniband.p_keytable.p_keytableblock",
7557 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7559 { &hf_infiniband_P_KeyTable_MembershipType, {
7560 "MembershipType", "infiniband.p_keytable.membershiptype",
7561 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7563 { &hf_infiniband_P_KeyTable_P_KeyBase, {
7564 "P_KeyBase", "infiniband.p_keytable.p_keybase",
7565 FT_UINT16, BASE_HEX, NULL, 0x7FFF, NULL, HFILL}
7568 /* SLtoVLMappingTable */
7569 { &hf_infiniband_SLtoVLMappingTable_SLtoVL_HighBits, {
7570 "SL(x)toVL", "infiniband.sltovlmappingtable.sltovlhighbits",
7571 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7573 { &hf_infiniband_SLtoVLMappingTable_SLtoVL_LowBits, {
7574 "SL(x)toVL", "infiniband.sltovlmappingtable.sltovllowbits",
7575 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7578 /* VLArbitrationTable */
7580 { &hf_infiniband_VLArbitrationTable_VLWeightPairs, {
7581 "VLWeightPairs", "infiniband.vlarbitrationtable.vlweightpairs",
7582 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7585 { &hf_infiniband_VLArbitrationTable_VL, {
7586 "VL", "infiniband.vlarbitrationtable.vl",
7587 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7589 { &hf_infiniband_VLArbitrationTable_Weight, {
7590 "Weight", "infiniband.vlarbitrationtable.weight",
7591 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7594 /* LinearForwardingTable */
7596 { &hf_infiniband_LinearForwardingTable_LinearForwardingTableBlock, {
7597 "LinearForwardingTableBlock", "infiniband.linearforwardingtable.linearforwardingtableblock",
7598 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7601 { &hf_infiniband_LinearForwardingTable_Port, {
7602 "Port", "infiniband.linearforwardingtable.port",
7603 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7606 /* RandomForwardingTable */
7608 { &hf_infiniband_RandomForwardingTable_RandomForwardingTableBlock, {
7609 "RandomForwardingTableBlock", "infiniband.randomforwardingtable.randomforwardingtableblock",
7610 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7613 { &hf_infiniband_RandomForwardingTable_LID, {
7614 "LID", "infiniband.randomforwardingtable.lid",
7615 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7617 { &hf_infiniband_RandomForwardingTable_Valid, {
7618 "Valid", "infiniband.randomforwardingtable.valid",
7619 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7621 { &hf_infiniband_RandomForwardingTable_LMC, {
7622 "LMC", "infiniband.randomforwardingtable.lmc",
7623 FT_UINT8, BASE_HEX, NULL, 0x70, NULL, HFILL}
7625 { &hf_infiniband_RandomForwardingTable_Port, {
7626 "Port", "infiniband.randomforwardingtable.port",
7627 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7630 /* MulticastForwardingTable */
7632 { &hf_infiniband_MulticastForwardingTable_MulticastForwardingTableBlock , {
7633 "MulticastForwardingTableBlock", "infiniband.multicastforwardingtable.multicastforwardingtableblock",
7634 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7637 { &hf_infiniband_MulticastForwardingTable_PortMask, {
7638 "PortMask", "infiniband.multicastforwardingtable.portmask",
7639 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7643 { &hf_infiniband_SMInfo_GUID, {
7644 "GUID", "infiniband.sminfo.guid",
7645 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7647 { &hf_infiniband_SMInfo_SM_Key, {
7648 "SM_Key", "infiniband.sminfo.sm_key",
7649 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7651 { &hf_infiniband_SMInfo_ActCount, {
7652 "ActCount", "infiniband.sminfo.actcount",
7653 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7655 { &hf_infiniband_SMInfo_Priority, {
7656 "Priority", "infiniband.sminfo.priority",
7657 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7659 { &hf_infiniband_SMInfo_SMState, {
7660 "SMState", "infiniband.sminfo.smstate",
7661 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
7665 { &hf_infiniband_VendorDiag_NextIndex, {
7666 "NextIndex", "infiniband.vendordiag.nextindex",
7667 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7669 { &hf_infiniband_VendorDiag_DiagData, {
7670 "DiagData", "infiniband.vendordiag.diagdata",
7671 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7675 { &hf_infiniband_LedInfo_LedMask, {
7676 "LedMask", "infiniband.ledinfo.ledmask",
7677 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7680 /* LinkSpeedWidthPairsTable */
7681 { &hf_infiniband_LinkSpeedWidthPairsTable_NumTables, {
7682 "NumTables", "infiniband.linkspeedwidthpairstable.numtables",
7683 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7685 { &hf_infiniband_LinkSpeedWidthPairsTable_PortMask, {
7686 "PortMask", "infiniband.linkspeedwidthpairstable.portmask",
7687 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7689 { &hf_infiniband_LinkSpeedWidthPairsTable_SpeedTwoFive, {
7690 "Speed 2.5 Gbps", "infiniband.linkspeedwidthpairstable.speedtwofive",
7691 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7693 { &hf_infiniband_LinkSpeedWidthPairsTable_SpeedFive, {
7694 "Speed 5 Gbps", "infiniband.linkspeedwidthpairstable.speedfive",
7695 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7697 { &hf_infiniband_LinkSpeedWidthPairsTable_SpeedTen, {
7698 "Speed 10 Gbps", "infiniband.linkspeedwidthpairstable.speedten",
7699 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7703 /* PortInfoRecord */
7704 /* SLtoVLMappingTableRecord */
7705 /* SwitchInfoRecord */
7706 /* LinearForwardingTableRecord */
7707 /* RandomForwardingTableRecord */
7708 /* MulticastForwardingTableRecord */
7709 /* VLArbitrationTableRecord */
7710 { &hf_infiniband_SA_LID, {
7711 "LID", "infiniband.sa.lid",
7712 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7714 { &hf_infiniband_SA_EndportLID, {
7715 "EndportLID", "infiniband.sa.endportlid",
7716 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7718 { &hf_infiniband_SA_PortNum, {
7719 "PortNum", "infiniband.sa.portnum",
7720 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7722 { &hf_infiniband_SA_InputPortNum , {
7723 "InputPortNum", "infiniband.sa.inputportnum",
7724 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7726 { &hf_infiniband_SA_OutputPortNum, {
7727 "OutputPortNum", "infiniband.sa.outputportnum",
7728 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7730 { &hf_infiniband_SA_BlockNum_EightBit, {
7731 "BlockNum_EightBit", "infiniband.sa.blocknum_eightbit",
7732 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7734 { &hf_infiniband_SA_BlockNum_NineBit, {
7735 "BlockNum_NineBit", "infiniband.sa.blocknum_ninebit",
7736 FT_UINT16, BASE_HEX, NULL, 0x01FF, NULL, HFILL}
7738 { &hf_infiniband_SA_BlockNum_SixteenBit, {
7739 "BlockNum_SixteenBit", "infiniband.sa.blocknum_sixteenbit",
7740 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7742 { &hf_infiniband_SA_Position, {
7743 "Position", "infiniband.sa.position",
7744 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7747 { &hf_infiniband_SA_Index, {
7748 "Index", "infiniband.sa.index",
7749 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7753 /* InformInfoRecord */
7754 { &hf_infiniband_InformInfoRecord_SubscriberGID, {
7755 "SubscriberGID", "infiniband.informinforecord.subscribergid",
7756 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7758 { &hf_infiniband_InformInfoRecord_Enum, {
7759 "Enum", "infiniband.informinforecord.enum",
7760 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7764 { &hf_infiniband_InformInfo_GID, {
7765 "GID", "infiniband.informinfo.gid",
7766 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7768 { &hf_infiniband_InformInfo_LIDRangeBegin, {
7769 "LIDRangeBegin", "infiniband.informinfo.lidrangebegin",
7770 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7772 { &hf_infiniband_InformInfo_LIDRangeEnd, {
7773 "LIDRangeEnd", "infiniband.informinfo.lidrangeend",
7774 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7776 { &hf_infiniband_InformInfo_IsGeneric, {
7777 "IsGeneric", "infiniband.informinfo.isgeneric",
7778 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7780 { &hf_infiniband_InformInfo_Subscribe, {
7781 "Subscribe", "infiniband.informinfo.subscribe",
7782 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7784 { &hf_infiniband_InformInfo_Type, {
7785 "Type", "infiniband.informinfo.type",
7786 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7788 { &hf_infiniband_InformInfo_TrapNumberDeviceID, {
7789 "TrapNumberDeviceID", "infiniband.informinfo.trapnumberdeviceid",
7790 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7792 { &hf_infiniband_InformInfo_QPN, {
7793 "QPN", "infiniband.informinfo.qpn",
7794 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7796 { &hf_infiniband_InformInfo_RespTimeValue, {
7797 "RespTimeValue", "infiniband.informinfo.resptimevalue",
7798 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
7800 { &hf_infiniband_InformInfo_ProducerTypeVendorID, {
7801 "ProducerTypeVendorID", "infiniband.informinfo.producertypevendorid",
7802 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
7806 { &hf_infiniband_LinkRecord_FromLID, {
7807 "FromLID", "infiniband.linkrecord.fromlid",
7808 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7810 { &hf_infiniband_LinkRecord_FromPort, {
7811 "FromPort", "infiniband.linkrecord.fromport",
7812 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7814 { &hf_infiniband_LinkRecord_ToPort, {
7815 "ToPort", "infiniband.linkrecord.toport",
7816 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7818 { &hf_infiniband_LinkRecord_ToLID, {
7819 "ToLID", "infiniband.linkrecord.tolid",
7820 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7824 { &hf_infiniband_ServiceRecord_ServiceID, {
7825 "ServiceID", "infiniband.linkrecord.serviceid",
7826 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
7828 { &hf_infiniband_ServiceRecord_ServiceGID, {
7829 "ServiceGID", "infiniband.linkrecord.servicegid",
7830 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7832 { &hf_infiniband_ServiceRecord_ServiceP_Key, {
7833 "ServiceP_Key", "infiniband.linkrecord.servicep_key",
7834 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7836 { &hf_infiniband_ServiceRecord_ServiceLease, {
7837 "ServiceLease", "infiniband.linkrecord.servicelease",
7838 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7840 { &hf_infiniband_ServiceRecord_ServiceKey, {
7841 "ServiceKey", "infiniband.linkrecord.servicekey",
7842 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7844 { &hf_infiniband_ServiceRecord_ServiceName, {
7845 "ServiceName", "infiniband.linkrecord.servicename",
7846 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7848 { &hf_infiniband_ServiceRecord_ServiceData, {
7849 "ServiceData", "infiniband.linkrecord.servicedata",
7850 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7853 /* ServiceAssociationRecord */
7854 { &hf_infiniband_ServiceAssociationRecord_ServiceKey, {
7855 "ServiceKey", "infiniband.serviceassociationrecord.servicekey",
7856 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
7858 { &hf_infiniband_ServiceAssociationRecord_ServiceName, {
7859 "ServiceName", "infiniband.serviceassociationrecord.servicename",
7860 FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL}
7864 { &hf_infiniband_PathRecord_DGID, {
7865 "DGID", "infiniband.pathrecord.dgid",
7866 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7868 { &hf_infiniband_PathRecord_SGID, {
7869 "SGID", "infiniband.pathrecord.sgid",
7870 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7872 { &hf_infiniband_PathRecord_DLID, {
7873 "DLID", "infiniband.pathrecord.dlid",
7874 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7876 { &hf_infiniband_PathRecord_SLID, {
7877 "SLID", "infiniband.pathrecord.slid",
7878 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7880 { &hf_infiniband_PathRecord_RawTraffic, {
7881 "RawTraffic", "infiniband.pathrecord.rawtraffic",
7882 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7884 { &hf_infiniband_PathRecord_FlowLabel, {
7885 "FlowLabel", "infiniband.pathrecord.flowlabel",
7886 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
7888 { &hf_infiniband_PathRecord_HopLimit, {
7889 "HopLimit", "infiniband.pathrecord.hoplimit",
7890 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7892 { &hf_infiniband_PathRecord_TClass, {
7893 "TClass", "infiniband.pathrecord.tclass",
7894 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7896 { &hf_infiniband_PathRecord_Reversible, {
7897 "Reversible", "infiniband.pathrecord.reversible",
7898 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
7900 { &hf_infiniband_PathRecord_NumbPath, {
7901 "NumbPath", "infiniband.pathrecord.numbpath",
7902 FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}
7904 { &hf_infiniband_PathRecord_P_Key, {
7905 "P_Key", "infiniband.pathrecord.p_key",
7906 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7908 { &hf_infiniband_PathRecord_SL, {
7909 "SL", "infiniband.pathrecord.sl",
7910 FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL}
7912 { &hf_infiniband_PathRecord_MTUSelector, {
7913 "MTUSelector", "infiniband.pathrecord.mtuselector",
7914 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7916 { &hf_infiniband_PathRecord_MTU, {
7917 "MTU", "infiniband.pathrecord.mtu",
7918 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
7920 { &hf_infiniband_PathRecord_RateSelector, {
7921 "RateSelector", "infiniband.pathrecord.rateselector",
7922 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7924 { &hf_infiniband_PathRecord_Rate, {
7925 "Rate", "infiniband.pathrecord.rate",
7926 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
7928 { &hf_infiniband_PathRecord_PacketLifeTimeSelector, {
7929 "PacketLifeTimeSelector", "infiniband.pathrecord.packetlifetimeselector",
7930 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7932 { &hf_infiniband_PathRecord_PacketLifeTime, {
7933 "PacketLifeTime", "infiniband.pathrecord.packetlifetime",
7934 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
7936 { &hf_infiniband_PathRecord_Preference, {
7937 "Preference", "infiniband.pathrecord.preference",
7938 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7941 /* MCMemberRecord */
7942 { &hf_infiniband_MCMemberRecord_MGID, {
7943 "MGID", "infiniband.mcmemberrecord.mgid",
7944 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7946 { &hf_infiniband_MCMemberRecord_PortGID, {
7947 "PortGID", "infiniband.mcmemberrecord.portgid",
7948 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
7950 { &hf_infiniband_MCMemberRecord_Q_Key, {
7951 "Q_Key", "infiniband.mcmemberrecord.q_key",
7952 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
7954 { &hf_infiniband_MCMemberRecord_MLID, {
7955 "MLID", "infiniband.mcmemberrecord.mlid",
7956 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7958 { &hf_infiniband_MCMemberRecord_MTUSelector, {
7959 "MTUSelector", "infiniband.mcmemberrecord.mtuselector",
7960 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7962 { &hf_infiniband_MCMemberRecord_MTU, {
7963 "MTU", "infiniband.mcmemberrecord.mtu",
7964 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
7966 { &hf_infiniband_MCMemberRecord_TClass, {
7967 "TClass", "infiniband.mcmemberrecord.tclass",
7968 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
7970 { &hf_infiniband_MCMemberRecord_P_Key, {
7971 "P_Key", "infiniband.mcmemberrecord.p_key",
7972 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
7974 { &hf_infiniband_MCMemberRecord_RateSelector, {
7975 "RateSelector", "infiniband.mcmemberrecord.rateselector",
7976 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7978 { &hf_infiniband_MCMemberRecord_Rate, {
7979 "Rate", "infiniband.mcmemberrecord.rate",
7980 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
7982 { &hf_infiniband_MCMemberRecord_PacketLifeTimeSelector, {
7983 "PacketLifeTimeSelector", "infiniband.mcmemberrecord.packetlifetimeselector",
7984 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
7986 { &hf_infiniband_MCMemberRecord_PacketLifeTime, {
7987 "PacketLifeTime", "infiniband.mcmemberrecord.packetlifetime",
7988 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
7990 { &hf_infiniband_MCMemberRecord_SL, {
7991 "SL", "infiniband.mcmemberrecord.sl",
7992 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
7994 { &hf_infiniband_MCMemberRecord_FlowLabel, {
7995 "FlowLabel", "infiniband.mcmemberrecord.flowlabel",
7996 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
7998 { &hf_infiniband_MCMemberRecord_HopLimit, {
7999 "HopLimit", "infiniband.mcmemberrecord.hoplimit",
8000 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8002 { &hf_infiniband_MCMemberRecord_Scope, {
8003 "Scope", "infiniband.mcmemberrecord.scope",
8004 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8006 { &hf_infiniband_MCMemberRecord_JoinState, {
8007 "JoinState", "infiniband.mcmemberrecord.joinstate",
8008 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
8010 { &hf_infiniband_MCMemberRecord_ProxyJoin, {
8011 "ProxyJoin", "infiniband.mcmemberrecord.proxyjoin",
8012 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8016 { &hf_infiniband_TraceRecord_GIDPrefix, {
8017 "GidPrefix", "infiniband.tracerecord.gidprefix",
8018 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8020 { &hf_infiniband_TraceRecord_IDGeneration, {
8021 "IDGeneration", "infiniband.tracerecord.idgeneration",
8022 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8024 { &hf_infiniband_TraceRecord_NodeType, {
8025 "NodeType", "infiniband.tracerecord.nodetype",
8026 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8028 { &hf_infiniband_TraceRecord_NodeID, {
8029 "NodeID", "infiniband.tracerecord.nodeid",
8030 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8032 { &hf_infiniband_TraceRecord_ChassisID, {
8033 "ChassisID", "infiniband.tracerecord.chassisid",
8034 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8036 { &hf_infiniband_TraceRecord_EntryPortID, {
8037 "EntryPortID", "infiniband.tracerecord.entryportid",
8038 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8040 { &hf_infiniband_TraceRecord_ExitPortID, {
8041 "ExitPortID", "infiniband.tracerecord.exitportid",
8042 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8044 { &hf_infiniband_TraceRecord_EntryPort, {
8045 "EntryPort", "infiniband.tracerecord.entryport",
8046 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8048 { &hf_infiniband_TraceRecord_ExitPort, {
8049 "ExitPort", "infiniband.tracerecord.exitport",
8050 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8053 /* MultiPathRecord */
8054 { &hf_infiniband_MultiPathRecord_RawTraffic, {
8055 "RawTraffic", "infiniband.multipathrecord.rawtraffic",
8056 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8058 { &hf_infiniband_MultiPathRecord_FlowLabel, {
8059 "FlowLabel", "infiniband.multipathrecord.flowlabel",
8060 FT_UINT24, BASE_HEX, NULL, 0x0FFFFF, NULL, HFILL}
8062 { &hf_infiniband_MultiPathRecord_HopLimit, {
8063 "HopLimit", "infiniband.multipathrecord.hoplimit",
8064 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8066 { &hf_infiniband_MultiPathRecord_TClass, {
8067 "TClass", "infiniband.multipathrecord.tclass",
8068 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8070 { &hf_infiniband_MultiPathRecord_Reversible, {
8071 "Reversible", "infiniband.multipathrecord.reversible",
8072 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8074 { &hf_infiniband_MultiPathRecord_NumbPath, {
8075 "NumbPath", "infiniband.multipathrecord.numbpath",
8076 FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}
8078 { &hf_infiniband_MultiPathRecord_P_Key, {
8079 "P_Key", "infiniband.multipathrecord.p_key",
8080 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8082 { &hf_infiniband_MultiPathRecord_SL, {
8083 "SL", "infiniband.multipathrecord.sl",
8084 FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL}
8086 { &hf_infiniband_MultiPathRecord_MTUSelector, {
8087 "MTUSelector", "infiniband.multipathrecord.mtuselector",
8088 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8090 { &hf_infiniband_MultiPathRecord_MTU, {
8091 "MTU", "infiniband.multipathrecord.mtu",
8092 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8094 { &hf_infiniband_MultiPathRecord_RateSelector, {
8095 "RateSelector", "infiniband.multipathrecord.rateselector",
8096 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8098 { &hf_infiniband_MultiPathRecord_Rate, {
8099 "Rate", "infiniband.multipathrecord.rate",
8100 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8102 { &hf_infiniband_MultiPathRecord_PacketLifeTimeSelector, {
8103 "PacketLifeTimeSelector", "infiniband.multipathrecord.packetlifetimeselector",
8104 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8106 { &hf_infiniband_MultiPathRecord_PacketLifeTime, {
8107 "PacketLifeTime", "infiniband.multipathrecord.packetlifetime",
8108 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8110 { &hf_infiniband_MultiPathRecord_IndependenceSelector, {
8111 "IndependenceSelector", "infiniband.multipathrecord.independenceselector",
8112 FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL}
8114 { &hf_infiniband_MultiPathRecord_GIDScope, {
8115 "GIDScope", "infiniband.multipathrecord.gidscope",
8116 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8118 { &hf_infiniband_MultiPathRecord_SGIDCount, {
8119 "SGIDCount", "infiniband.multipathrecord.sgidcount",
8120 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8122 { &hf_infiniband_MultiPathRecord_DGIDCount, {
8123 "DGIDCount", "infiniband.multipathrecord.dgidcount",
8124 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8126 { &hf_infiniband_MultiPathRecord_SDGID, {
8127 "SDGID", "infiniband.multipathrecord.sdgid",
8128 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8132 { &hf_infiniband_ClassPortInfo_BaseVersion, {
8133 "BaseVersion", "infiniband.classportinfo.baseversion",
8134 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8136 { &hf_infiniband_ClassPortInfo_ClassVersion, {
8137 "ClassVersion", "infiniband.classportinfo.classversion",
8138 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8140 { &hf_infiniband_ClassPortInfo_CapabilityMask, {
8141 "CapabilityMask", "infiniband.classportinfo.capabilitymask",
8142 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8144 { &hf_infiniband_ClassPortInfo_CapabilityMask2, {
8145 "CapabilityMask2", "infiniband.classportinfo.capabilitymask2",
8146 FT_UINT32, BASE_HEX, NULL, 0xFFFFFFE0, NULL, HFILL}
8148 { &hf_infiniband_ClassPortInfo_RespTimeValue, {
8149 "RespTimeValue", "infiniband.classportinfo.resptimevalue",
8150 FT_UINT8, BASE_HEX, NULL, 0x1F, NULL, HFILL}
8152 { &hf_infiniband_ClassPortInfo_RedirectGID, {
8153 "RedirectGID", "infiniband.classportinfo.redirectgid",
8154 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8156 { &hf_infiniband_ClassPortInfo_RedirectTC, {
8157 "RedirectTC", "infiniband.classportinfo.redirecttc",
8158 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8160 { &hf_infiniband_ClassPortInfo_RedirectSL, {
8161 "RedirectSL", "infiniband.classportinfo.redirectsl",
8162 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8164 { &hf_infiniband_ClassPortInfo_RedirectFL, {
8165 "RedirectFL", "infiniband.classportinfo.redirectfl",
8166 FT_UINT24, BASE_HEX, NULL, 0xFFFFF, NULL, HFILL}
8168 { &hf_infiniband_ClassPortInfo_RedirectLID, {
8169 "RedirectLID", "infiniband.classportinfo.redirectlid",
8170 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8172 { &hf_infiniband_ClassPortInfo_RedirectP_Key, {
8173 "RedirectP_Key", "infiniband.classportinfo.redirectpkey",
8174 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8176 { &hf_infiniband_ClassPortInfo_Reserved, {
8177 "Reserved", "infiniband.classportinfo.reserved",
8178 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8180 { &hf_infiniband_ClassPortInfo_RedirectQP, {
8181 "RedirectQP", "infiniband.classportinfo.redirectqp",
8182 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8184 { &hf_infiniband_ClassPortInfo_RedirectQ_Key, {
8185 "RedirectQ_Key", "infiniband.classportinfo.redirectqkey",
8186 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8188 { &hf_infiniband_ClassPortInfo_TrapGID, {
8189 "TrapGID", "infiniband.classportinfo.trapgid",
8190 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8192 { &hf_infiniband_ClassPortInfo_TrapTC, {
8193 "TrapTC", "infiniband.classportinfo.traptc",
8194 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8196 { &hf_infiniband_ClassPortInfo_TrapSL, {
8197 "TrapSL", "infiniband.classportinfo.trapsl",
8198 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8200 { &hf_infiniband_ClassPortInfo_TrapFL, {
8201 "TrapFL", "infiniband.classportinfo.trapfl",
8202 FT_UINT24, BASE_HEX, NULL, 0xFFFFF, NULL, HFILL}
8204 { &hf_infiniband_ClassPortInfo_TrapLID, {
8205 "TrapLID", "infiniband.classportinfo.traplid",
8206 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8208 { &hf_infiniband_ClassPortInfo_TrapP_Key, {
8209 "TrapP_Key", "infiniband.classportinfo.trappkey",
8210 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8212 { &hf_infiniband_ClassPortInfo_TrapQP, {
8213 "TrapQP", "infiniband.classportinfo.trapqp",
8214 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8216 { &hf_infiniband_ClassPortInfo_TrapQ_Key, {
8217 "TrapQ_Key", "infiniband.classportinfo.trapqkey",
8218 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8222 { &hf_infiniband_Notice_IsGeneric, {
8223 "IsGeneric", "infiniband.notice.isgeneric",
8224 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8226 { &hf_infiniband_Notice_Type, {
8227 "Type", "infiniband.notice.type",
8228 FT_UINT8, BASE_HEX, NULL, 0x7F, NULL, HFILL}
8230 { &hf_infiniband_Notice_ProducerTypeVendorID, {
8231 "ProducerTypeVendorID", "infiniband.notice.producertypevendorid",
8232 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8234 { &hf_infiniband_Notice_TrapNumberDeviceID, {
8235 "TrapNumberDeviceID", "infiniband.notice.trapnumberdeviceid",
8236 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8238 { &hf_infiniband_Notice_IssuerLID, {
8239 "IssuerLID", "infiniband.notice.issuerlid",
8240 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8242 { &hf_infiniband_Notice_NoticeToggle, {
8243 "NoticeToggle", "infiniband.notice.noticetoggle",
8244 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8246 { &hf_infiniband_Notice_NoticeCount, {
8247 "NoticeCount", "infiniband.notice.noticecount",
8248 FT_UINT16, BASE_HEX, NULL, 0x7FFF, NULL, HFILL}
8250 { &hf_infiniband_Notice_DataDetails, {
8251 "DataDetails", "infiniband.notice.datadetails",
8252 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8255 { &hf_infiniband_Notice_IssuerGID, {
8256 "IssuerGID", "infiniband.notice.issuergid",
8257 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8259 { &hf_infiniband_Notice_ClassTrapSpecificData, {
8260 "ClassTrapSpecificData", "infiniband.notice.classtrapspecificdata",
8261 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8265 /* Traps 64,65,66,67 */
8266 { &hf_infiniband_Trap_GIDADDR, {
8267 "GIDADDR", "infiniband.trap.gidaddr",
8268 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8271 { &hf_infiniband_Trap_COMP_MASK, {
8272 "COMP_MASK", "infiniband.trap.comp_mask",
8273 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8275 { &hf_infiniband_Trap_WAIT_FOR_REPATH, {
8276 "WAIT_FOR_REPATH", "infiniband.trap.wait_for_repath",
8277 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8280 { &hf_infiniband_Trap_PATH_REC, {
8281 "PATH_REC", "infiniband.trap.path_rec",
8282 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8287 { &hf_infiniband_Trap_LIDADDR, {
8288 "LIDADDR", "infiniband.trap.lidaddr",
8289 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8292 /* Trap 129, 130, 131 */
8293 { &hf_infiniband_Trap_PORTNO, {
8294 "PORTNO", "infiniband.trap.portno",
8295 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8299 { &hf_infiniband_Trap_OtherLocalChanges, {
8300 "OtherLocalChanges", "infiniband.trap.otherlocalchanges",
8301 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
8303 { &hf_infiniband_Trap_CAPABILITYMASK, {
8304 "CAPABILITYMASK", "infiniband.trap.capabilitymask",
8305 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8307 { &hf_infiniband_Trap_LinkSpeecEnabledChange, {
8308 "LinkSpeecEnabledChange", "infiniband.trap.linkspeecenabledchange",
8309 FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL}
8311 { &hf_infiniband_Trap_LinkWidthEnabledChange, {
8312 "LinkWidthEnabledChange", "infiniband.trap.linkwidthenabledchange",
8313 FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL}
8315 { &hf_infiniband_Trap_NodeDescriptionChange, {
8316 "NodeDescriptionChange", "infiniband.trap.nodedescriptionchange",
8317 FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL}
8321 { &hf_infiniband_Trap_SYSTEMIMAGEGUID, {
8322 "SYSTEMIMAGEGUID", "infiniband.trap.systemimageguid",
8323 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8327 { &hf_infiniband_Trap_DRSLID, {
8328 "DRSLID", "infiniband.trap.drslid",
8329 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8331 { &hf_infiniband_Trap_METHOD, {
8332 "METHOD", "infiniband.trap.method",
8333 FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}
8335 { &hf_infiniband_Trap_ATTRIBUTEID, {
8336 "ATTRIBUTEID", "infiniband.trap.attributeid",
8337 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8339 { &hf_infiniband_Trap_ATTRIBUTEMODIFIER, {
8340 "ATTRIBUTEMODIFIER", "infiniband.trap.attributemodifier",
8341 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8343 { &hf_infiniband_Trap_MKEY, {
8344 "MKEY", "infiniband.trap.mkey",
8345 FT_UINT64, BASE_HEX, NULL, 0x0, NULL, HFILL}
8347 { &hf_infiniband_Trap_DRNotice, {
8348 "DRNotice", "infiniband.trap.drnotice",
8349 FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL}
8351 { &hf_infiniband_Trap_DRPathTruncated, {
8352 "DRPathTruncated", "infiniband.trap.drpathtruncated",
8353 FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL}
8355 { &hf_infiniband_Trap_DRHopCount, {
8356 "DRHopCount", "infiniband.trap.drhopcount",
8357 FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL}
8359 { &hf_infiniband_Trap_DRNoticeReturnPath, {
8360 "DRNoticeReturnPath", "infiniband.trap.drnoticereturnpath",
8361 FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}
8365 { &hf_infiniband_Trap_LIDADDR1, {
8366 "LIDADDR1", "infiniband.trap.lidaddr1",
8367 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8369 { &hf_infiniband_Trap_LIDADDR2, {
8370 "LIDADDR2", "infiniband.trap.lidaddr2",
8371 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8373 { &hf_infiniband_Trap_KEY, {
8374 "KEY", "infiniband.trap.key",
8375 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
8377 { &hf_infiniband_Trap_SL, {
8378 "SL", "infiniband.trap.sl",
8379 FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL}
8381 { &hf_infiniband_Trap_QP1, {
8382 "QP1", "infiniband.trap.qp1",
8383 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8385 { &hf_infiniband_Trap_QP2, {
8386 "QP2", "infiniband.trap.qp2",
8387 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
8389 { &hf_infiniband_Trap_GIDADDR1, {
8390 "GIDADDR1", "infiniband.trap.gidaddr1",
8391 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8393 { &hf_infiniband_Trap_GIDADDR2, {
8394 "GIDADDR2", "infiniband.trap.gidaddr2",
8395 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8399 { &hf_infiniband_Trap_DataValid, {
8400 "DataValid", "infiniband.trap.datavalid",
8401 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8403 { &hf_infiniband_Trap_PKEY, {
8404 "PKEY", "infiniband.trap.pkey",
8405 FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}
8407 { &hf_infiniband_Trap_SWLIDADDR, {
8408 "SWLIDADDR", "infiniband.trap.swlidaddr",
8409 FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL}
8411 /* ClassPortInfo in Performance class */
8412 { &hf_infiniband_PerfMgt_ClassPortInfo, {
8413 "ClassPortInfo (Performance Management MAD)", "infiniband.classportinfo",
8414 FT_NONE, BASE_NONE, NULL, 0x0,
8415 "Performance class ClassPortInfo packet", HFILL}
8417 /* PortCounters in Performance class */
8418 { &hf_infiniband_PortCounters, {
8419 "Port Counters (Performance Management MAD)", "infiniband.portcounters",
8420 FT_NONE, BASE_NONE, NULL, 0x0,
8421 "Performance class PortCounters packet", HFILL}
8423 { &hf_infiniband_PortCounters_PortSelect, {
8424 "PortSelect", "infiniband.portcounters.portselect",
8425 FT_UINT8, BASE_HEX, NULL, 0x0,
8426 "Selects the port that will be accessed", HFILL}
8428 { &hf_infiniband_PortCounters_CounterSelect, {
8429 "CounterSelect", "infiniband.portcounters.counterselect",
8430 FT_UINT16, BASE_HEX, NULL, 0x0,
8431 "When writing, selects which counters are affected by the operation", HFILL}
8433 { &hf_infiniband_PortCounters_SymbolErrorCounter, {
8434 "SymbolErrorCounter", "infiniband.portcounters.symbolerrorcounter",
8435 FT_UINT16, BASE_DEC, NULL, 0x0,
8436 "Total number of minor link errors", HFILL}
8438 { &hf_infiniband_PortCounters_LinkErrorRecoveryCounter, {
8439 "LinkErrorRecoveryCounter", "infiniband.portcounters.linkerrorrecoverycounter",
8440 FT_UINT8, BASE_DEC, NULL, 0x0,
8441 "Total number of times successfully completed link error recovery process", HFILL}
8443 { &hf_infiniband_PortCounters_LinkDownedCounter, {
8444 "LinkDownedCounter", "infiniband.portcounters.linkdownedcounter",
8445 FT_UINT8, BASE_DEC, NULL, 0x0,
8446 "Total number of times failed link error recovery process", HFILL}
8448 { &hf_infiniband_PortCounters_PortRcvErrors, {
8449 "PortRcvErrors", "infiniband.portcounters.portrcverrors",
8450 FT_UINT16, BASE_DEC, NULL, 0x0,
8451 "Total number of packets containing an error received", HFILL}
8453 { &hf_infiniband_PortCounters_PortRcvRemotePhysicalErrors, {
8454 "PortRcvRemotePhysicalErrors", "infiniband.portcounters.portrcvremotephysicalerrors",
8455 FT_UINT16, BASE_DEC, NULL, 0x0,
8456 "Total number of packets marked with EBP delimiter received", HFILL}
8458 { &hf_infiniband_PortCounters_PortRcvSwitchRelayErrors, {
8459 "PortRcvSwitchRelayErrors", "infiniband.portcounters.portrcvswitchrelayerrors",
8460 FT_UINT16, BASE_DEC, NULL, 0x0,
8461 "Total number of packets discarded because they could not be forwarded by switch relay",
8464 { &hf_infiniband_PortCounters_PortXmitDiscards, {
8465 "PortXmitDiscards", "infiniband.portcounters.portxmitdiscards",
8466 FT_UINT16, BASE_DEC, NULL, 0x0,
8467 "Total number of outbound packets discarded", HFILL}
8469 { &hf_infiniband_PortCounters_PortXmitConstraintErrors, {
8470 "PortXmitConstraintErrors", "infiniband.portcounters.portxmitconstrainterrors",
8471 FT_UINT8, BASE_DEC, NULL, 0x0,
8472 "Total number of packets not transmitted from the switch physical port", HFILL}
8474 { &hf_infiniband_PortCounters_PortRcvConstraintErrors, {
8475 "PortRcvConstraintErrors", "infiniband.portcounters.portrcvconstrainterrors",
8476 FT_UINT8, BASE_DEC, NULL, 0x0,
8477 "Total number of packets received on the switch physical port that are discarded", HFILL}
8479 { &hf_infiniband_PortCounters_LocalLinkIntegrityErrors, {
8480 "LocalLinkIntegrityErrors", "infiniband.portcounters.locallinkintegrityerrors",
8481 FT_UINT8, BASE_DEC, NULL, 0x0,
8482 "The number of times the count of local physical errors exceeded the threshold specified by LocalPhyErrors",
8485 { &hf_infiniband_PortCounters_ExcessiveBufferOverrunErrors, {
8486 "ExcessiveBufferOverrunErrors", "infiniband.portcounters.excessivebufferoverrunerrors",
8487 FT_UINT8, BASE_DEC, NULL, 0x0,
8488 "The number of times that OverrunErrors consecutive flow control update periods occurred",
8491 { &hf_infiniband_PortCounters_VL15Dropped, {
8492 "VL15Dropped", "infiniband.portcounters.vl15dropped",
8493 FT_UINT16, BASE_DEC, NULL, 0x0,
8494 "Number of incoming VL15 packets dropped", HFILL}
8496 { &hf_infiniband_PortCounters_PortXmitData, {
8497 "PortXmitData", "infiniband.portcounters.portxmitdata",
8498 FT_UINT32, BASE_DEC, NULL, 0x0,
8499 "Total number of data octets, divided by 4, transmitted on all VLs from the port", HFILL}
8501 { &hf_infiniband_PortCounters_PortRcvData, {
8502 "PortRcvData", "infiniband.portcounters.portrcvdata",
8503 FT_UINT32, BASE_DEC, NULL, 0x0,
8504 "Total number of data octets, divided by 4, received on all VLs at the port", HFILL}
8506 { &hf_infiniband_PortCounters_PortXmitPkts, {
8507 "PortXmitPkts", "infiniband.portcounters.portxmitpkts",
8508 FT_UINT32, BASE_DEC, NULL, 0x0,
8509 "Total number of packets transmitted on all VLs from the port", HFILL}
8511 { &hf_infiniband_PortCounters_PortRcvPkts, {
8512 "PortRcvPkts", "infiniband.portcounters.portrcvpkts",
8513 FT_UINT32, BASE_DEC, NULL, 0x0,
8514 "Total number of packets received from all VLs on the port", HFILL}
8516 /* PortCountersExtended in Performance class */
8517 { &hf_infiniband_PortCountersExt, {
8518 "Port Counters Extended (Performance Management MAD)", "infiniband.portcounters_ext",
8519 FT_NONE, BASE_NONE, NULL, 0x0,
8520 "Performance class PortCountersExtended packet", HFILL}
8522 { &hf_infiniband_PortCountersExt_PortSelect, {
8523 "PortSelect", "infiniband.portcounters_ext.portselect",
8524 FT_UINT8, BASE_HEX, NULL, 0x0,
8525 "Selects the port that will be accessed", HFILL}
8527 { &hf_infiniband_PortCountersExt_CounterSelect, {
8528 "CounterSelect", "infiniband.portcounters_ext.counterselect",
8529 FT_UINT16, BASE_HEX, NULL, 0x0,
8530 "When writing, selects which counters are affected by the operation", HFILL}
8532 { &hf_infiniband_PortCountersExt_PortXmitData, {
8533 "PortXmitData", "infiniband.portcounters_ext.portxmitdata",
8534 FT_UINT64, BASE_DEC, NULL, 0x0,
8535 "Total number of data octets, divided by 4, transmitted on all VLs from the port", HFILL}
8537 { &hf_infiniband_PortCountersExt_PortRcvData, {
8538 "PortRcvData", "infiniband.portcounters_ext.portrcvdata",
8539 FT_UINT64, BASE_DEC, NULL, 0x0,
8540 "Total number of data octets, divided by 4, received on all VLs at the port", HFILL}
8542 { &hf_infiniband_PortCountersExt_PortXmitPkts, {
8543 "PortXmitPkts", "infiniband.portcounters_ext.portxmitpkts",
8544 FT_UINT64, BASE_DEC, NULL, 0x0,
8545 "Total number of packets transmitted on all VLs from the port", HFILL}
8547 { &hf_infiniband_PortCountersExt_PortRcvPkts, {
8548 "PortRcvPkts", "infiniband.portcounters_ext.portrcvpkts",
8549 FT_UINT64, BASE_DEC, NULL, 0x0,
8550 "Total number of packets received from all VLs on the port", HFILL}
8552 { &hf_infiniband_PortCountersExt_PortUnicastXmitPkts, {
8553 "PortUnicastXmitPkts", "infiniband.portcounters_ext.portunicastxmitpkts",
8554 FT_UINT64, BASE_DEC, NULL, 0x0,
8555 "Total number of unicast packets transmitted on all VLs from the port", HFILL}
8557 { &hf_infiniband_PortCountersExt_PortUnicastRcvPkts, {
8558 "PortUnicastRcvPkts", "infiniband.portcounters_ext.portunicastrcvpkts",
8559 FT_UINT64, BASE_DEC, NULL, 0x0,
8560 "Total number of unicast packets received from all VLs on the port", HFILL}
8562 { &hf_infiniband_PortCountersExt_PortMulticastXmitPkts, {
8563 "PortMulticastXmitPkts", "infiniband.portcounters_ext.portmulticastxmitpkts",
8564 FT_UINT64, BASE_DEC, NULL, 0x0,
8565 "Total number of multicast packets transmitted on all VLs from the port", HFILL}
8567 { &hf_infiniband_PortCountersExt_PortMulticastRcvPkts, {
8568 "PortMulticastRcvPkts", "infiniband.portcounters_ext.portmulticastrcvpkts",
8569 FT_UINT64, BASE_DEC, NULL, 0x0,
8570 "Total number of multicast packets received from all VLs on the port", HFILL}
8574 /* Array to hold expansion options between dissections */
8575 static gint *ett[] = {
8576 /* &ett_infiniband, */
8593 &ett_subn_lid_routed,
8594 &ett_subn_directed_route,
8601 &ett_subm_attribute,
8602 &ett_suba_attribute,
8605 /* &ett_nodedesc, */
8606 /* &ett_nodeinfo, */
8607 /* &ett_switchinfo, */
8608 /* &ett_guidinfo, */
8609 /* &ett_portinfo, */
8610 &ett_portinfo_capmask,
8613 &ett_vlarbitrationtable,
8614 &ett_linearforwardingtable,
8615 &ett_randomforwardingtable,
8616 &ett_multicastforwardingtable,
8620 &ett_linkspeedwidthpairs,
8625 &ett_mcmemberrecord,
8627 &ett_multipathrecord,
8628 &ett_serviceassocrecord,
8632 static hf_register_info hf_link[] = {
8633 { &hf_infiniband_link_op, {
8634 "Operand", "infiniband_link.op",
8635 FT_UINT16, BASE_DEC, VALS(Operand_Description), 0xF000, NULL, HFILL}
8637 { &hf_infiniband_link_fctbs, {
8638 "Flow Control Total Blocks Sent", "infiniband_link.fctbs",
8639 FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL}
8641 { &hf_infiniband_link_vl, {
8642 "Virtual Lane", "infiniband_link.vl",
8643 FT_UINT16, BASE_DEC, NULL, 0xF000, NULL, HFILL}
8645 { &hf_infiniband_link_fccl, {
8646 "Flow Control Credit Limit", "infiniband_link.fccl",
8647 FT_UINT16, BASE_DEC, NULL, 0x0FFF, NULL, HFILL}
8649 { &hf_infiniband_link_lpcrc, {
8650 "Link Packet CRC", "infiniband_link.lpcrc",
8651 FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}
8655 static gint *ett_link_array[] = {
8659 static hf_register_info hf_eoib[] = {
8660 /* Mellanox EoIB encapsulation header */
8661 { &hf_infiniband_ver, {
8662 "Version", "infiniband.eoib.version",
8663 FT_UINT16, BASE_HEX, NULL, MELLANOX_VERSION_FLAG, NULL, HFILL}
8665 { &hf_infiniband_tcp_chk, {
8666 "TCP Checksum", "infiniband.eoib.tcp_chk",
8667 FT_UINT16, BASE_HEX, NULL, MELLANOX_TCP_CHECKSUM_FLAG, NULL, HFILL}
8669 { &hf_infiniband_ip_chk, {
8670 "IP Checksum", "infiniband.eoib.ip_chk",
8671 FT_UINT16, BASE_HEX, NULL, MELLANOX_IP_CHECKSUM_FLAG, NULL, HFILL}
8673 { &hf_infiniband_fcs, {
8674 "FCS Field Present", "infiniband.eoib.fcs",
8675 FT_BOOLEAN, 16, NULL, MELLANOX_FCS_PRESENT_FLAG, NULL, HFILL}
8677 { &hf_infiniband_ms, {
8678 "More Segments to Follow", "infiniband.eoib.ms",
8679 FT_BOOLEAN, 16, NULL, MELLANOX_MORE_SEGMENT_FLAG, NULL, HFILL}
8681 { &hf_infiniband_seg_off, {
8682 "Segment Offset", "infiniband.eoib.ip_seg_offset",
8683 FT_UINT16, BASE_DEC, NULL, MELLANOX_SEGMENT_FLAG, NULL, HFILL}
8685 { &hf_infiniband_seg_id, {
8686 "Segment ID", "infiniband.eoib.ip_seg_id",
8687 FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}
8691 static gint *ett_eoib_array[] = {
8695 proto_infiniband = proto_register_protocol("InfiniBand", "IB", "infiniband");
8696 ib_handle = register_dissector("infiniband", dissect_infiniband, proto_infiniband);
8698 proto_register_field_array(proto_infiniband, hf, array_length(hf));
8699 proto_register_subtree_array(ett, array_length(ett));
8701 /* register the subdissector tables */
8702 heur_dissectors_payload = register_heur_dissector_list("infiniband.payload", proto_infiniband);
8703 heur_dissectors_cm_private = register_heur_dissector_list("infiniband.mad.cm.private", proto_infiniband);
8705 /* register dissection preferences */
8706 infiniband_module = prefs_register_protocol(proto_infiniband, proto_reg_handoff_infiniband);
8708 prefs_register_obsolete_preference(infiniband_module, "identify_payload");
8709 prefs_register_obsolete_preference(infiniband_module, "dissect_eoib");
8710 prefs_register_uint_preference(infiniband_module, "rroce.port", "RRoce UDP Port",
8711 "The UDP port for RROCE messages (default " G_STRINGIFY(DEFAULT_RROCE_UDP_PORT) ")",
8712 10, &pref_rroce_udp_port);
8713 prefs_register_bool_preference(infiniband_module, "try_heuristic_first",
8714 "Try heuristic sub-dissectors first",
8715 "Try to decode a packet using an heuristic sub-dissector before using Decode As",
8716 &try_heuristic_first);
8718 proto_infiniband_link = proto_register_protocol("InfiniBand Link", "InfiniBand Link", "infiniband_link");
8719 ib_link_handle = register_dissector("infiniband_link", dissect_infiniband_link, proto_infiniband_link);
8721 proto_register_field_array(proto_infiniband_link, hf_link, array_length(hf_link));
8722 proto_register_subtree_array(ett_link_array, array_length(ett_link_array));
8724 proto_mellanox_eoib = proto_register_protocol("Mellanox EoIB Encapsulation Header", "Mellanox EoIB", "infiniband.eoib");
8725 proto_register_field_array(proto_infiniband, hf_eoib, array_length(hf_eoib));
8726 proto_register_subtree_array(ett_eoib_array, array_length(ett_eoib_array));
8728 /* initialize the hash table */
8729 CM_context_table = g_hash_table_new_full(g_int64_hash, g_int64_equal,
8730 table_destroy_notify, table_destroy_notify);
8732 subdissector_table = register_decode_as_next_proto(proto_infiniband, "infiniband", "Infiniband Payload",
8733 infiniband_payload_prompt);
8735 register_shutdown_routine(infiniband_shutdown);
8738 /* Reg Handoff. Register dissectors we'll need for IPoIB and RoCE */
8739 void proto_reg_handoff_infiniband(void)
8741 static gboolean initialized = FALSE;
8742 static guint prev_rroce_udp_port;
8743 dissector_handle_t roce_handle, rroce_handle;
8744 int proto_ethertype;
8746 ipv6_handle = find_dissector_add_dependency("ipv6", proto_infiniband);
8749 * I haven't found an official spec for EoIB, but slide 10
8752 * http://downloads.openfabrics.org/Media/Sonoma2009/Sonoma_2009_Tues_converged-net-bridging.pdf
8754 * shows the "Eth Payload" following the "Eth Header" and optional
8755 * "Vlan tag", and doesn't show an FCS; "Payload" generally
8756 * refers to the data transported by the protocol, which wouldn't
8759 * In addition, the capture attached to bug 5061 includes no
8762 * So we assume the Ethernet frames carried by EoIB don't include
8765 eth_handle = find_dissector("eth_withoutfcs");
8766 ethertype_dissector_table = find_dissector_table("ethertype");
8768 /* announce an anonymous Infiniband dissector */
8769 dissector_add_uint("erf.types.type", ERF_TYPE_INFINIBAND, ib_handle);
8771 /* announce an anonymous Infiniband dissector */
8772 dissector_add_uint("erf.types.type", ERF_TYPE_INFINIBAND_LINK, ib_link_handle);
8774 /* create and announce an anonymous RoCE dissector */
8775 roce_handle = create_dissector_handle(dissect_roce, proto_infiniband);
8776 dissector_add_uint("ethertype", ETHERTYPE_ROCE, roce_handle);
8778 /* create and announce an anonymous RRoCE dissector */
8779 rroce_handle = create_dissector_handle(dissect_rroce, proto_infiniband);
8786 dissector_delete_uint("udp.port", prev_rroce_udp_port, rroce_handle);
8788 /* We are saving the previous value of rroce udp port so we will be able to remove the dissector
8789 * the next time user pref is updated and we get called back to proto_reg_handoff_infiniband.
8790 * "Auto" preference not used because port isn't for the Infiniband protocol itself.
8792 prev_rroce_udp_port = pref_rroce_udp_port;
8793 dissector_add_uint("udp.port", pref_rroce_udp_port, rroce_handle);
8795 /* RROCE over IPv4 isn't standardized but it's been seen in the wild */
8796 dissector_add_for_decode_as("ip.proto", rroce_handle);
8798 dissector_add_uint("wtap_encap", WTAP_ENCAP_INFINIBAND, ib_handle);
8799 heur_dissector_add("infiniband.payload", dissect_mellanox_eoib, "Mellanox EoIB", "mellanox_eoib", proto_mellanox_eoib, HEURISTIC_ENABLE);
8801 /* This could be put in the ethernet dissector file, but since there are a few Infiniband fields in the encapsulation,
8802 keep the dissector here, but associate it with ethernet */
8803 proto_ethertype = proto_get_id_by_filter_name( "ethertype" );
8804 heur_dissector_add("infiniband.payload", dissect_eth_over_ib, "Ethernet over IB", "eth_over_ib", proto_ethertype, HEURISTIC_ENABLE);
8808 * Editor modelines - https://www.wireshark.org/tools/modelines.html
8813 * indent-tabs-mode: nil
8816 * vi: set shiftwidth=4 tabstop=8 expandtab:
8817 * :indentSize=4:tabSize=8:noTabs=true: