diff options
-rw-r--r-- | epan/dissectors/packet-sctp.c | 28 | ||||
-rw-r--r-- | epan/dissectors/packet-sctp.h | 36 | ||||
-rw-r--r-- | ui/cli/tap-sctpchunkstat.c | 23 | ||||
-rw-r--r-- | ui/tap-sctp-analysis.h | 57 |
4 files changed, 37 insertions, 107 deletions
diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index 0865992815..d2cb782700 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -311,33 +311,7 @@ static expert_field ei_sctp_sack_chunk_number_tsns_gap_acked_100 = EI_INIT; static dissector_handle_t data_handle; -#define SCTP_DATA_CHUNK_ID 0 -#define SCTP_INIT_CHUNK_ID 1 -#define SCTP_INIT_ACK_CHUNK_ID 2 -#define SCTP_SACK_CHUNK_ID 3 -#define SCTP_HEARTBEAT_CHUNK_ID 4 -#define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 -#define SCTP_ABORT_CHUNK_ID 6 -#define SCTP_SHUTDOWN_CHUNK_ID 7 -#define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 -#define SCTP_ERROR_CHUNK_ID 9 -#define SCTP_COOKIE_ECHO_CHUNK_ID 10 -#define SCTP_COOKIE_ACK_CHUNK_ID 11 -#define SCTP_ECNE_CHUNK_ID 12 -#define SCTP_CWR_CHUNK_ID 13 -#define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 -#define SCTP_AUTH_CHUNK_ID 15 -#define SCTP_NR_SACK_CHUNK_ID 16 -#define SCTP_I_DATA_CHUNK_ID 0x40 -#define SCTP_ASCONF_ACK_CHUNK_ID 0x80 -#define SCTP_PKTDROP_CHUNK_ID 0x81 -#define SCTP_RE_CONFIG_CHUNK_ID 0x82 -#define SCTP_PAD_CHUNK_ID 0x84 -#define SCTP_FORWARD_TSN_CHUNK_ID 0xC0 -#define SCTP_ASCONF_CHUNK_ID 0xC1 -#define SCTP_IETF_EXT 0xFF - -static const value_string chunk_type_values[] = { +WS_DLL_PUBLIC_DEF const value_string chunk_type_values[] = { { SCTP_DATA_CHUNK_ID, "DATA" }, { SCTP_INIT_CHUNK_ID, "INIT" }, { SCTP_INIT_ACK_CHUNK_ID, "INIT_ACK" }, diff --git a/epan/dissectors/packet-sctp.h b/epan/dissectors/packet-sctp.h index 8b2022e075..f1a86befaa 100644 --- a/epan/dissectors/packet-sctp.h +++ b/epan/dissectors/packet-sctp.h @@ -79,6 +79,42 @@ typedef struct _sctp_frag_msg { struct _sctp_frag_msg* next; } sctp_frag_msg; +#define SCTP_DATA_CHUNK_ID 0 +#define SCTP_INIT_CHUNK_ID 1 +#define SCTP_INIT_ACK_CHUNK_ID 2 +#define SCTP_SACK_CHUNK_ID 3 +#define SCTP_HEARTBEAT_CHUNK_ID 4 +#define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 +#define SCTP_ABORT_CHUNK_ID 6 +#define SCTP_SHUTDOWN_CHUNK_ID 7 +#define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 +#define SCTP_ERROR_CHUNK_ID 9 +#define SCTP_COOKIE_ECHO_CHUNK_ID 10 +#define SCTP_COOKIE_ACK_CHUNK_ID 11 +#define SCTP_ECNE_CHUNK_ID 12 +#define SCTP_CWR_CHUNK_ID 13 +#define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 +#define SCTP_AUTH_CHUNK_ID 15 +#define SCTP_NR_SACK_CHUNK_ID 16 +#define SCTP_I_DATA_CHUNK_ID 0x40 +#define SCTP_ASCONF_ACK_CHUNK_ID 0x80 +#define SCTP_PKTDROP_CHUNK_ID 0x81 +#define SCTP_RE_CONFIG_CHUNK_ID 0x82 +#define SCTP_PAD_CHUNK_ID 0x84 +#define SCTP_FORWARD_TSN_CHUNK_ID 0xC0 +#define SCTP_ASCONF_CHUNK_ID 0xC1 +#define SCTP_IETF_EXT 0xFF + +#define IS_SCTP_CHUNK_TYPE(t) \ + (((t) <= SCTP_NR_SACK_CHUNK_ID) || \ + ((t) == SCTP_I_DATA_CHUNK_ID) || \ + ((t) == SCTP_FORWARD_TSN_CHUNK_ID) || \ + ((t) == SCTP_ASCONF_CHUNK_ID) || \ + ((t) == SCTP_ASCONF_ACK_CHUNK_ID) || \ + ((t) == SCTP_PKTDROP_CHUNK_ID)) + +WS_DLL_PUBLIC const value_string chunk_type_values[]; + #endif /* diff --git a/ui/cli/tap-sctpchunkstat.c b/ui/cli/tap-sctpchunkstat.c index 9de9decdf8..2fe6dc03ff 100644 --- a/ui/cli/tap-sctpchunkstat.c +++ b/ui/cli/tap-sctpchunkstat.c @@ -53,29 +53,6 @@ typedef struct _sctpstat_t { sctp_ep_t *ep_list; } sctpstat_t; - -#define SCTP_DATA_CHUNK_ID 0 -#define SCTP_INIT_CHUNK_ID 1 -#define SCTP_INIT_ACK_CHUNK_ID 2 -#define SCTP_SACK_CHUNK_ID 3 -#define SCTP_HEARTBEAT_CHUNK_ID 4 -#define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 -#define SCTP_ABORT_CHUNK_ID 6 -#define SCTP_SHUTDOWN_CHUNK_ID 7 -#define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 -#define SCTP_ERROR_CHUNK_ID 9 -#define SCTP_COOKIE_ECHO_CHUNK_ID 10 -#define SCTP_COOKIE_ACK_CHUNK_ID 11 -#define SCTP_ECNE_CHUNK_ID 12 -#define SCTP_CWR_CHUNK_ID 13 -#define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 -#define SCTP_AUTH_CHUNK_ID 0x16 -#define SCTP_ASCONF_ACK_CHUNK_ID 0x80 -#define SCTP_PKTDROP_CHUNK_ID 0x81 -#define SCTP_FORWARD_TSN_CHUNK_ID 0xC0 -#define SCTP_ASCONF_CHUNK_ID 0xC1 -#define SCTP_IETF_EXT 0xFF - #define CHUNK_TYPE_OFFSET 0 #define CHUNK_TYPE(x)(tvb_get_guint8((x), CHUNK_TYPE_OFFSET)) diff --git a/ui/tap-sctp-analysis.h b/ui/tap-sctp-analysis.h index 18f0b86886..a330d0fee0 100644 --- a/ui/tap-sctp-analysis.h +++ b/ui/tap-sctp-analysis.h @@ -39,35 +39,6 @@ extern "C" { #endif #endif -#define SCTP_DATA_CHUNK_ID 0 -#define SCTP_INIT_CHUNK_ID 1 -#define SCTP_INIT_ACK_CHUNK_ID 2 -#define SCTP_SACK_CHUNK_ID 3 -#define SCTP_HEARTBEAT_CHUNK_ID 4 -#define SCTP_HEARTBEAT_ACK_CHUNK_ID 5 -#define SCTP_ABORT_CHUNK_ID 6 -#define SCTP_SHUTDOWN_CHUNK_ID 7 -#define SCTP_SHUTDOWN_ACK_CHUNK_ID 8 -#define SCTP_ERROR_CHUNK_ID 9 -#define SCTP_COOKIE_ECHO_CHUNK_ID 10 -#define SCTP_COOKIE_ACK_CHUNK_ID 11 -#define SCTP_ECNE_CHUNK_ID 12 -#define SCTP_CWR_CHUNK_ID 13 -#define SCTP_SHUTDOWN_COMPLETE_CHUNK_ID 14 -#define SCTP_AUTH_CHUNK_ID 15 -#define SCTP_NR_SACK_CHUNK_ID 16 -#define SCTP_I_DATA_CHUNK_ID 0x40 -#define SCTP_ASCONF_ACK_CHUNK_ID 0x80 -#define SCTP_PKTDROP_CHUNK_ID 0x81 -#define SCTP_RE_CONFIG_CHUNK_ID 0x82 -#define SCTP_PAD_CHUNK_ID 0x84 -#define SCTP_FORWARD_TSN_CHUNK_ID 0xC0 -#define SCTP_ASCONF_CHUNK_ID 0xC1 -#define SCTP_IETF_EXT 0xFF - -#define IS_SCTP_CHUNK_TYPE(t) \ - (((t) <= 16) || ((t) == 0x40) || ((t) == 0xC0) || ((t) == 0xC1) || ((t) == 0x80) || ((t) == 0x81)) - #define CHUNK_TYPE_LENGTH 1 #define CHUNK_FLAGS_LENGTH 1 #define CHUNK_LENGTH_LENGTH 2 @@ -163,34 +134,6 @@ extern "C" { #define INIT_CHUNK_VARIABLE_LENGTH_PARAMETER_OFFSET (INIT_CHUNK_INITIAL_TSN_OFFSET + \ INIT_CHUNK_INITIAL_TSN_LENGTH ) -static const value_string chunk_type_values[] = { - { SCTP_DATA_CHUNK_ID, "DATA" }, - { SCTP_INIT_CHUNK_ID, "INIT" }, - { SCTP_INIT_ACK_CHUNK_ID, "INIT_ACK" }, - { SCTP_SACK_CHUNK_ID, "SACK" }, - { SCTP_HEARTBEAT_CHUNK_ID, "HEARTBEAT" }, - { SCTP_HEARTBEAT_ACK_CHUNK_ID, "HEARTBEAT_ACK" }, - { SCTP_ABORT_CHUNK_ID, "ABORT" }, - { SCTP_SHUTDOWN_CHUNK_ID, "SHUTDOWN" }, - { SCTP_SHUTDOWN_ACK_CHUNK_ID, "SHUTDOWN_ACK" }, - { SCTP_ERROR_CHUNK_ID, "ERROR" }, - { SCTP_COOKIE_ECHO_CHUNK_ID, "COOKIE_ECHO" }, - { SCTP_COOKIE_ACK_CHUNK_ID, "COOKIE_ACK" }, - { SCTP_ECNE_CHUNK_ID, "ECNE" }, - { SCTP_CWR_CHUNK_ID, "CWR" }, - { SCTP_SHUTDOWN_COMPLETE_CHUNK_ID, "SHUTDOWN_COMPLETE" }, - { SCTP_AUTH_CHUNK_ID, "AUTH" }, - { SCTP_NR_SACK_CHUNK_ID, "NR_SACK" }, - { SCTP_I_DATA_CHUNK_ID, "I_DATA" }, - { SCTP_ASCONF_ACK_CHUNK_ID, "ASCONF_ACK" }, - { SCTP_PKTDROP_CHUNK_ID, "PKTDROP" }, - { SCTP_RE_CONFIG_CHUNK_ID, "RE_CONFIG" }, - { SCTP_PAD_CHUNK_ID, "PAD" }, - { SCTP_FORWARD_TSN_CHUNK_ID, "FORWARD_TSN" }, - { SCTP_ASCONF_CHUNK_ID, "ASCONF" }, - { SCTP_IETF_EXT, "IETF_EXTENSION" }, - { 0, NULL } }; - /* The below value is 255 */ #define NUM_CHUNKS 0x100 |