Wireshark 4.5.0
The Wireshark network protocol analyzer
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
packet-infiniband.h
1/* packet-infiniband.h
2 * Routines for Infiniband/ERF Dissection
3 * Copyright 2008 Endace Technology Limited
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * Modified 2010 by Mellanox Technologies Ltd.
10 *
11 * SPDX-License-Identifier: GPL-2.0-or-later
12 */
13#ifndef __PACKET_INFINIBAND_H_
14#define __PACKET_INFINIBAND_H_
15
16#define MAD_DATA_SIZE 232 /* size of data field a MAD payload carries */
17#define GID_SIZE 16 /* size of GID = 128bit (same as IPv6) */
18
19/* infiniband-specific information for conversations */
20typedef struct {
21 uint64_t service_id; /* service id specified when the (RC) channel was set-up */
22 bool client_to_server; /* message direction */
23 bool do_rc_send_reassembling; /* the subdissector requested RC Send reassembling */
24 uint32_t src_qp; /* originator src qp as this is not present in RC packets */
25
26 /* store mad data so that it can be parsed for private data by ULP */
27 uint8_t mad_private_data[MAD_DATA_SIZE];
29
30/* OpCodeValues
31* Code Bits [7-5] Connection Type
32* [4-0] Message Type
33
34* Reliable Connection (RC)
35* [7-5] = 000 */
36#define RC_SEND_FIRST 0 /*0b00000000 */
37#define RC_SEND_MIDDLE 1 /*0b00000001 */
38#define RC_SEND_LAST 2 /*0b00000010 */
39#define RC_SEND_LAST_IMM 3 /*0b00000011 */
40#define RC_SEND_ONLY 4 /*0b00000100 */
41#define RC_SEND_ONLY_IMM 5 /*0b00000101 */
42#define RC_RDMA_WRITE_FIRST 6 /*0b00000110 */
43#define RC_RDMA_WRITE_MIDDLE 7 /*0b00000111 */
44#define RC_RDMA_WRITE_LAST 8 /*0b00001000 */
45#define RC_RDMA_WRITE_LAST_IMM 9 /*0b00001001 */
46#define RC_RDMA_WRITE_ONLY 10 /*0b00001010 */
47#define RC_RDMA_WRITE_ONLY_IMM 11 /*0b00001011 */
48#define RC_RDMA_READ_REQUEST 12 /*0b00001100 */
49#define RC_RDMA_READ_RESPONSE_FIRST 13 /*0b00001101 */
50#define RC_RDMA_READ_RESPONSE_MIDDLE 14 /*0b00001110 */
51#define RC_RDMA_READ_RESPONSE_LAST 15 /*0b00001111 */
52#define RC_RDMA_READ_RESPONSE_ONLY 16 /*0b00010000 */
53#define RC_ACKNOWLEDGE 17 /*0b00010001 */
54#define RC_ATOMIC_ACKNOWLEDGE 18 /*0b00010010 */
55#define RC_CMP_SWAP 19 /*0b00010011 */
56#define RC_FETCH_ADD 20 /*0b00010100 */
57#define RC_SEND_LAST_INVAL 22 /*0b00010110 */
58#define RC_SEND_ONLY_INVAL 23 /*0b00010111 */
59#define RC_FLUSH 28 /*0b00011100 */
60#define RC_ATOMIC_WRITE 29 /*0b00011101 */
61
62/* Reliable Datagram (RD)
63* [7-5] = 010 */
64#define RD_SEND_FIRST 64 /*0b01000000 */
65#define RD_SEND_MIDDLE 65 /*0b01000001 */
66#define RD_SEND_LAST 66 /*0b01000010 */
67#define RD_SEND_LAST_IMM 67 /*0b01000011 */
68#define RD_SEND_ONLY 68 /*0b01000100 */
69#define RD_SEND_ONLY_IMM 69 /*0b01000101 */
70#define RD_RDMA_WRITE_FIRST 70 /*0b01000110 */
71#define RD_RDMA_WRITE_MIDDLE 71 /*0b01000111 */
72#define RD_RDMA_WRITE_LAST 72 /*0b01001000 */
73#define RD_RDMA_WRITE_LAST_IMM 73 /*0b01001001 */
74#define RD_RDMA_WRITE_ONLY 74 /*0b01001010 */
75#define RD_RDMA_WRITE_ONLY_IMM 75 /*0b01001011 */
76#define RD_RDMA_READ_REQUEST 76 /*0b01001100 */
77#define RD_RDMA_READ_RESPONSE_FIRST 77 /*0b01001101 */
78#define RD_RDMA_READ_RESPONSE_MIDDLE 78 /*0b01001110 */
79#define RD_RDMA_READ_RESPONSE_LAST 79 /*0b01001111 */
80#define RD_RDMA_READ_RESPONSE_ONLY 80 /*0b01010000 */
81#define RD_ACKNOWLEDGE 81 /*0b01010001 */
82#define RD_ATOMIC_ACKNOWLEDGE 82 /*0b01010010 */
83#define RD_CMP_SWAP 83 /*0b01010011 */
84#define RD_FETCH_ADD 84 /*0b01010100 */
85#define RD_RESYNC 85 /*0b01010101 */
86#define RD_FLUSH 92 /*0b01011100 */
87#define RD_ATOMIC_WRITE 93 /*0b01011101 */
88
89/* Unreliable Datagram (UD)
90* [7-5] = 011 */
91#define UD_SEND_ONLY 100 /*0b01100100 */
92#define UD_SEND_ONLY_IMM 101 /*0b01100101 */
93
94/* Unreliable Connection (UC)
95* [7-5] = 001 */
96#define UC_SEND_FIRST 32 /*0b00100000 */
97#define UC_SEND_MIDDLE 33 /*0b00100001 */
98#define UC_SEND_LAST 34 /*0b00100010 */
99#define UC_SEND_LAST_IMM 35 /*0b00100011 */
100#define UC_SEND_ONLY 36 /*0b00100100 */
101#define UC_SEND_ONLY_IMM 37 /*0b00100101 */
102#define UC_RDMA_WRITE_FIRST 38 /*0b00100110 */
103#define UC_RDMA_WRITE_MIDDLE 39 /*0b00100111 */
104#define UC_RDMA_WRITE_LAST 40 /*0b00101000 */
105#define UC_RDMA_WRITE_LAST_IMM 41 /*0b00101001 */
106#define UC_RDMA_WRITE_ONLY 42 /*0b00101010 */
107#define UC_RDMA_WRITE_ONLY_IMM 43 /*0b00101011 */
108
109/* ComMgt class Attributes */
110#define ATTR_CM_REQ 0x0010
111#define ATTR_CM_REJ 0x0012
112#define ATTR_CM_REP 0x0013
113#define ATTR_CM_RTU 0x0014
114#define ATTR_CM_DREQ 0x0015
115#define ATTR_CM_DRSP 0x0016
116
117/*
118 * Private data passed from the infiniband dissector to payload subdissectors.
119 */
121 proto_tree* payload_tree;
122 uint8_t opCode; /* OpCode from BTH header. */
123 uint8_t pad_count; /* PadCount from BTH header. */
124 uint16_t cm_attribute_id; /* attribute id for CM messages */
125 uint32_t reth_remote_key; /* Remote Key from RETH header */
126 uint64_t reth_remote_address;/* Remote address from RETH header */
127 uint32_t reth_dma_length; /* DMA Length from RETH header */
128 uint32_t packet_seq_num; /* Packet sequence number */
129 bool dctConnect; /* indicator for DCT connect/disconnect */
130 bool do_rc_send_reassembling; /* the subdissector can set this to request RC Send reassembling */
131};
132
133#endif
134
135/*
136 * Editor modelines - https://www.wireshark.org/tools/modelines.html
137 *
138 * Local variables:
139 * c-basic-offset: 4
140 * tab-width: 8
141 * indent-tabs-mode: nil
142 * End:
143 *
144 * vi: set shiftwidth=4 tabstop=8 expandtab:
145 * :indentSize=4:tabSize=8:noTabs=true:
146 */
Definition proto.h:906
Definition packet-infiniband.h:20
Definition packet-infiniband.h:120