Wireshark  4.3.0
The Wireshark network protocol analyzer
packet-sctp.h
1 /* packet-sctp.h
2  *
3  * Definition of SCTP specific structures used by tap listeners.
4  *
5  * Copyright 2004 Michael Tuexen <tuexen [AT] fh-muenster.de>
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * SPDX-License-Identifier: GPL-2.0-or-later
12  */
13 
14 #ifndef __PACKET_SCTP_H__
15 #define __PACKET_SCTP_H__
16 
17 #include "ws_symbol_export.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif /* __cplusplus */
22 
23 #define MAXIMUM_NUMBER_OF_TVBS 2048
24 
25 struct _sctp_info {
26  gboolean incomplete;
27  gboolean adler32_calculated;
28  gboolean adler32_correct;
29  gboolean crc32c_calculated;
30  gboolean crc32c_correct;
31  gboolean checksum_zero;
32  gboolean vtag_reflected;
33  guint16 sport;
34  guint16 dport;
35  address ip_src;
36  address ip_dst;
37  guint32 verification_tag;
38  guint16 assoc_index;
39  guint16 direction;
40  guint32 number_of_tvbs;
41  tvbuff_t *tvb[MAXIMUM_NUMBER_OF_TVBS];
42 };
43 
44 typedef struct _sctp_fragment {
45  guint32 frame_num;
46  guint32 tsn;
47  guint32 len;
48  guint32 ppi;
49  unsigned char *data;
50  struct _sctp_fragment *next;
52 
53 typedef struct _sctp_frag_be {
54  sctp_fragment* fragment;
55  struct _sctp_frag_be *next;
56 } sctp_frag_be;
57 
58 typedef struct _sctp_complete_msg {
59  guint32 begin;
60  guint32 end;
61  sctp_fragment* reassembled_in;
62  guint32 len;
63  unsigned char *data;
64  struct _sctp_complete_msg *next;
66 
67 typedef struct _sctp_frag_msg {
68  sctp_frag_be* begins;
69  sctp_frag_be* ends;
70  sctp_fragment* fragments;
71  sctp_complete_msg* messages;
72  guint32 ppi;
73  struct _sctp_frag_msg* next;
75 
76 #define SCTP_DATA_CHUNK_ID 0
77 #define SCTP_INIT_CHUNK_ID 1
78 #define SCTP_INIT_ACK_CHUNK_ID 2
79 #define SCTP_SACK_CHUNK_ID 3
80 #define SCTP_HEARTBEAT_CHUNK_ID 4
81 #define SCTP_HEARTBEAT_ACK_CHUNK_ID 5
82 #define SCTP_ABORT_CHUNK_ID 6
83 #define SCTP_SHUTDOWN_CHUNK_ID 7
84 #define SCTP_SHUTDOWN_ACK_CHUNK_ID 8
85 #define SCTP_ERROR_CHUNK_ID 9
86 #define SCTP_COOKIE_ECHO_CHUNK_ID 10
87 #define SCTP_COOKIE_ACK_CHUNK_ID 11
88 #define SCTP_ECNE_CHUNK_ID 12
89 #define SCTP_CWR_CHUNK_ID 13
90 #define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14
91 #define SCTP_AUTH_CHUNK_ID 15
92 #define SCTP_NR_SACK_CHUNK_ID 16
93 #define SCTP_I_DATA_CHUNK_ID 0x40
94 #define SCTP_ASCONF_ACK_CHUNK_ID 0x80
95 #define SCTP_PKTDROP_CHUNK_ID 0x81
96 #define SCTP_RE_CONFIG_CHUNK_ID 0x82
97 #define SCTP_PAD_CHUNK_ID 0x84
98 #define SCTP_FORWARD_TSN_CHUNK_ID 0xC0
99 #define SCTP_ASCONF_CHUNK_ID 0xC1
100 #define SCTP_I_FORWARD_TSN_CHUNK_ID 0xC2
101 #define SCTP_IETF_EXT 0xFF
102 
103 #define IS_SCTP_CHUNK_TYPE(t) \
104  (((t) <= SCTP_NR_SACK_CHUNK_ID) || \
105  ((t) == SCTP_I_DATA_CHUNK_ID) || \
106  ((t) == SCTP_FORWARD_TSN_CHUNK_ID) || \
107  ((t) == SCTP_ASCONF_CHUNK_ID) || \
108  ((t) == SCTP_ASCONF_ACK_CHUNK_ID) || \
109  ((t) == SCTP_PKTDROP_CHUNK_ID))
110 
111 WS_DLL_PUBLIC const value_string chunk_type_values[];
112 
113 #ifdef __cplusplus
114 }
115 #endif /* __cplusplus */
116 
117 #endif
118 
119 /*
120  * Editor modelines - https://www.wireshark.org/tools/modelines.html
121  *
122  * Local Variables:
123  * c-basic-offset: 2
124  * tab-width: 8
125  * indent-tabs-mode: nil
126  * End:
127  *
128  * vi: set shiftwidth=2 tabstop=8 expandtab:
129  * :indentSize=2:tabSize=8:noTabs=true:
130  */
Definition: address.h:56
Definition: packet-sctp.h:58
Definition: packet-sctp.h:53
Definition: packet-sctp.h:67
Definition: packet-sctp.h:44
Definition: packet-sctp.h:25
Definition: value_string.h:26
Definition: tvbuff-int.h:35