diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:14:33 +0000 |
commit | 9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9 (patch) | |
tree | 2784370cda9bbf2da9114d70f05399c0b229d28c /plugins/epan/transum | |
parent | Adding debian version 4.2.6-1. (diff) | |
download | wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.tar.xz wireshark-9f153fbfec0fb9c9ce38e749a7c6f4a5e115d4e9.zip |
Merging upstream version 4.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugins/epan/transum')
-rw-r--r-- | plugins/epan/transum/decoders.c | 72 | ||||
-rw-r--r-- | plugins/epan/transum/extractors.c | 14 | ||||
-rw-r--r-- | plugins/epan/transum/extractors.h | 8 | ||||
-rw-r--r-- | plugins/epan/transum/packet-transum.c | 116 | ||||
-rw-r--r-- | plugins/epan/transum/packet-transum.h | 82 | ||||
-rw-r--r-- | plugins/epan/transum/preferences.h | 20 |
6 files changed, 153 insertions, 159 deletions
diff --git a/plugins/epan/transum/decoders.c b/plugins/epan/transum/decoders.c index c430f588..a67db053 100644 --- a/plugins/epan/transum/decoders.c +++ b/plugins/epan/transum/decoders.c @@ -28,18 +28,18 @@ extern TSUM_PREFERENCES preferences; int decode_syn(packet_info *pinfo _U_, proto_tree *tree _U_, PKT_INFO* pkt_info) { if (pkt_info->tcp_flags_ack) - pkt_info->rrpd.c2s = FALSE; + pkt_info->rrpd.c2s = false; else { - pkt_info->rrpd.c2s = TRUE; + pkt_info->rrpd.c2s = true; add_detected_tcp_svc(pkt_info->dstport); } pkt_info->rrpd.session_id = 1; /* Fake session ID */ pkt_info->rrpd.msg_id = 1; /* Fake message ID */ - pkt_info->rrpd.decode_based = TRUE; + pkt_info->rrpd.decode_based = true; pkt_info->rrpd.calculation = RTE_CALC_SYN; - pkt_info->pkt_of_interest = TRUE; + pkt_info->pkt_of_interest = true; return 1; } @@ -53,9 +53,9 @@ int decode_syn(packet_info *pinfo _U_, proto_tree *tree _U_, PKT_INFO* pkt_info) */ int decode_dcerpc(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info) { - guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + uint32_t field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ size_t field_value_count; /* How many entries are there in the extracted field array */ - guint32 dcerpc_cn_ctx_id = 0; + uint32_t dcerpc_cn_ctx_id = 0; if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_VER].hf, field_uint, &field_value_count)) { @@ -109,18 +109,18 @@ int decode_dcerpc(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info) if (is_dcerpc_req_pkt_type(pkt_info->dcerpc_pkt_type)) { - pkt_info->rrpd.c2s = TRUE; + pkt_info->rrpd.c2s = true; wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport), GUINT_TO_POINTER(RTE_CALC_DCERPC)); /* make sure we have this DCE-RPC service port set */ } else { - pkt_info->rrpd.c2s = FALSE; + pkt_info->rrpd.c2s = false; wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->srcport), GUINT_TO_POINTER(RTE_CALC_DCERPC)); /* make sure we have this DCE-RPC service port set */ } - pkt_info->rrpd.decode_based = TRUE; + pkt_info->rrpd.decode_based = true; pkt_info->rrpd.calculation = RTE_CALC_DCERPC; - pkt_info->pkt_of_interest = TRUE; + pkt_info->pkt_of_interest = true; return 1; } @@ -128,35 +128,35 @@ int decode_dcerpc(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info) /* Returns the number of sub-packets of interest */ int decode_smb(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info, PKT_INFO* subpackets) { - guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + uint32_t field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ size_t field_value_count; /* How many entries are there in the extracted field array */ - guint64 ses_id[MAX_RETURNED_ELEMENTS]; + uint64_t ses_id[MAX_RETURNED_ELEMENTS]; size_t ses_id_count; - guint64 msg_id[MAX_RETURNED_ELEMENTS]; + uint64_t msg_id[MAX_RETURNED_ELEMENTS]; size_t msg_id_count; /* set the direction information */ if (pkt_info->dstport == 445) - pkt_info->rrpd.c2s = TRUE; + pkt_info->rrpd.c2s = true; else - pkt_info->rrpd.c2s = FALSE; + pkt_info->rrpd.c2s = false; if (!extract_uint(tree, hf_of_interest[HF_INTEREST_SMB_MID].hf, field_uint, &field_value_count)) { if (field_value_count) { pkt_info->rrpd.calculation = RTE_CALC_SMB1; - pkt_info->pkt_of_interest = FALSE; /* can't process SMB1 at the moment */ + pkt_info->pkt_of_interest = false; /* can't process SMB1 at the moment */ return 0; } } /* Default in case we don't have header information */ pkt_info->rrpd.session_id = 0; pkt_info->rrpd.msg_id = 0; - pkt_info->rrpd.decode_based = TRUE; + pkt_info->rrpd.decode_based = true; pkt_info->rrpd.calculation = RTE_CALC_SMB2; - pkt_info->pkt_of_interest = TRUE; + pkt_info->pkt_of_interest = true; extract_ui64(tree, hf_of_interest[HF_INTEREST_SMB2_MSG_ID].hf, msg_id, &msg_id_count); if (msg_id_count) /* test for header information */ @@ -172,9 +172,9 @@ int decode_smb(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info, PKT subpackets[i].rrpd.session_id = ses_id[i]; subpackets[i].rrpd.msg_id = msg_id[i]; - subpackets[i].rrpd.decode_based = TRUE; + subpackets[i].rrpd.decode_based = true; subpackets[i].rrpd.calculation = RTE_CALC_SMB2; - subpackets[i].pkt_of_interest = TRUE; + subpackets[i].pkt_of_interest = true; } return (int)msg_id_count; } @@ -185,8 +185,8 @@ int decode_smb(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info, PKT /* Returns the number of sub-packets of interest */ int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) { - guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ - gboolean field_bool[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + uint32_t field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + bool field_bool[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ size_t field_value_count; /* How many entries are there in the extracted field array */ if (!extract_uint(tree, hf_of_interest[HF_INTEREST_TCP_STREAM].hf, field_uint, &field_value_count)) { @@ -223,9 +223,9 @@ int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) */ if (!extract_instance_count(tree, hf_of_interest[HF_INTEREST_TCP_RETRAN].hf, &field_value_count)) { if (field_value_count) - pkt_info->tcp_retran = TRUE; + pkt_info->tcp_retran = true; else - pkt_info->tcp_retran = FALSE; + pkt_info->tcp_retran = false; } /* @@ -233,9 +233,9 @@ int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) */ if (!extract_instance_count(tree, hf_of_interest[HF_INTEREST_TCP_KEEP_ALIVE].hf, &field_value_count)) { if (field_value_count) - pkt_info->tcp_retran = TRUE; + pkt_info->tcp_retran = true; else - pkt_info->tcp_retran = FALSE; + pkt_info->tcp_retran = false; } /* we use the SSL Content Type to detect SSL Alerts */ @@ -251,15 +251,15 @@ int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) wmem_map_lookup(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->srcport)) != NULL) { if (wmem_map_lookup(preferences.tcp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport)) != NULL) - pkt_info->rrpd.c2s = TRUE; + pkt_info->rrpd.c2s = true; pkt_info->rrpd.is_retrans = pkt_info->tcp_retran; pkt_info->rrpd.session_id = 0; pkt_info->rrpd.msg_id = 0; pkt_info->rrpd.calculation = RTE_CALC_GTCP; - pkt_info->rrpd.decode_based = FALSE; + pkt_info->rrpd.decode_based = false; if (pkt_info->len > 0) - pkt_info->pkt_of_interest = TRUE; + pkt_info->pkt_of_interest = true; return 1; } @@ -270,7 +270,7 @@ int decode_gtcp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) /* Returns the number of sub-packets of interest */ int decode_dns(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info) { - guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + uint32_t field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ size_t field_value_count; /* How many entries are there in the extracted field array */ if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DNS_ID].hf, field_uint, &field_value_count)) { @@ -279,9 +279,9 @@ int decode_dns(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info) } pkt_info->rrpd.session_id = 1; - pkt_info->rrpd.decode_based = TRUE; + pkt_info->rrpd.decode_based = true; pkt_info->rrpd.calculation = RTE_CALC_DNS; - pkt_info->pkt_of_interest = TRUE; + pkt_info->pkt_of_interest = true; return 1; } @@ -289,7 +289,7 @@ int decode_dns(packet_info *pinfo _U_, proto_tree *tree, PKT_INFO* pkt_info) /* Returns the number of sub-packets of interest */ int decode_gudp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) { - guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + uint32_t field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ size_t field_value_count; /* How many entries are there in the extracted field array */ pkt_info->srcport = pinfo->srcport; @@ -309,13 +309,13 @@ int decode_gudp(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info) (wmem_map_lookup(preferences.udp_svc_ports, GUINT_TO_POINTER(pkt_info->srcport)) != NULL)) { if (wmem_map_lookup(preferences.udp_svc_ports, GUINT_TO_POINTER(pkt_info->dstport)) != NULL) - pkt_info->rrpd.c2s = TRUE; + pkt_info->rrpd.c2s = true; pkt_info->rrpd.session_id = 0; pkt_info->rrpd.msg_id = 0; - pkt_info->rrpd.decode_based = FALSE; + pkt_info->rrpd.decode_based = false; pkt_info->rrpd.calculation = RTE_CALC_GUDP; - pkt_info->pkt_of_interest = TRUE; + pkt_info->pkt_of_interest = true; } return 1; diff --git a/plugins/epan/transum/extractors.c b/plugins/epan/transum/extractors.c index 80475ae3..92c3a144 100644 --- a/plugins/epan/transum/extractors.c +++ b/plugins/epan/transum/extractors.c @@ -11,7 +11,7 @@ */ #include "config.h" #include <epan/prefs.h> -#include <epan/packet.h> +#include <wsutil/array.h> #include "extractors.h" /* @@ -22,7 +22,7 @@ Return is 0 if all went well. If this function return -1 it is probably because the tree did not include the field defined by the field_id. */ -int extract_uint(proto_tree *tree, int field_id, guint32 *result_array, size_t *element_count) +int extract_uint(proto_tree *tree, int field_id, uint32_t *result_array, size_t *element_count) { GPtrArray *finfo_array; @@ -47,7 +47,7 @@ int extract_uint(proto_tree *tree, int field_id, guint32 *result_array, size_t * return 0; } -int extract_ui64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count) +int extract_ui64(proto_tree *tree, int field_id, uint64_t *result_array, size_t *element_count) { GPtrArray *finfo_array; @@ -72,7 +72,7 @@ int extract_ui64(proto_tree *tree, int field_id, guint64 *result_array, size_t * return 0; } -int extract_si64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count) +int extract_si64(proto_tree *tree, int field_id, uint64_t *result_array, size_t *element_count) { GPtrArray *finfo_array; @@ -97,7 +97,7 @@ int extract_si64(proto_tree *tree, int field_id, guint64 *result_array, size_t * return 0; } -int extract_bool(proto_tree *tree, int field_id, gboolean *result_array, size_t *element_count) +int extract_bool(proto_tree *tree, int field_id, bool *result_array, size_t *element_count) { GPtrArray *finfo_array; @@ -120,9 +120,9 @@ int extract_bool(proto_tree *tree, int field_id, gboolean *result_array, size_t ws_assert(fvalue_type_ftenum(fv) == FT_BOOLEAN); if (fvalue_get_uinteger64(fv)) - result_array[i] = TRUE; + result_array[i] = true; else - result_array[i] = FALSE; + result_array[i] = false; } return 0; diff --git a/plugins/epan/transum/extractors.h b/plugins/epan/transum/extractors.h index d56134a6..c5bb5f18 100644 --- a/plugins/epan/transum/extractors.h +++ b/plugins/epan/transum/extractors.h @@ -14,8 +14,8 @@ #define MAX_RETURNED_ELEMENTS 16 -int extract_uint(proto_tree *tree, int field_id, guint32 *result_array, size_t *element_count); -int extract_ui64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count); -int extract_si64(proto_tree *tree, int field_id, guint64 *result_array, size_t *element_count); -int extract_bool(proto_tree *tree, int field_id, gboolean *result_array, size_t *element_count); +int extract_uint(proto_tree *tree, int field_id, uint32_t *result_array, size_t *element_count); +int extract_ui64(proto_tree *tree, int field_id, uint64_t *result_array, size_t *element_count); +int extract_si64(proto_tree *tree, int field_id, uint64_t *result_array, size_t *element_count); +int extract_bool(proto_tree *tree, int field_id, bool *result_array, size_t *element_count); int extract_instance_count(proto_tree *tree, int field_id, size_t *element_count); diff --git a/plugins/epan/transum/packet-transum.c b/plugins/epan/transum/packet-transum.c index 1022423a..496e5f56 100644 --- a/plugins/epan/transum/packet-transum.c +++ b/plugins/epan/transum/packet-transum.c @@ -93,10 +93,10 @@ static wmem_map_t *detected_tcp_svc; /* this array is used to track services de static wmem_map_t *dcerpc_req_pkt_type; /* used to indicate if a DCE-RPC pkt_type is a request */ -static wmem_map_t *dcerpc_streams = NULL; /* used to record TCP stream numbers that are carrying DCE-RPC data */ +static wmem_map_t *dcerpc_streams; /* used to record TCP stream numbers that are carrying DCE-RPC data */ /* -This array contains calls and returns that have no TRUE context_id +This array contains calls and returns that have no true context_id This is needed to overcome an apparent bug in Wireshark where the field name of context id in parameters is the same as context id in a message header @@ -106,7 +106,7 @@ static wmem_map_t *dcerpc_context_zero; /* The rrpd_list holds information about all of the APDU Request-Response Pairs seen in the trace. */ -static wmem_list_t *rrpd_list = NULL; +static wmem_list_t *rrpd_list; /* output_rrpd is a hash of pointers to RRPDs on the rrpd_list. The index is the frame number. This hash is @@ -122,7 +122,7 @@ static wmem_map_t *output_rrpd; TCP Reassembly enabled. Once we receive a header packet for an APDU we migrate the entry from this array to the main rrpd_list. */ -static wmem_list_t *temp_rsp_rrpd_list = NULL; /* Reuse these for speed and efficient memory use - issue a warning if we run out */ +static wmem_list_t *temp_rsp_rrpd_list; /* Reuse these for speed and efficient memory use - issue a warning if we run out */ /* Optimisation data - the following is used for various optimisation measures */ static int highest_tcp_stream_no; @@ -130,27 +130,27 @@ static int highest_udp_stream_no; wmem_map_t *tcp_stream_exceptions; -static gint ett_transum = -1; -static gint ett_transum_header = -1; -static gint ett_transum_data = -1; - -static int proto_transum = -1; - -static int hf_tsum_status = -1; -//static int hf_tsum_time_units = -1; -static int hf_tsum_req_first_seg = -1; -static int hf_tsum_req_last_seg = -1; -static int hf_tsum_rsp_first_seg = -1; -static int hf_tsum_rsp_last_seg = -1; -static int hf_tsum_apdu_rsp_time = -1; -static int hf_tsum_service_time = -1; -static int hf_tsum_req_spread = -1; -static int hf_tsum_rsp_spread = -1; -static int hf_tsum_clip_filter = -1; -static int hf_tsum_calculation = -1; -static int hf_tsum_summary = -1; -static int hf_tsum_req_search = -1; -static int hf_tsum_rsp_search = -1; +static int ett_transum; +static int ett_transum_header; +static int ett_transum_data; + +static int proto_transum; + +static int hf_tsum_status; +//static int hf_tsum_time_units; +static int hf_tsum_req_first_seg; +static int hf_tsum_req_last_seg; +static int hf_tsum_rsp_first_seg; +static int hf_tsum_rsp_last_seg; +static int hf_tsum_apdu_rsp_time; +static int hf_tsum_service_time; +static int hf_tsum_req_spread; +static int hf_tsum_rsp_spread; +static int hf_tsum_clip_filter; +static int hf_tsum_calculation; +static int hf_tsum_summary; +static int hf_tsum_req_search; +static int hf_tsum_rsp_search; static const enum_val_t capture_position_vals[] = { { "TRACE_CAP_CLIENT", "Client", TRACE_CAP_CLIENT }, @@ -177,7 +177,7 @@ static const value_string rrdp_calculation_vals[] = { { NULL, NULL, 0} };*/ -void add_detected_tcp_svc(guint16 port) +void add_detected_tcp_svc(uint16_t port) { wmem_map_insert(detected_tcp_svc, GUINT_TO_POINTER(port), GUINT_TO_POINTER(port)); } @@ -195,7 +195,7 @@ static void init_dcerpc_data(void) wmem_map_insert(dcerpc_context_zero, GUINT_TO_POINTER(15), GUINT_TO_POINTER(15)); } -static void register_dcerpc_stream(guint32 stream_no) +static void register_dcerpc_stream(uint32_t stream_no) { wmem_map_insert(dcerpc_streams, GUINT_TO_POINTER(stream_no), GUINT_TO_POINTER(1)); } @@ -528,27 +528,21 @@ static RRPD *find_latest_rrpd(RRPD *in_rrpd) { case RTE_CALC_DCERPC: return find_latest_rrpd_dcerpc(in_rrpd); - break; case RTE_CALC_DNS: return find_latest_rrpd_dns(in_rrpd); - break; case RTE_CALC_GTCP: return find_latest_rrpd_gtcp(in_rrpd); - break; case RTE_CALC_GUDP: return find_latest_rrpd_gudp(in_rrpd); - break; case RTE_CALC_SMB2: return find_latest_rrpd_smb2(in_rrpd); - break; case RTE_CALC_SYN: return find_latest_rrpd_syn(in_rrpd); - break; } return NULL; @@ -734,17 +728,17 @@ static void update_rrpd_rte_data(RRPD *in_rrpd) update_rrpd_list_entry_rsp(in_rrpd); } -gboolean is_dcerpc_context_zero(guint32 pkt_type) +bool is_dcerpc_context_zero(uint32_t pkt_type) { return (wmem_map_lookup(dcerpc_context_zero, GUINT_TO_POINTER(pkt_type)) != NULL); } -gboolean is_dcerpc_req_pkt_type(guint32 pkt_type) +bool is_dcerpc_req_pkt_type(uint32_t pkt_type) { return (wmem_map_lookup(dcerpc_req_pkt_type, GUINT_TO_POINTER(pkt_type)) != NULL); } -static gboolean is_dcerpc_stream(guint32 stream_no) +static bool is_dcerpc_stream(uint32_t stream_no) { return (wmem_map_lookup(dcerpc_streams, GUINT_TO_POINTER(stream_no)) != NULL); } @@ -768,7 +762,7 @@ static void init_globals(void) temp_rsp_rrpd_list = wmem_list_new(wmem_file_scope()); /* Indicate what fields we're interested in. */ - GArray *wanted_fields = g_array_sized_new(FALSE, FALSE, (guint)sizeof(int), HF_INTEREST_END_OF_LIST); + GArray *wanted_fields = g_array_sized_new(false, false, (unsigned)sizeof(int), HF_INTEREST_END_OF_LIST); for (int i = 0; i < HF_INTEREST_END_OF_LIST; i++) { if (hf_of_interest[i].hf != -1) @@ -782,18 +776,18 @@ static void init_globals(void) preferences.udp_svc_ports = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); /* use the range values to populate the tcp_svc_ports list*/ - for (guint i = 0; i < tcp_svc_port_range_values->nranges; i++) + for (unsigned i = 0; i < tcp_svc_port_range_values->nranges; i++) { - for (guint32 j = tcp_svc_port_range_values->ranges[i].low; j <= tcp_svc_port_range_values->ranges[i].high; j++) + for (uint32_t j = tcp_svc_port_range_values->ranges[i].low; j <= tcp_svc_port_range_values->ranges[i].high; j++) { wmem_map_insert(preferences.tcp_svc_ports, GUINT_TO_POINTER(j), GUINT_TO_POINTER(RTE_CALC_GTCP)); } } /* use the range values to populate the udp_svc_ports list*/ - for (guint i = 0; i < udp_svc_port_range_values->nranges; i++) + for (unsigned i = 0; i < udp_svc_port_range_values->nranges; i++) { - for (guint32 j = udp_svc_port_range_values->ranges[i].low; j <= udp_svc_port_range_values->ranges[i].high; j++) + for (uint32_t j = udp_svc_port_range_values->ranges[i].low; j <= udp_svc_port_range_values->ranges[i].high; j++) { wmem_map_insert(preferences.udp_svc_ports, GUINT_TO_POINTER(j), GUINT_TO_POINTER(RTE_CALC_GUDP)); } @@ -929,7 +923,7 @@ static void write_rte(RRPD *in_rrpd, tvbuff_t *tvb, packet_info *pinfo, proto_tr */ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt_info, PKT_INFO* subpackets) { - guint32 field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ + uint32_t field_uint[MAX_RETURNED_ELEMENTS]; /* An extracted field array for unsigned integers */ size_t field_value_count; /* How many entries are there in the extracted field array */ pkt_info->frame_number = pinfo->fd->num; /* easy access to frame number */ @@ -954,7 +948,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt { if (pkt_info->ssl_content_type == 21) /* this is an SSL Alert */ { - pkt_info->pkt_of_interest = FALSE; + pkt_info->pkt_of_interest = false; return; } @@ -970,7 +964,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt if (pkt_info->rrpd.c2s) wmem_map_remove(tcp_stream_exceptions, GUINT_TO_POINTER(pkt_info->rrpd.stream_no)); else - pkt_info->pkt_of_interest = FALSE; + pkt_info->pkt_of_interest = false; } } /* End of Optimisation Code */ @@ -983,7 +977,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt the rationale being that if we saw the original in the trace the service process saw it too */ if (pkt_info->rrpd.c2s && preferences.capture_position == CAPTURE_SERVICE) { - pkt_info->pkt_of_interest = FALSE; + pkt_info->pkt_of_interest = false; return; } @@ -991,7 +985,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt the rationale being that if we saw the original in the trace the client process saw it too */ else if (!pkt_info->rrpd.c2s && preferences.capture_position == CAPTURE_CLIENT) { - pkt_info->pkt_of_interest = FALSE; + pkt_info->pkt_of_interest = false; return; } } @@ -999,7 +993,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt /* We are not interested in TCP Keep-Alive */ if (pkt_info->tcp_keep_alive) { - pkt_info->pkt_of_interest = FALSE; + pkt_info->pkt_of_interest = false; return; } @@ -1007,7 +1001,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt { if (preferences.orphan_ka_discard && pkt_info->tcp_flags_ack && pkt_info->rrpd.c2s) { - pkt_info->pkt_of_interest = FALSE; + pkt_info->pkt_of_interest = false; return; /* It's a KEEP-ALIVE -> stop processing this packet */ } } @@ -1029,8 +1023,8 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt if (is_dcerpc_stream(pkt_info->rrpd.stream_no)) { pkt_info->rrpd.calculation = RTE_CALC_DCERPC; - pkt_info->rrpd.decode_based = TRUE; - pkt_info->pkt_of_interest = TRUE; + pkt_info->rrpd.decode_based = true; + pkt_info->pkt_of_interest = true; } if (!extract_uint(tree, hf_of_interest[HF_INTEREST_DCERPC_VER].hf, field_uint, &field_value_count)) @@ -1084,7 +1078,7 @@ static void set_proto_values(packet_info *pinfo, proto_tree *tree, PKT_INFO* pkt /* * This function is called for each packet * Wireshark scans all the packets once and then once again as they are displayed - * The pinfo.visited boolean is set to FALSE; on the first scan + * The pinfo.visited boolean is set to false; on the first scan */ static int dissect_transum(tvbuff_t *buffer, packet_info *pinfo, proto_tree *tree, void *data _U_) { @@ -1222,7 +1216,7 @@ proto_register_transum(void) }; /* Setup protocol subtree array */ - static gint *ett[] = { + static int *ett[] = { &ett_transum, &ett_transum_header, &ett_transum_data @@ -1236,19 +1230,19 @@ proto_register_transum(void) /* Set User Preferences defaults */ preferences.capture_position = TRACE_CAP_CLIENT; - preferences.reassembly = TRUE; + preferences.reassembly = true; range_convert_str(wmem_epan_scope(), &tcp_svc_port_range_values, "25, 80, 443, 1433", MAX_TCP_PORT); range_convert_str(wmem_epan_scope(), &udp_svc_port_range_values, "137-139", MAX_UDP_PORT); - preferences.orphan_ka_discard = FALSE; + preferences.orphan_ka_discard = false; preferences.time_multiplier = RTE_TIME_SEC; - preferences.rte_on_first_req = FALSE; - preferences.rte_on_last_req = TRUE; - preferences.rte_on_first_rsp = FALSE; - preferences.rte_on_last_rsp = FALSE; + preferences.rte_on_first_req = false; + preferences.rte_on_last_req = true; + preferences.rte_on_first_rsp = false; + preferences.rte_on_last_rsp = false; - preferences.debug_enabled = FALSE; + preferences.debug_enabled = false; /* no start registering stuff */ proto_register_field_array(proto_transum, hf, array_length(hf)); @@ -1265,7 +1259,7 @@ proto_register_transum(void) "Position of the capture unit that produced this trace. This setting affects the way TRANSUM handles TCP Retransmissions. See the manual for details.", &preferences.capture_position, capture_position_vals, - FALSE); + false); prefs_register_bool_preference(transum_module, "reassembly", @@ -1300,7 +1294,7 @@ proto_register_transum(void) "Unit of time used for APDU Response Time, Service Time and Spread Time values.", &preferences.time_multiplier, time_multiplier_vals, - FALSE); + false); */ prefs_register_bool_preference(transum_module, diff --git a/plugins/epan/transum/packet-transum.h b/plugins/epan/transum/packet-transum.h index c8915e14..d21b02fa 100644 --- a/plugins/epan/transum/packet-transum.h +++ b/plugins/epan/transum/packet-transum.h @@ -33,18 +33,18 @@ typedef struct _RRPD { /* - When a c2s is set TRUE it means that the associated packet is going from + When a c2s is set true it means that the associated packet is going from client-to-service. If this value is false the associated packet is going from service-to-client. This value is only valid for RRPDs imbedded in subpacket structures. */ - gboolean c2s; + bool c2s; - guint8 ip_proto; - guint32 stream_no; - guint64 session_id; - guint64 msg_id; + uint8_t ip_proto; + uint32_t stream_no; + uint64_t session_id; + uint64_t msg_id; /* Some request-response pairs are demarked simple by a change in direction on a @@ -53,25 +53,25 @@ typedef struct _RRPD values to detect the start and end of APDUs. In this latter case decode_based is set to true. */ - gboolean decode_based; + bool decode_based; - gboolean is_retrans; + bool is_retrans; - guint32 req_first_frame; + uint32_t req_first_frame; nstime_t req_first_rtime; - guint32 req_last_frame; + uint32_t req_last_frame; nstime_t req_last_rtime; - guint32 rsp_first_frame; + uint32_t rsp_first_frame; nstime_t rsp_first_rtime; - guint32 rsp_last_frame; + uint32_t rsp_last_frame; nstime_t rsp_last_rtime; - guint calculation; + unsigned calculation; /* The following numbers are for tuning purposes */ - guint32 req_search_total; /* The total number of steps back through the rrpd_list when matching requests to this entry */ - guint32 rsp_search_total; /* The total number of steps back through the rrpd_list when matching responses to this entry */ + uint32_t req_search_total; /* The total number of steps back through the rrpd_list when matching requests to this entry */ + uint32_t rsp_search_total; /* The total number of steps back through the rrpd_list when matching responses to this entry */ } RRPD; typedef struct _PKT_INFO @@ -79,39 +79,39 @@ typedef struct _PKT_INFO int frame_number; nstime_t relative_time; - gboolean tcp_retran; /* tcp.analysis.retransmission */ - gboolean tcp_keep_alive; /* tcp.analysis.keep_alive */ - gboolean tcp_flags_syn; /* tcp.flags.syn */ - gboolean tcp_flags_ack; /* tcp.flags.ack */ - gboolean tcp_flags_reset; /* tcp.flags.reset */ - guint32 tcp_flags_urg; /* tcp.urgent_pointer */ - guint32 tcp_seq; /* tcp.seq */ + bool tcp_retran; /* tcp.analysis.retransmission */ + bool tcp_keep_alive; /* tcp.analysis.keep_alive */ + bool tcp_flags_syn; /* tcp.flags.syn */ + bool tcp_flags_ack; /* tcp.flags.ack */ + bool tcp_flags_reset; /* tcp.flags.reset */ + uint32_t tcp_flags_urg; /* tcp.urgent_pointer */ + uint32_t tcp_seq; /* tcp.seq */ /* Generic transport values */ - guint16 srcport; /* tcp.srcport or udp.srcport*/ - guint16 dstport; /* tcp.dstport or udp.dstport*/ - guint16 len; /* tcp.len or udp.len */ + uint16_t srcport; /* tcp.srcport or udp.srcport*/ + uint16_t dstport; /* tcp.dstport or udp.dstport*/ + uint16_t len; /* tcp.len or udp.len */ - guint8 ssl_content_type; /*tls.record.content_type */ + uint8_t ssl_content_type; /*tls.record.content_type */ - guint8 tds_type; /*tds.type */ - guint16 tds_length; /* tds.length */ + uint8_t tds_type; /*tds.type */ + uint16_t tds_length; /* tds.length */ - guint16 smb_mid; /* smb.mid */ + uint16_t smb_mid; /* smb.mid */ - guint64 smb2_sesid; /* smb2.sesid */ - guint64 smb2_msg_id; /* smb2.msg_id */ - guint16 smb2_cmd; /* smb2.cmd */ + uint64_t smb2_sesid; /* smb2.sesid */ + uint64_t smb2_msg_id; /* smb2.msg_id */ + uint16_t smb2_cmd; /* smb2.cmd */ - guint8 dcerpc_ver; /* dcerpc.ver */ - guint8 dcerpc_pkt_type; /* dcerpc.pkt_type */ - guint32 dcerpc_cn_call_id; /* dcerpc.cn_call_id */ - guint16 dcerpc_cn_ctx_id; /* dcerpc.cn_ctx_id */ + uint8_t dcerpc_ver; /* dcerpc.ver */ + uint8_t dcerpc_pkt_type; /* dcerpc.pkt_type */ + uint32_t dcerpc_cn_call_id; /* dcerpc.cn_call_id */ + uint16_t dcerpc_cn_ctx_id; /* dcerpc.cn_ctx_id */ - guint16 dns_id; /* dns.id */ + uint16_t dns_id; /* dns.id */ /* The following values are calculated */ - gboolean pkt_of_interest; + bool pkt_of_interest; /* RRPD data for this packet */ /* Complete this based on the detected protocol */ @@ -170,9 +170,9 @@ typedef struct _HF_OF_INTEREST_INFO extern HF_OF_INTEREST_INFO hf_of_interest[HF_INTEREST_END_OF_LIST]; -void add_detected_tcp_svc(guint16 port); -extern gboolean is_dcerpc_context_zero(guint32 pkt_type); -extern gboolean is_dcerpc_req_pkt_type(guint32 pkt_type); +void add_detected_tcp_svc(uint16_t port); +extern bool is_dcerpc_context_zero(uint32_t pkt_type); +extern bool is_dcerpc_req_pkt_type(uint32_t pkt_type); /* diff --git a/plugins/epan/transum/preferences.h b/plugins/epan/transum/preferences.h index 96eea06a..240565e1 100644 --- a/plugins/epan/transum/preferences.h +++ b/plugins/epan/transum/preferences.h @@ -25,17 +25,17 @@ typedef struct _TSUM_PREFERENCES { int capture_position; - gboolean reassembly; + bool reassembly; wmem_map_t *tcp_svc_ports; wmem_map_t *udp_svc_ports; - gboolean orphan_ka_discard; + bool orphan_ka_discard; int time_multiplier; - gboolean rte_on_first_req; - gboolean rte_on_last_req; - gboolean rte_on_first_rsp; - gboolean rte_on_last_rsp; - gboolean summarisers_enabled; - gboolean summarise_tds; - gboolean summarisers_escape_quotes; - gboolean debug_enabled; + bool rte_on_first_req; + bool rte_on_last_req; + bool rte_on_first_rsp; + bool rte_on_last_rsp; + bool summarisers_enabled; + bool summarise_tds; + bool summarisers_escape_quotes; + bool debug_enabled; } TSUM_PREFERENCES; |