diff options
Diffstat (limited to 'epan/dissectors/packet-f5ethtrailer.c')
-rw-r--r-- | epan/dissectors/packet-f5ethtrailer.c | 916 |
1 files changed, 465 insertions, 451 deletions
diff --git a/epan/dissectors/packet-f5ethtrailer.c b/epan/dissectors/packet-f5ethtrailer.c index 197f1435..6f83395d 100644 --- a/epan/dissectors/packet-f5ethtrailer.c +++ b/epan/dissectors/packet-f5ethtrailer.c @@ -196,9 +196,10 @@ Notes: #include <epan/proto.h> #include <epan/proto_data.h> #include <epan/conversation_filter.h> +#include <epan/tfs.h> + #include "packet-ip.h" #include "packet-tcp.h" -#include <epan/etypes.h> #include <epan/to_str.h> #include <epan/stats_tree.h> #define F5FILEINFOTAP_SRC @@ -207,12 +208,12 @@ Notes: #include <wsutil/wslog.h> /* Wireshark ID of the F5ETHTRAILER protocol */ -static int proto_f5ethtrailer = -1; +static int proto_f5ethtrailer; static int tap_f5ethtrailer = -1; -static int proto_f5fileinfo = -1; +static int proto_f5fileinfo; static int tap_f5fileinfo = -1; /** Helper dissector for DPT format noise */ -static int proto_f5ethtrailer_dpt_noise = -1; +static int proto_f5ethtrailer_dpt_noise; void proto_reg_handoff_f5ethtrailer(void); void proto_register_f5ethtrailer(void); @@ -225,122 +226,123 @@ static dissector_handle_t f5dpt_tls_handle; /* Common Fields */ -static gint hf_provider = -1; -static gint hf_type = -1; -static gint hf_length = -1; -static gint hf_version = -1; -static gint hf_data = -1; -static gint hf_data_str = -1; -static gint hf_dpt_unknown = -1; -static gint hf_trailer_hdr = -1; -static gint hf_orig_fcs = -1; +static int hf_provider; +static int hf_type; +static int hf_length; +static int hf_version; +static int hf_data; +static int hf_data_str; +static int hf_dpt_unknown; +static int hf_trailer_hdr; +static int hf_orig_fcs; /* Low */ -static gint hf_low_id = -1; -static gint hf_flags = -1; -static gint hf_flags_ingress = -1; -static gint hf_flags_hwaction = -1; -static gint hf_ingress = -1; -static gint hf_slot0 = -1; -static gint hf_slot1 = -1; -static gint hf_tmm = -1; -static gint hf_obj_name_type = -1; -static gint hf_obj_data_len = -1; -static gint hf_vipnamelen = -1; -static gint hf_vip = -1; -static gint hf_portnamelen = -1; -static gint hf_phys_port = -1; -static gint hf_trunknamelen = -1; -static gint hf_trunk = -1; +static int hf_low_id; +static int hf_flags; +static int hf_flags_ingress; +static int hf_flags_hwaction; +static int hf_ingress; +static int hf_slot0; +static int hf_slot1; +static int hf_tmm; +static int hf_obj_name_type; +static int hf_obj_data_len; +static int hf_vipnamelen; +static int hf_vip; +static int hf_portnamelen; +static int hf_phys_port; +static int hf_trunknamelen; +static int hf_trunk; /* Med */ -static gint hf_med_id = -1; -static gint hf_flow_id = -1; -static gint hf_peer_id = -1; -static gint hf_any_flow = -1; -static gint hf_cf_flags = -1; -static gint hf_cf_flags2 = -1; -static gint hf_flow_type = -1; -static gint hf_ha_unit = -1; -static gint hf_reserved = -1; -static gint hf_priority = -1; -static gint hf_rstcause = -1; -static gint hf_rstcause_len = -1; -static gint hf_rstcause_ver = -1; -static gint hf_rstcause_peer = -1; -static gint hf_rstcause_val = -1; -static gint hf_rstcause_line = -1; -static gint hf_rstcause_txt = -1; +static int hf_med_id; +static int hf_flow_id; +static int hf_peer_id; +static int hf_any_flow; +static int hf_cf_flags; +static int hf_cf_flags2; +static int hf_flow_type; +static int hf_ha_unit; +static int hf_reserved; +static int hf_priority; +static int hf_rstcause; +static int hf_rstcause_len; +static int hf_rstcause_ver; +static int hf_rstcause_peer; +static int hf_rstcause_val; +static int hf_rstcause_line; +static int hf_rstcause_txt; /* High */ -static gint hf_high_id = -1; -static gint hf_peer_ipproto = -1; -static gint hf_peer_vlan = -1; -static gint hf_peer_remote_addr = -1; -static gint hf_peer_remote_ip6addr = -1; -static gint hf_peer_remote_rtdom = -1; -static gint hf_peer_local_addr = -1; -static gint hf_peer_local_ip6addr = -1; -static gint hf_peer_local_rtdom = -1; -static gint hf_peer_ipaddr = -1; -static gint hf_peer_ip6addr = -1; -static gint hf_peer_rtdom = -1; -static gint hf_peer_remote_port = -1; -static gint hf_peer_local_port = -1; -static gint hf_peer_port = -1; -static gint hf_peer_nopeer = -1; +static int hf_high_id; +static int hf_peer_ipproto; +static int hf_peer_vlan; +static int hf_peer_remote_addr; +static int hf_peer_remote_ip6addr; +static int hf_peer_remote_rtdom; +static int hf_peer_local_addr; +static int hf_peer_local_ip6addr; +static int hf_peer_local_rtdom; +static int hf_peer_ipaddr; +static int hf_peer_ip6addr; +static int hf_peer_rtdom; +static int hf_peer_remote_port; +static int hf_peer_local_port; +static int hf_peer_port; +static int hf_peer_nopeer; /* Analysis */ -static gint hf_analysis = -1; +static int hf_analysis; /* These fields will be used if pref_pop_other_fields is enabled. They will be populated with data from the "high" trailer so that filtering on ip.addr, tcp.port, etc... can find peer side flows of the specific flow you're searching for. */ -static gint hf_ip_ipaddr = -1; -static gint hf_ip6_ip6addr = -1; -static gint hf_tcp_tcpport = -1; -static gint hf_udp_udpport = -1; +static int hf_ip_ipaddr; +static int hf_ip6_ip6addr; +static int hf_tcp_tcpport; +static int hf_udp_udpport; -static gint hf_dpt_magic = -1; -static gint hf_dpt_ver = -1; -static gint hf_dpt_len = -1; +static int hf_dpt_magic; +static int hf_dpt_ver; +static int hf_dpt_len; -static expert_field ei_f5eth_flowlost = EI_INIT; -static expert_field ei_f5eth_flowreuse = EI_INIT; -static expert_field ei_f5eth_badlen = EI_INIT; -static expert_field ei_f5eth_undecoded = EI_INIT; +static expert_field ei_f5eth_flowlost; +static expert_field ei_f5eth_flowreuse; +static expert_field ei_f5eth_badlen; +static expert_field ei_f5eth_undecoded; /* These are the ids of the subtrees that we may be creating */ -static gint ett_f5ethtrailer = -1; -static gint ett_f5ethtrailer_unknown = -1; -static gint ett_f5ethtrailer_low = -1; -static gint ett_f5ethtrailer_low_flags = -1; -static gint ett_f5ethtrailer_med = -1; -static gint ett_f5ethtrailer_high = -1; -static gint ett_f5ethtrailer_rstcause = -1; -static gint ett_f5ethtrailer_trailer_hdr = -1; -static gint ett_f5ethtrailer_obj_names = -1; +static int ett_f5ethtrailer; +static int ett_f5ethtrailer_unknown; +static int ett_f5ethtrailer_low; +static int ett_f5ethtrailer_low_flags; +static int ett_f5ethtrailer_med; +static int ett_f5ethtrailer_high; +static int ett_f5ethtrailer_rstcause; +static int ett_f5ethtrailer_trailer_hdr; +static int ett_f5ethtrailer_obj_names; /* For fileinformation */ -static gint hf_fi_command = -1; -static gint hf_fi_version = -1; -static gint hf_fi_hostname = -1; -static gint hf_fi_platform = -1; -static gint hf_fi_platformname = -1; -static gint hf_fi_product = -1; +static int hf_fi_command; +static int hf_fi_version; +static int hf_fi_hostname; +static int hf_fi_platform; +static int hf_fi_platformname; +static int hf_fi_product; +static int hf_fi_session; /* Wireshark preference to show RST cause in info column */ -static gboolean rstcause_in_info = TRUE; -/** Wireshark prefrence to look at all trailer bytes for f5ethtrailer */ -static gboolean pref_walk_trailer = FALSE; +static bool rstcause_in_info = true; +/** Wireshark preference to look at all trailer bytes for f5ethtrailer */ +static bool pref_walk_trailer; /* Wireshark preference to enable/disable the population of other dissectors' * fields.*/ -static gboolean pref_pop_other_fields = FALSE; +static bool pref_pop_other_fields; /** Wireshark preference to perform analysis */ -static gboolean pref_perform_analysis = FALSE; +static bool pref_perform_analysis; /** Wireshark preference to generate keylog entries from f5ethtrailer TLS data */ -static gboolean pref_generate_keylog = TRUE; +static bool pref_generate_keylog = true; /** Identifiers for taps (when enabled), only the address is important, the * values are unused. */ -static gboolean tap_ip_enabled; -static gboolean tap_ipv6_enabled; -static gboolean tap_tcp_enabled; +static bool tap_ip_enabled; +static bool tap_ipv6_enabled; +static bool tap_tcp_enabled; /** Used "in" and "out" map for the true and false for ingress. (Not actually * used in field definition, but rather used to display via a format call @@ -388,10 +390,10 @@ static dissector_table_t noise_subdissector_table; * @param ptype The Wireshark port_type * @return The IP protocol number corresponding to the port type. */ -inline static guint8 +inline static uint8_t ptype_to_ipproto(const port_type ptype) { - guint8 ipproto = 0; + uint8_t ipproto = 0; switch (ptype) { case PT_TCP: ipproto = IP_PROTO_TCP; @@ -418,11 +420,11 @@ ptype_to_ipproto(const port_type ptype) * @param pinfo A pointer to the packet info to look at for the L3 data. * @return True if it is valid IP/IPv6, false otherwise */ -static gboolean +static bool f5_ip_conv_valid(packet_info *pinfo, void *user_data _U_) { - gboolean is_ip = FALSE; - gboolean is_f5ethtrailer = FALSE; + bool is_ip = false; + bool is_f5ethtrailer = false; proto_get_frame_protocols(pinfo->layers, &is_ip, NULL, NULL, NULL, NULL, NULL, NULL); is_f5ethtrailer = proto_is_frame_protocol(pinfo->layers, "f5ethtrailer"); @@ -439,12 +441,12 @@ f5_ip_conv_valid(packet_info *pinfo, void *user_data _U_) * @param pinfo A pointer to the packet info to look at for the L3/L4 data. * @return True if it is valid IP/IPv6 + TCP, false otherwise */ -static gboolean +static bool f5_tcp_conv_valid(packet_info *pinfo, void *user_data _U_) { - gboolean is_ip = FALSE; - gboolean is_tcp = FALSE; - gboolean is_f5ethtrailer = FALSE; + bool is_ip = false; + bool is_tcp = false; + bool is_f5ethtrailer = false; proto_get_frame_protocols(pinfo->layers, &is_ip, &is_tcp, NULL, NULL, NULL, NULL, NULL); is_f5ethtrailer = proto_is_frame_protocol(pinfo->layers, "f5ethtrailer"); @@ -461,12 +463,12 @@ f5_tcp_conv_valid(packet_info *pinfo, void *user_data _U_) * @param pinfo A pointer to the packet info to look at for the L3/L4 data. * @return True if it is valid IP/IPv6 + UDP, false otherwise */ -static gboolean +static bool f5_udp_conv_valid(packet_info *pinfo, void *user_data _U_) { - gboolean is_ip = FALSE; - gboolean is_udp = FALSE; - gboolean is_f5ethtrailer = FALSE; + bool is_ip = false; + bool is_udp = false; + bool is_f5ethtrailer = false; proto_get_frame_protocols(pinfo->layers, &is_ip, NULL, &is_udp, NULL, NULL, NULL, NULL); is_f5ethtrailer = proto_is_frame_protocol(pinfo->layers, "f5ethtrailer"); @@ -488,12 +490,12 @@ f5_udp_conv_valid(packet_info *pinfo, void *user_data _U_) * caller (menu_dissector_filter_cb()) uses g_free to free the filter string. * (as of WS 1.12). */ -static gchar * +static char * f5_ip_conv_filter(packet_info *pinfo, void *user_data _U_) { - gchar *buf = NULL; - gchar src_addr[WS_INET6_ADDRSTRLEN]; - gchar dst_addr[WS_INET6_ADDRSTRLEN]; + char *buf = NULL; + char src_addr[WS_INET6_ADDRSTRLEN]; + char dst_addr[WS_INET6_ADDRSTRLEN]; *dst_addr = *src_addr = '\0'; if (pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4) { @@ -543,12 +545,12 @@ f5_ip_conv_filter(packet_info *pinfo, void *user_data _U_) * caller (menu_dissector_filter_cb()) uses g_free to free the filter string. * (as of WS 1.12). */ -static gchar * +static char * f5_tcp_conv_filter(packet_info *pinfo, void *user_data _U_) { - gchar *buf = NULL; - gchar src_addr[WS_INET6_ADDRSTRLEN]; - gchar dst_addr[WS_INET6_ADDRSTRLEN]; + char *buf = NULL; + char src_addr[WS_INET6_ADDRSTRLEN]; + char dst_addr[WS_INET6_ADDRSTRLEN]; *dst_addr = *src_addr = '\0'; if (pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4) { @@ -603,12 +605,12 @@ f5_tcp_conv_filter(packet_info *pinfo, void *user_data _U_) * caller (menu_dissector_filter_cb()) uses g_free to free the filter string. * (as of WS 1.12). */ -static gchar * +static char * f5_udp_conv_filter(packet_info *pinfo, void *user_data _U_) { - gchar *buf = NULL; - gchar src_addr[WS_INET6_ADDRSTRLEN]; - gchar dst_addr[WS_INET6_ADDRSTRLEN]; + char *buf = NULL; + char src_addr[WS_INET6_ADDRSTRLEN]; + char dst_addr[WS_INET6_ADDRSTRLEN]; *dst_addr = *src_addr = '\0'; if (pinfo->net_src.type == AT_IPv4 && pinfo->net_dst.type == AT_IPv4) { @@ -647,22 +649,22 @@ f5_udp_conv_filter(packet_info *pinfo, void *user_data _U_) static int st_node_tmmpktdist = -1; /**< Tree for packet counts */ static int st_node_tmmbytedist = -1; /**< Tree for byte counts (excludes trailer) */ -static const gchar *st_str_tmmdist = "F5/tmm Distribution"; -static const gchar *st_str_tmmdist_pkts = "tmm Packet Distribution"; -static const gchar *st_str_tmmdist_bytes = "tmm Byte Distribution (excludes trailer)"; -static const gchar *st_str_tmm_dir_in = "direction in"; -static const gchar *st_str_tmm_dir_out = "direction out"; -static const gchar *st_str_tmm_flow_virt = "flow with virtual"; -static const gchar *st_str_tmm_flow_novirt = "flow without virtual"; -static const gchar *st_str_tmm_flow_none = "flow none"; +static const char *st_str_tmmdist = "F5" STATS_TREE_MENU_SEPARATOR "tmm Distribution"; +static const char *st_str_tmmdist_pkts = "tmm Packet Distribution"; +static const char *st_str_tmmdist_bytes = "tmm Byte Distribution (excludes trailer)"; +static const char *st_str_tmm_dir_in = "direction in"; +static const char *st_str_tmm_dir_out = "direction out"; +static const char *st_str_tmm_flow_virt = "flow with virtual"; +static const char *st_str_tmm_flow_novirt = "flow without virtual"; +static const char *st_str_tmm_flow_none = "flow none"; static int st_node_virtpktdist = -1; /**< Tree for packet counts */ static int st_node_virtbytedist = -1; /**< Tree for packet counts (excludes trailer) */ -static const gchar *st_str_virtdist = "F5/Virtual Server Distribution"; -static const gchar *st_str_virtdist_pkts = "Virtual Server Packet Distribution"; -static const gchar *st_str_virtdist_bytes = "Virtual Server Byte Distribution (excludes trailer)"; -static const gchar *st_str_virtdist_noflow = "No flow"; -static const gchar *st_str_virtdist_novirt = "Flow without virtual server name"; +static const char *st_str_virtdist = "F5" STATS_TREE_MENU_SEPARATOR "Virtual Server Distribution"; +static const char *st_str_virtdist_pkts = "Virtual Server Packet Distribution"; +static const char *st_str_virtdist_bytes = "Virtual Server Byte Distribution (excludes trailer)"; +static const char *st_str_virtdist_noflow = "No flow"; +static const char *st_str_virtdist_novirt = "Flow without virtual server name"; /*-----------------------------------------------------------------------------------------------*/ /** @@ -676,16 +678,16 @@ static const gchar *st_str_virtdist_novirt = "Flow without virtual server name"; static void f5eth_tmmdist_stats_tree_init(stats_tree *st) { - st_node_tmmpktdist = stats_tree_create_node(st, st_str_tmmdist_pkts, 0, STAT_DT_INT, TRUE); - stat_node_set_flags(st, st_str_tmmdist_pkts, 0, TRUE, ST_FLG_SORT_TOP); - st_node_tmmbytedist = stats_tree_create_node(st, st_str_tmmdist_bytes, 0, STAT_DT_INT, TRUE); + st_node_tmmpktdist = stats_tree_create_node(st, st_str_tmmdist_pkts, 0, STAT_DT_INT, true); + stat_node_set_flags(st, st_str_tmmdist_pkts, 0, true, ST_FLG_SORT_TOP); + st_node_tmmbytedist = stats_tree_create_node(st, st_str_tmmdist_bytes, 0, STAT_DT_INT, true); } /* f5eth_tmmdist_stats_tree_init() */ #define PER_TMM_STAT_NAME_BUF_LEN (sizeof("slot SSS,tmm TTT")) /*-----------------------------------------------------------------------------------------------*/ /** - * @brief Per-packet tmm distrubution statistics + * @brief Per-packet tmm distribution statistics * * @attention This is an interface function to be called from the rest of wireshark. * @@ -702,7 +704,7 @@ f5eth_tmmdist_stats_tree_packet( stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_) { const f5eth_tap_data_t *tdata = (const f5eth_tap_data_t *)data; - guint32 pkt_len; + uint32_t pkt_len; int st_node_tot_pkts; int st_node_tot_bytes; int st_node_tmm_pkts; @@ -723,58 +725,58 @@ f5eth_tmmdist_stats_tree_packet( pkt_len = pinfo->fd->pkt_len - tdata->trailer_len; - st_node_tot_pkts = tick_stat_node(st, st_str_tmmdist_pkts, 0, TRUE); - st_node_tot_bytes = increase_stat_node(st, st_str_tmmdist_bytes, 0, TRUE, pkt_len); + st_node_tot_pkts = tick_stat_node(st, st_str_tmmdist_pkts, 0, true); + st_node_tot_bytes = increase_stat_node(st, st_str_tmmdist_bytes, 0, true, pkt_len); - st_node_tmm_pkts = tick_stat_node(st, tmm_stat_name_buffer, st_node_tot_pkts, TRUE); + st_node_tmm_pkts = tick_stat_node(st, tmm_stat_name_buffer, st_node_tot_pkts, true); st_node_tmm_bytes = - increase_stat_node(st, tmm_stat_name_buffer, st_node_tot_bytes, TRUE, pkt_len); + increase_stat_node(st, tmm_stat_name_buffer, st_node_tot_bytes, true, pkt_len); if (tdata->ingress == 1) { - tick_stat_node(st, st_str_tmm_dir_in, st_node_tmm_pkts, FALSE); - increase_stat_node(st, st_str_tmm_dir_in, st_node_tmm_bytes, FALSE, pkt_len); + tick_stat_node(st, st_str_tmm_dir_in, st_node_tmm_pkts, false); + increase_stat_node(st, st_str_tmm_dir_in, st_node_tmm_bytes, false, pkt_len); /* Create nodes in case we see no egress packets */ - increase_stat_node(st, st_str_tmm_dir_out, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_dir_out, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_dir_out, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_dir_out, st_node_tmm_bytes, false, 0); } else { - tick_stat_node(st, st_str_tmm_dir_out, st_node_tmm_pkts, FALSE); - increase_stat_node(st, st_str_tmm_dir_out, st_node_tmm_bytes, FALSE, pkt_len); + tick_stat_node(st, st_str_tmm_dir_out, st_node_tmm_pkts, false); + increase_stat_node(st, st_str_tmm_dir_out, st_node_tmm_bytes, false, pkt_len); /* Create nodes in case we see no ingress packets */ - increase_stat_node(st, st_str_tmm_dir_in, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_dir_in, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_dir_in, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_dir_in, st_node_tmm_bytes, false, 0); } if (tdata->virtual_name == NULL) { if (tdata->flow == 0) { /* No flow ID and no virtual name */ - tick_stat_node(st, st_str_tmm_flow_none, st_node_tmm_pkts, FALSE); - increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, FALSE, pkt_len); + tick_stat_node(st, st_str_tmm_flow_none, st_node_tmm_pkts, false); + increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, false, pkt_len); /* Create nodes in case we see no packets without a virtual */ - increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_bytes, false, 0); } else { /* Flow ID and no virtual name */ - tick_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_pkts, FALSE); - increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_bytes, FALSE, pkt_len); + tick_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_pkts, false); + increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_bytes, false, pkt_len); /* Create nodes in case we see no packets with a virtual */ - increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, false, 0); } /* Create nodes in case we see no packets with a virtual */ - increase_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_bytes, false, 0); } else { /* Has a virtual name */ - tick_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_pkts, FALSE); - increase_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_bytes, FALSE, pkt_len); + tick_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_pkts, false); + increase_stat_node(st, st_str_tmm_flow_virt, st_node_tmm_bytes, false, pkt_len); /* Create nodes in case we see no packets without a virtual */ - increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_flow_novirt, st_node_tmm_bytes, false, 0); /* Create nodes in case we see no packets without a flow */ - increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_pkts, FALSE, 0); - increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, FALSE, 0); + increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_pkts, false, 0); + increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, false, 0); } return TAP_PACKET_REDRAW; @@ -789,19 +791,19 @@ f5eth_tmmdist_stats_tree_packet( static void f5eth_virtdist_stats_tree_init(stats_tree *st) { - st_node_virtpktdist = stats_tree_create_node(st, st_str_virtdist_pkts, 0, STAT_DT_INT, TRUE); - stat_node_set_flags(st, st_str_virtdist_pkts, 0, TRUE, ST_FLG_SORT_TOP); - st_node_virtbytedist = stats_tree_create_node(st, st_str_virtdist_bytes, 0, STAT_DT_INT, TRUE); - - stats_tree_create_node(st, st_str_virtdist_noflow, st_node_virtpktdist, STAT_DT_INT, TRUE); - stat_node_set_flags(st, st_str_virtdist_noflow, st_node_virtpktdist, TRUE, ST_FLG_SORT_TOP); - stats_tree_create_node(st, st_str_virtdist_novirt, st_node_virtpktdist, STAT_DT_INT, TRUE); - stat_node_set_flags(st, st_str_virtdist_novirt, st_node_virtpktdist, TRUE, ST_FLG_SORT_TOP); - - stats_tree_create_node(st, st_str_virtdist_noflow, st_node_virtbytedist, STAT_DT_INT, TRUE); - stat_node_set_flags(st, st_str_virtdist_noflow, st_node_virtbytedist, TRUE, ST_FLG_SORT_TOP); - stats_tree_create_node(st, st_str_virtdist_novirt, st_node_virtbytedist, STAT_DT_INT, TRUE); - stat_node_set_flags(st, st_str_virtdist_novirt, st_node_virtbytedist, TRUE, ST_FLG_SORT_TOP); + st_node_virtpktdist = stats_tree_create_node(st, st_str_virtdist_pkts, 0, STAT_DT_INT, true); + stat_node_set_flags(st, st_str_virtdist_pkts, 0, true, ST_FLG_SORT_TOP); + st_node_virtbytedist = stats_tree_create_node(st, st_str_virtdist_bytes, 0, STAT_DT_INT, true); + + stats_tree_create_node(st, st_str_virtdist_noflow, st_node_virtpktdist, STAT_DT_INT, true); + stat_node_set_flags(st, st_str_virtdist_noflow, st_node_virtpktdist, true, ST_FLG_SORT_TOP); + stats_tree_create_node(st, st_str_virtdist_novirt, st_node_virtpktdist, STAT_DT_INT, true); + stat_node_set_flags(st, st_str_virtdist_novirt, st_node_virtpktdist, true, ST_FLG_SORT_TOP); + + stats_tree_create_node(st, st_str_virtdist_noflow, st_node_virtbytedist, STAT_DT_INT, true); + stat_node_set_flags(st, st_str_virtdist_noflow, st_node_virtbytedist, true, ST_FLG_SORT_TOP); + stats_tree_create_node(st, st_str_virtdist_novirt, st_node_virtbytedist, STAT_DT_INT, true); + stat_node_set_flags(st, st_str_virtdist_novirt, st_node_virtbytedist, true, ST_FLG_SORT_TOP); } /* f5eth_virtdist_stats_tree_init() */ /*-----------------------------------------------------------------------------------------------*/ @@ -820,7 +822,7 @@ f5eth_virtdist_stats_tree_packet( stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags _U_) { const f5eth_tap_data_t *tdata = (const f5eth_tap_data_t *)data; - guint32 pkt_len; + uint32_t pkt_len; if (tdata == NULL) return TAP_PACKET_DONT_REDRAW; @@ -832,25 +834,25 @@ f5eth_virtdist_stats_tree_packet( pkt_len = pinfo->fd->pkt_len - tdata->trailer_len; - tick_stat_node(st, st_str_virtdist_pkts, 0, TRUE); - increase_stat_node(st, st_str_virtdist_bytes, 0, TRUE, pkt_len); + tick_stat_node(st, st_str_virtdist_pkts, 0, true); + increase_stat_node(st, st_str_virtdist_bytes, 0, true, pkt_len); /* We could have low noise (with a virtual name) without medium noise (with the flow ID). * That will get treated as a no flow case. */ if (tdata->virtual_name == NULL) { if (tdata->flow == 0) { /* No flow ID */ - tick_stat_node(st, st_str_virtdist_noflow, st_node_virtpktdist, TRUE); - increase_stat_node(st, st_str_virtdist_noflow, st_node_virtbytedist, TRUE, pkt_len); + tick_stat_node(st, st_str_virtdist_noflow, st_node_virtpktdist, true); + increase_stat_node(st, st_str_virtdist_noflow, st_node_virtbytedist, true, pkt_len); } else { /* Flow ID without virtual name */ - tick_stat_node(st, st_str_virtdist_novirt, st_node_virtpktdist, TRUE); - increase_stat_node(st, st_str_virtdist_novirt, st_node_virtbytedist, TRUE, pkt_len); + tick_stat_node(st, st_str_virtdist_novirt, st_node_virtpktdist, true); + increase_stat_node(st, st_str_virtdist_novirt, st_node_virtbytedist, true, pkt_len); } } else { /* Has virtual name */ - tick_stat_node(st, tdata->virtual_name, st_node_virtpktdist, TRUE); - increase_stat_node(st, tdata->virtual_name, st_node_virtbytedist, TRUE, pkt_len); + tick_stat_node(st, tdata->virtual_name, st_node_virtpktdist, true); + increase_stat_node(st, tdata->virtual_name, st_node_virtbytedist, true, pkt_len); } return TAP_PACKET_REDRAW; @@ -906,12 +908,12 @@ static const char info_format_full_in_noslot[] = "IN tmm%-2u: "; static const char info_format_full_out_noslot[] = "OUT tmm%-2u: "; /* Variables used in f5eth_set_info_col functions initialized to defaults */ -static char *info_format_in_only = NULL; /**< In format in use with in/out only */ -static char *info_format_out_only = NULL; /**< Out format in use with in/out only */ -static char *info_format_in_noslot = NULL; /**< In format in use without slot */ -static char *info_format_out_noslot = NULL; /**< Out format in use without slot */ -static char *info_format_in_slot = NULL; /**< In format in use with slot */ -static char *info_format_out_slot = NULL; /**< Out format in use with slot */ +static char *info_format_in_only; /**< In format in use with in/out only */ +static char *info_format_out_only; /**< Out format in use with in/out only */ +static char *info_format_in_noslot; /**< In format in use without slot */ +static char *info_format_out_noslot; /**< Out format in use without slot */ +static char *info_format_in_slot; /**< In format in use with slot */ +static char *info_format_out_slot; /**< Out format in use with slot */ /** Info column display format preference types: * These correspond to bit flags @@ -940,15 +942,15 @@ static const enum_val_t f5eth_display_strings[] = { static f5eth_info_type_t pref_info_type = full; /** Preference for the brief in/out characters */ -static const char *pref_brief_inout_chars = NULL; +static const char *pref_brief_inout_chars; /** Function pointer prototype for info column set functions */ -typedef void (*f5eth_set_col_info_func)(packet_info *, guint, guint, guint); +typedef void (*f5eth_set_col_info_func)(packet_info *, unsigned, unsigned, unsigned); /** Preference for setting platform regex for which platforms to display slot information for. */ -static const char *pref_slots_regex = NULL; +static const char *pref_slots_regex; /** Whether or not to display slot information, set based on platform and regex preference. */ -static gboolean display_slot = TRUE; +static bool display_slot = true; /*-----------------------------------------------------------------------------------------------*/ /** @@ -960,15 +962,15 @@ static gboolean display_slot = TRUE; * @param tmm The tmm handling the packet */ static void -f5eth_set_info_col_slot(packet_info *pinfo, guint ingress, guint slot, guint tmm) +f5eth_set_info_col_slot(packet_info *pinfo, unsigned ingress, unsigned slot, unsigned tmm) { - gboolean col_writable; + bool col_writable; /* * HTTP and other protocols set writable to false to protect * their data. We don't care. */ col_writable = col_get_writable(pinfo->cinfo, COL_INFO); - col_set_writable(pinfo->cinfo, COL_INFO, TRUE); + col_set_writable(pinfo->cinfo, COL_INFO, true); if (ingress != 0) { DISSECTOR_ASSERT(info_format_in_slot); @@ -992,15 +994,15 @@ f5eth_set_info_col_slot(packet_info *pinfo, guint ingress, guint slot, guint tmm * @param tmm The tmm handling the packet */ static void -f5eth_set_info_col_noslot(packet_info *pinfo, guint ingress, guint slot _U_, guint tmm) +f5eth_set_info_col_noslot(packet_info *pinfo, unsigned ingress, unsigned slot _U_, unsigned tmm) { - gboolean col_writable; + bool col_writable; /* * HTTP and other protocols set writable to false to protect * their data. We don't care. */ col_writable = col_get_writable(pinfo->cinfo, COL_INFO); - col_set_writable(pinfo->cinfo, COL_INFO, TRUE); + col_set_writable(pinfo->cinfo, COL_INFO, true); if (ingress != 0) { col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, info_format_in_noslot, tmm); @@ -1022,15 +1024,15 @@ f5eth_set_info_col_noslot(packet_info *pinfo, guint ingress, guint slot _U_, gui * @param tmm The tmm handling the packet (unused) */ static void -f5eth_set_info_col_inout(packet_info *pinfo, guint ingress, guint slot _U_, guint tmm _U_) +f5eth_set_info_col_inout(packet_info *pinfo, unsigned ingress, unsigned slot _U_, unsigned tmm _U_) { - gboolean col_writable; + bool col_writable; /* * HTTP and other protocols set writable to false to protect * their data. We don't care. */ col_writable = col_get_writable(pinfo->cinfo, COL_INFO); - col_set_writable(pinfo->cinfo, COL_INFO, TRUE); + col_set_writable(pinfo->cinfo, COL_INFO, true); if (ingress != 0) { col_prepend_fence_fstr(pinfo->cinfo, COL_INFO, "%s", info_format_in_only); @@ -1053,14 +1055,14 @@ static f5eth_set_col_info_func f5eth_set_info_col = f5eth_set_info_col_slot; * after the function returns.) */ static void -f5eth_process_f5info(const guint8 *platform) +f5eth_process_f5info(const uint8_t *platform) { /** Always display slot information when there is no platform information in the header or * if there was no regex specified in the preference. But use the in/out only * function if that is specified in the preference.*/ if (platform == NULL || platform[0] == '\0' || pref_slots_regex == NULL || pref_slots_regex[0] == '\0') { - display_slot = TRUE; + display_slot = true; if (pref_info_type == in_out_only || pref_info_type == brief_in_out_only) { f5eth_set_info_col = f5eth_set_info_col_inout; } else { @@ -1071,9 +1073,9 @@ f5eth_process_f5info(const guint8 *platform) /** If the string matches the regex */ if (g_regex_match_simple(pref_slots_regex, platform, G_REGEX_RAW, (GRegexMatchFlags)0) - == TRUE) { + == true) { /** Then display the slot information (only if in/out only is not selected). */ - display_slot = TRUE; + display_slot = true; if (pref_info_type == in_out_only || pref_info_type == brief_in_out_only) { f5eth_set_info_col = f5eth_set_info_col_inout; } else { @@ -1081,7 +1083,7 @@ f5eth_process_f5info(const guint8 *platform) } } else { /** Else do not display the slot information (only if in/out only is not selected). */ - display_slot = FALSE; + display_slot = false; if (pref_info_type == in_out_only || pref_info_type == brief_in_out_only) { f5eth_set_info_col = f5eth_set_info_col_inout; } else { @@ -1094,7 +1096,7 @@ f5eth_process_f5info(const guint8 *platform) /*===============================================================================================*/ /** Magic information for the fileinfo packet that might appear at the beginning of a capture. */ -static const guint8 fileinfomagic1[] = { +static const uint8_t fileinfomagic1[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x05, 0xff, 'F', '5', '-', 'P', 's', 'e', 'u', 'd', 'o', '-', 'p', 'k', 't', 0 }; @@ -1236,21 +1238,21 @@ static const guint8 fileinfomagic1[] = { * For fields that are 2 bits wide, they have 0 == false, 1 == true and 3 == unknown. */ struct f5eth_analysis_data_t { - guint8 ip_visited : 1; /**< Did the IPv4 or IPv6 tap look at this packet already? */ - guint8 tcp_visited : 1; /**< Did the TCP tap look at this packet already? */ - guint8 ip_istcp : 2; /**< Is this a TCP (set by ip/ip6 tap on first header) */ - guint8 ip_isfrag : 2; /**< Is this packet an IP fragment? */ - guint8 tcp_synset : 2; /**< Is the SYN flag set in the TCP header? */ - guint8 tcp_ackset : 2; /**< Is the ACK flag set in the TCP header? */ - - guint8 pkt_ingress : 2; /**< Packet is ingress packet */ - guint8 pkt_has_flow : 2; /**< Packet has associated flow */ - guint8 pkt_has_peer : 2; /**< Packet has associated peer flow */ - - guint8 analysis_done : 1; /**< Analysis has been performed */ - guint8 analysis_flowreuse : 1; /**< Analysis indicates flow reuse */ - guint8 analysis_flowlost : 1; /**< Analysis indicates flow lost */ - guint8 analysis_hasresults : 1; /**< Are there actually any results? */ + uint8_t ip_visited : 1; /**< Did the IPv4 or IPv6 tap look at this packet already? */ + uint8_t tcp_visited : 1; /**< Did the TCP tap look at this packet already? */ + uint8_t ip_istcp : 2; /**< Is this a TCP (set by ip/ip6 tap on first header) */ + uint8_t ip_isfrag : 2; /**< Is this packet an IP fragment? */ + uint8_t tcp_synset : 2; /**< Is the SYN flag set in the TCP header? */ + uint8_t tcp_ackset : 2; /**< Is the ACK flag set in the TCP header? */ + + uint8_t pkt_ingress : 2; /**< Packet is ingress packet */ + uint8_t pkt_has_flow : 2; /**< Packet has associated flow */ + uint8_t pkt_has_peer : 2; /**< Packet has associated peer flow */ + + uint8_t analysis_done : 1; /**< Analysis has been performed */ + uint8_t analysis_flowreuse : 1; /**< Analysis indicates flow reuse */ + uint8_t analysis_flowlost : 1; /**< Analysis indicates flow lost */ + uint8_t analysis_hasresults : 1; /**< Are there actually any results? */ }; /*-----------------------------------------------------------------------------------------------*/ @@ -1288,7 +1290,7 @@ new_f5eth_analysis_data_t(void) /** Structure used as the anonymous data in the proto_tree_children_foreach() function */ struct subtree_search { proto_tree *tree; /**< The matching tree that we found */ - gint hf; /**< The type of tree that we are looking for. */ + int hf; /**< The type of tree that we are looking for. */ }; /*-----------------------------------------------------------------------------------------------*/ @@ -1299,7 +1301,7 @@ struct subtree_search { * @param data A pointer to the subtree_search structure with search criteria and results. */ static void -compare_subtree(proto_node *pn, gpointer data) +compare_subtree(proto_node *pn, void *data) { struct subtree_search *search_struct; search_struct = (struct subtree_search *)data; @@ -1318,7 +1320,7 @@ compare_subtree(proto_node *pn, gpointer data) * @return The tree that was found or NULL if it was not found. */ static proto_tree * -find_subtree(proto_tree *tree, gint hf) +find_subtree(proto_tree *tree, int hf) { struct subtree_search search_struct; @@ -1535,8 +1537,8 @@ tcp_tap_pkt(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, cons /* Used to determine if an address is an IPv4 address represented as an IPv6 * address. */ -static const guint8 ipv4as6prefix[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff}; -static const guint8 f5rtdomprefix[] = {0x26, 0x20, 0, 0, 0x0c, 0x10, 0xf5, 0x01, 0, 0}; +static const uint8_t ipv4as6prefix[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff}; +static const uint8_t f5rtdomprefix[] = {0x26, 0x20, 0, 0, 0x0c, 0x10, 0xf5, 0x01, 0, 0}; #define F5_IPV6ADDR_LEN 16 @@ -1554,7 +1556,7 @@ static const guint8 f5rtdomprefix[] = {0x26, 0x20, 0, 0, 0x0c, 0x10, 0xf5, 0x01, */ static proto_item * displayIPv6as4( - proto_tree *tree, int addrfield, int rtdomfield, tvbuff_t *tvb, int offset, gboolean hidden) + proto_tree *tree, int addrfield, int rtdomfield, tvbuff_t *tvb, int offset, bool hidden) { proto_item *pi = NULL; @@ -1601,11 +1603,11 @@ displayIPv6as4( * @param offset Offset into the tvb * @return Number of bytes consumed */ -static gint -render_f5_legacy_hdr(tvbuff_t *tvb, proto_tree *tree, gint offset) +static int +render_f5_legacy_hdr(tvbuff_t *tvb, proto_tree *tree, int offset) { proto_item *pi = NULL; - guint32 trailer_type; + uint32_t trailer_type; pi = proto_tree_add_item(tree, hf_trailer_hdr, tvb, offset, 3, ENC_NA); tree = proto_item_add_subtree(pi, ett_f5ethtrailer_trailer_hdr); @@ -1634,13 +1636,13 @@ render_f5_legacy_hdr(tvbuff_t *tvb, proto_tree *tree, gint offset) * @param tdata Pointer to tap data structure * @return Number of btyes consumed */ -static guint -dissect_high_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - guint8 trailer_length, guint8 trailer_ver, f5eth_tap_data_t *tdata) +static unsigned +dissect_high_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + uint8_t trailer_length, uint8_t trailer_ver, f5eth_tap_data_t *tdata) { proto_item *pi = NULL; - guint o; - guint8 ipproto; + unsigned o; + uint8_t ipproto; if (trailer_ver != 0 || trailer_length != F5_HIV0_LEN) return 0; @@ -1658,7 +1660,7 @@ dissect_high_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint } /* Add in the high order structures. */ - ipproto = tvb_get_guint8(tvb, o); + ipproto = tvb_get_uint8(tvb, o); proto_tree_add_item(tree, hf_peer_ipproto, tvb, o, 1, ENC_BIG_ENDIAN); o += 1; proto_tree_add_item(tree, hf_peer_vlan, tvb, o, 2, ENC_BIG_ENDIAN); @@ -1666,12 +1668,12 @@ dissect_high_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint /* peer remote address */ if (pref_pop_other_fields) { - displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, TRUE); + displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, true); pi = proto_tree_add_item(tree, hf_ip6_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); } - displayIPv6as4(tree, hf_peer_remote_addr, hf_peer_remote_rtdom, tvb, o, FALSE); - displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, TRUE); + displayIPv6as4(tree, hf_peer_remote_addr, hf_peer_remote_rtdom, tvb, o, false); + displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, true); proto_tree_add_item(tree, hf_peer_remote_ip6addr, tvb, o, 16, ENC_NA); pi = proto_tree_add_item(tree, hf_peer_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); @@ -1679,12 +1681,12 @@ dissect_high_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint /* peer local address */ if (pref_pop_other_fields) { - displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, TRUE); + displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, true); pi = proto_tree_add_item(tree, hf_ip6_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); } - displayIPv6as4(tree, hf_peer_local_addr, hf_peer_local_rtdom, tvb, o, FALSE); - displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, TRUE); + displayIPv6as4(tree, hf_peer_local_addr, hf_peer_local_rtdom, tvb, o, false); + displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, true); proto_tree_add_item(tree, hf_peer_local_ip6addr, tvb, o, 16, ENC_NA); pi = proto_tree_add_item(tree, hf_peer_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); @@ -1747,14 +1749,14 @@ dissect_high_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint * @param tdata Pointer to tap data structure * @return Number of btyes consumed */ -static guint -dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - guint8 trailer_length, guint8 trailer_ver, f5eth_tap_data_t *tdata) +static unsigned +dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + uint8_t trailer_length, uint8_t trailer_ver, f5eth_tap_data_t *tdata) { proto_item *pi = NULL; - guint o; - guint rstcauselen = 0; - guint rstcausever = 0xff; + unsigned o; + unsigned rstcauselen = 0; + unsigned rstcausever = 0xff; switch (trailer_ver) { case 0: @@ -1767,19 +1769,19 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o if (trailer_length < F5_MEDV1_LENMIN) { /* too small */ return 0; } - rstcauselen = tvb_get_guint8(tvb, offset + F5_MEDV1_LENMIN - 1); + rstcauselen = tvb_get_uint8(tvb, offset + F5_MEDV1_LENMIN - 1); /* check size is valid */ if (rstcauselen + F5_MEDV1_LENMIN != trailer_length) { return 0; } if (rstcauselen) - rstcausever = (tvb_get_guint8(tvb, offset + F5_MEDV1_LENMIN) & 0xfe) >> 1; + rstcausever = (tvb_get_uint8(tvb, offset + F5_MEDV1_LENMIN) & 0xfe) >> 1; /* If we want the RST cause in the summary, we need to do it here, * before the tree check below */ if (rstcauselen && rstcause_in_info) { if (rstcausever == 0x00) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "[F5RST%s: %s]", - tvb_get_guint8(tvb, offset + F5_MEDV1_LENMIN) & 0x01 ? "(peer)" : "", + tvb_get_uint8(tvb, offset + F5_MEDV1_LENMIN) & 0x01 ? "(peer)" : "", tvb_get_string_enc(pinfo->pool, tvb, offset + F5_MEDV1_LENMIN + 9, rstcauselen - 9, ENC_ASCII)); } @@ -1789,19 +1791,19 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o if (trailer_length < F5_MEDV2_LENMIN) { /* too small */ return 0; } - rstcauselen = tvb_get_guint8(tvb, offset + F5_MEDV2_LENMIN - 1); + rstcauselen = tvb_get_uint8(tvb, offset + F5_MEDV2_LENMIN - 1); /* check size is valid */ if (rstcauselen + F5_MEDV2_LENMIN != trailer_length) { return 0; } if (rstcauselen) - rstcausever = (tvb_get_guint8(tvb, offset + F5_MEDV2_LENMIN) & 0x0fe) >> 1; + rstcausever = (tvb_get_uint8(tvb, offset + F5_MEDV2_LENMIN) & 0x0fe) >> 1; /* If we want the RST cause in the summary, we need to do it here, * before the tree check below */ if (rstcauselen && rstcause_in_info) { if (rstcausever == 0x00) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "[F5RST%s: %s]", - tvb_get_guint8(tvb, offset + F5_MEDV2_LENMIN) & 0x01 ? "(peer)" : "", + tvb_get_uint8(tvb, offset + F5_MEDV2_LENMIN) & 0x01 ? "(peer)" : "", tvb_get_string_enc(pinfo->pool, tvb, offset + F5_MEDV2_LENMIN + 9, rstcauselen - 9, ENC_ASCII)); } @@ -1811,19 +1813,19 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o if (trailer_length < F5_MEDV3_LENMIN) { /* too small */ return 0; } - rstcauselen = tvb_get_gint8(tvb, offset + F5_MEDV3_LENMIN -1); + rstcauselen = tvb_get_int8(tvb, offset + F5_MEDV3_LENMIN -1); /* check size is valid */ if (rstcauselen + F5_MEDV3_LENMIN != trailer_length) { return 0; } if (rstcauselen) - rstcausever = (tvb_get_gint8(tvb, offset + F5_MEDV3_LENMIN) & 0xfe) >>1; + rstcausever = (tvb_get_int8(tvb, offset + F5_MEDV3_LENMIN) & 0xfe) >>1; /* If we want the RST cause in the summary, we need to do it here, * before the tree check below */ if (rstcauselen && rstcause_in_info) { if (rstcausever == 0x00) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "[F5RST%s: %s]", - tvb_get_gint8(tvb, offset + F5_MEDV3_LENMIN) & 0x01 ? "(peer)" : "", + tvb_get_int8(tvb, offset + F5_MEDV3_LENMIN) & 0x01 ? "(peer)" : "", tvb_get_string_enc(pinfo->pool, tvb, offset + F5_MEDV3_LENMIN + 9, rstcauselen - 9, ENC_ASCII)); } @@ -1835,7 +1837,7 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o /* We do not need to do anything more if we don't have a tree and we are not performing * analysis */ - if (pref_perform_analysis == FALSE && tree == NULL) + if (pref_perform_analysis == false && tree == NULL) return trailer_length; o = offset; @@ -1896,10 +1898,10 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o if (rstcauselen) { proto_tree *rc_tree; proto_item *rc_item; - guint64 rstcauseval; - guint64 rstcauseline; - guint startcause; - guint8 rstcausepeer; + uint64_t rstcauseval; + uint64_t rstcauseline; + unsigned startcause; + uint8_t rstcausepeer; rc_item = proto_tree_add_item(tree, hf_rstcause, tvb, o, rstcauselen + 1, ENC_NA); rc_tree = proto_item_add_subtree(rc_item, ett_f5ethtrailer_rstcause); @@ -1909,7 +1911,7 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o startcause = o; switch (rstcausever) { case 0x00: - rstcausepeer = tvb_get_guint8(tvb, o) & 0x1; + rstcausepeer = tvb_get_uint8(tvb, o) & 0x1; proto_tree_add_item(rc_tree, hf_rstcause_ver, tvb, o, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rc_tree, hf_rstcause_peer, tvb, o, 1, ENC_BIG_ENDIAN); @@ -1954,17 +1956,17 @@ dissect_med_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param tdata Pointer to tap data structure * @return Number of btyes consumed */ -static guint -dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offset, - guint8 trailer_length, guint8 trailer_ver, f5eth_tap_data_t *tdata) +static unsigned +dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, + uint8_t trailer_length, uint8_t trailer_ver, f5eth_tap_data_t *tdata) { proto_item *pi = NULL; - guint ingress; - guint o; - guint vipnamelen = VIP_NAME_LEN; - guint slot_display = 0; - gint slot_display_field = -1; - guint tmm; + unsigned ingress; + unsigned o; + unsigned vipnamelen = VIP_NAME_LEN; + unsigned slot_display = 0; + int slot_display_field = -1; + unsigned tmm; switch (trailer_ver) { case 0: @@ -1972,22 +1974,22 @@ dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return 0; } if (trailer_length == F5_LOWV94_LEN) { - slot_display = tvb_get_guint8(tvb, offset + F5_OFF_LOW_SLOT); + slot_display = tvb_get_uint8(tvb, offset + F5_OFF_LOW_SLOT); slot_display_field = hf_slot0; /* Analysis doesn't care about the virtual name, only populate if there is a tap * active */ if (have_tap_listener(tap_f5ethtrailer) - && tvb_get_guint8(tvb, offset + (F5_LOWV94_LEN - 16)) != 0) { + && tvb_get_uint8(tvb, offset + (F5_LOWV94_LEN - 16)) != 0) { tdata->virtual_name = tvb_get_string_enc(pinfo->pool, tvb, offset + (F5_LOWV94_LEN - 16), 16, ENC_ASCII); } } else { - slot_display = tvb_get_guint8(tvb, offset + F5_OFF_LOW_SLOT) + 1; + slot_display = tvb_get_uint8(tvb, offset + F5_OFF_LOW_SLOT) + 1; slot_display_field = hf_slot1; /* Analysis doesn't care about the virtual name, only populate if there is a tap * active */ if (have_tap_listener(tap_f5ethtrailer) - && tvb_get_guint8(tvb, offset + (F5_LOWV10_LEN - 16)) != 0) { + && tvb_get_uint8(tvb, offset + (F5_LOWV10_LEN - 16)) != 0) { tdata->virtual_name = tvb_get_string_enc(pinfo->pool, tvb, offset + (F5_LOWV10_LEN - 16), 16, ENC_ASCII); } @@ -1997,12 +1999,12 @@ dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o if (trailer_length < F5_LOWV1_LENMIN) { /* too small */ return 0; } - vipnamelen = tvb_get_guint8(tvb, offset + F5_LOWV1_LENMIN - 1); + vipnamelen = tvb_get_uint8(tvb, offset + F5_LOWV1_LENMIN - 1); /* check size is valid */ if (vipnamelen + F5_LOWV1_LENMIN != trailer_length) { return 0; } - slot_display = tvb_get_guint8(tvb, offset + F5_OFF_LOW_SLOT) + 1; + slot_display = tvb_get_uint8(tvb, offset + F5_OFF_LOW_SLOT) + 1; slot_display_field = hf_slot1; /* Analysis doesn't care about the virtual name, only populate if there is a tap active */ @@ -2015,9 +2017,9 @@ dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o return 0; } - ingress = tvb_get_guint8(tvb, offset + F5_OFF_LOW_ING); + ingress = tvb_get_uint8(tvb, offset + F5_OFF_LOW_ING); tdata->ingress = ingress == 0 ? 0 : 1; - tmm = tvb_get_guint8(tvb, offset + F5_OFF_LOW_TMM); + tmm = tvb_get_uint8(tvb, offset + F5_OFF_LOW_TMM); if (tmm < F5ETH_TAP_TMM_MAX && slot_display < F5ETH_TAP_SLOT_MAX) { tdata->tmm = tmm; tdata->slot = slot_display; @@ -2030,7 +2032,7 @@ dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o /* We do not need to do anything more if we don't have a tree and we are not performing * analysis and this is not v9.4. If v9.4, need to continue to get flow * information.*/ - if (pref_perform_analysis == FALSE && tree == NULL + if (pref_perform_analysis == false && tree == NULL && !(trailer_length == F5_LOWV94_LEN && trailer_ver == 0 && have_tap_listener(tap_f5ethtrailer))) { return trailer_length; @@ -2095,11 +2097,11 @@ dissect_low_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint o * @param offset Offset into the tvb */ static void -render_f5dptv1_tlvhdr(tvbuff_t *tvb, proto_tree *tree, gint offset) +render_f5dptv1_tlvhdr(tvbuff_t *tvb, proto_tree *tree, int offset) { proto_item *pi = NULL; - guint32 provider; - guint32 type; + uint32_t provider; + uint32_t type; pi = proto_tree_add_item(tree, hf_trailer_hdr, tvb, offset, F5_DPT_V1_TLV_HDR_LEN, ENC_NA); tree = proto_item_add_subtree(pi, ett_f5ethtrailer_trailer_hdr); @@ -2130,10 +2132,10 @@ static int dissect_dpt_trailer_noise_high(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) { proto_item *pi; - gint o; - gint len; - gint ver; - guint8 ipproto; + int o; + int len; + int ver; + uint8_t ipproto; f5eth_tap_data_t *tdata = (f5eth_tap_data_t *)data; DISSECTOR_ASSERT(tdata != NULL); @@ -2167,7 +2169,7 @@ dissect_dpt_trailer_noise_high(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree } /* Add in the high order structures. */ - ipproto = tvb_get_guint8(tvb, o); + ipproto = tvb_get_uint8(tvb, o); proto_tree_add_item(tree, hf_peer_ipproto, tvb, o, 1, ENC_BIG_ENDIAN); o += 1; proto_tree_add_item(tree, hf_peer_vlan, tvb, o, 2, ENC_BIG_ENDIAN); @@ -2175,12 +2177,12 @@ dissect_dpt_trailer_noise_high(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree /* peer remote address */ if (pref_pop_other_fields) { - displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, TRUE); + displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, true); pi = proto_tree_add_item(tree, hf_ip6_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); } - displayIPv6as4(tree, hf_peer_remote_addr, hf_peer_remote_rtdom, tvb, o, FALSE); - displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, TRUE); + displayIPv6as4(tree, hf_peer_remote_addr, hf_peer_remote_rtdom, tvb, o, false); + displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, true); proto_tree_add_item(tree, hf_peer_remote_ip6addr, tvb, o, 16, ENC_NA); pi = proto_tree_add_item(tree, hf_peer_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); @@ -2188,12 +2190,12 @@ dissect_dpt_trailer_noise_high(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree /* peer local address */ if (pref_pop_other_fields) { - displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, TRUE); + displayIPv6as4(tree, hf_ip_ipaddr, -1, tvb, o, true); pi = proto_tree_add_item(tree, hf_ip6_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); } - displayIPv6as4(tree, hf_peer_local_addr, hf_peer_local_rtdom, tvb, o, FALSE); - displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, TRUE); + displayIPv6as4(tree, hf_peer_local_addr, hf_peer_local_rtdom, tvb, o, false); + displayIPv6as4(tree, hf_peer_ipaddr, hf_peer_rtdom, tvb, o, true); proto_tree_add_item(tree, hf_peer_local_ip6addr, tvb, o, 16, ENC_NA); pi = proto_tree_add_item(tree, hf_peer_ip6addr, tvb, o, 16, ENC_NA); proto_item_set_hidden(pi); @@ -2251,12 +2253,12 @@ static int dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *pi; - gint o; + int o; int rstcauselen = 0; int badrstcauselen = 0; - guint rstcausever = 0xff; - gint len; - gint ver; + unsigned rstcausever = 0xff; + int len; + int ver; f5eth_tap_data_t *tdata = (f5eth_tap_data_t *)data; DISSECTOR_ASSERT(tdata != NULL); @@ -2275,7 +2277,7 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre o = F5_DPT_V1_TLV_HDR_LEN; tdata->noise_med = 1; - rstcauselen = tvb_get_guint8(tvb, o + F5_MEDV4_LENMIN - 1); + rstcauselen = tvb_get_uint8(tvb, o + F5_MEDV4_LENMIN - 1); /* Check for an invalid reset cause length and do not try to reference any of the data if it is * bad */ @@ -2285,13 +2287,13 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre rstcauselen = 0; } if (rstcauselen) - rstcausever = (tvb_get_guint8(tvb, o + F5_MEDV4_LENMIN) & 0xfe) >> 1; + rstcausever = (tvb_get_uint8(tvb, o + F5_MEDV4_LENMIN) & 0xfe) >> 1; /* If we want the RST cause in the summary, we need to do it here, * before the tree check below */ if (rstcauselen && rstcause_in_info) { if (rstcausever == 0x00) { col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ", "[F5RST%s: %s]", - tvb_get_guint8(tvb, o + F5_MEDV4_LENMIN) & 0x01 ? "(peer)" : "", + tvb_get_uint8(tvb, o + F5_MEDV4_LENMIN) & 0x01 ? "(peer)" : "", tvb_get_string_enc( pinfo->pool, tvb, o + F5_MEDV4_LENMIN + 9, rstcauselen - 9, ENC_ASCII)); } @@ -2299,7 +2301,7 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* We do not need to do anything more if we don't have a tree and we are not performing * analysis */ - if (pref_perform_analysis == FALSE && tree == NULL) + if (pref_perform_analysis == false && tree == NULL) return len; tdata->flow = tvb_get_ntoh64(tvb, o); @@ -2343,10 +2345,10 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre } else if (rstcauselen) { proto_tree *rc_tree; proto_item *rc_item; - guint64 rstcauseval; - guint64 rstcauseline; - guint startcause; - guint8 rstcausepeer; + uint64_t rstcauseval; + uint64_t rstcauseline; + unsigned startcause; + uint8_t rstcausepeer; rc_item = proto_tree_add_item(tree, hf_rstcause, tvb, o, rstcauselen + 1, ENC_NA); rc_tree = proto_item_add_subtree(rc_item, ett_f5ethtrailer_rstcause); @@ -2356,7 +2358,7 @@ dissect_dpt_trailer_noise_med(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre startcause = o; switch (rstcausever) { case 0x00: - rstcausepeer = tvb_get_guint8(tvb, o) & 0x1; + rstcausepeer = tvb_get_uint8(tvb, o) & 0x1; proto_tree_add_item(rc_tree, hf_rstcause_ver, tvb, o, 1, ENC_BIG_ENDIAN); proto_tree_add_item(rc_tree, hf_rstcause_peer, tvb, o, 1, ENC_BIG_ENDIAN); o += 1; @@ -2406,15 +2408,15 @@ static const value_string f5_obj_data_types[] = { static int dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - gint len; - gint ver; + int len; + int ver; proto_item *pi; proto_item *ti; - gint offset; - guint flags; - guint ingress; - guint slot_display = 0; - guint tmm; + int offset; + unsigned flags; + unsigned ingress; + unsigned slot_display = 0; + unsigned tmm; f5eth_tap_data_t *tdata = (f5eth_tap_data_t *)data; DISSECTOR_ASSERT(tdata != NULL); @@ -2436,7 +2438,7 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre tdata->noise_low = 1; /* Direction */ - flags = tvb_get_guint8(tvb, offset); + flags = tvb_get_uint8(tvb, offset); if (ver == 2) { ingress = flags; } else { @@ -2450,7 +2452,7 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre tfs_get_string(ingress, &f5tfs_ing)); if (ver > 2) { /* The old ingress field is now a flag field. Leave the old ingress field - * for backward compatability for users that are accustomed to using + * for backward compatibility for users that are accustomed to using * "f5ethtrailer.ingress" but mark it as generated to indicate that that * field no longer really exists. */ proto_item_set_generated(pi); @@ -2462,12 +2464,12 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre offset += 1; /* Slot */ - slot_display = tvb_get_guint8(tvb, offset) + 1; + slot_display = tvb_get_uint8(tvb, offset) + 1; proto_tree_add_uint(tree, hf_slot1, tvb, offset, 1, slot_display); offset += 1; /* TMM */ - tmm = tvb_get_guint8(tvb, offset); + tmm = tvb_get_uint8(tvb, offset); if (tmm < F5ETH_TAP_TMM_MAX && slot_display < F5ETH_TAP_SLOT_MAX) { tdata->tmm = tmm; tdata->slot = slot_display; @@ -2482,7 +2484,7 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre if (ver < 4) { /* Low noise versions 2 and 3 */ /* VIP Name */ - gint viplen = tvb_get_guint8(tvb, offset); + int viplen = tvb_get_uint8(tvb, offset); /* Make sure VIP Name Length does not extend past the TVB */ if (tvb_reported_length_remaining(tvb, offset) < viplen) { pi = proto_tree_add_item(tree, hf_vip, tvb, offset, 0, ENC_ASCII); @@ -2490,7 +2492,7 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* Cannot go any further */ return len; } - gchar *text = tvb_format_text(pinfo->pool, tvb, offset +1, viplen); + char *text = tvb_format_text(pinfo->pool, tvb, offset +1, viplen); ti = proto_tree_add_subtree_format( tree, tvb, offset, viplen + 1, ett_f5ethtrailer_obj_names, NULL, "Virtual Server: %s", text); @@ -2519,7 +2521,7 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre * <type><len><string><type><len><string> */ - gint data_len = tvb_get_gint8(tvb, offset); + int data_len = tvb_get_int8(tvb, offset); pi = proto_tree_add_item(tree, hf_data, tvb, offset, 1, ENC_NA); proto_item_set_text(pi, "Associated config object names"); ti = proto_item_add_subtree(pi, ett_f5ethtrailer_obj_names); @@ -2534,14 +2536,14 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* Begin parsing the data field and adding items for the strings contained */ tvbuff_t *data_tvb = tvb_new_subset_length(tvb, offset, data_len); - gint data_off = 0; + int data_off = 0; while (data_off < data_len) { - gint field_name_len_idx; - gint field_name_idx; - gchar *text_format; - guint8 t = tvb_get_guint8(data_tvb, data_off); - guint8 l = tvb_get_guint8(data_tvb, data_off + 1); + int field_name_len_idx; + int field_name_idx; + char *text_format; + uint8_t t = tvb_get_uint8(data_tvb, data_off); + uint8_t l = tvb_get_uint8(data_tvb, data_off + 1); switch (t) { case 0: /* Virtual Server */ @@ -2579,7 +2581,7 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre /* Cannot go any further */ return len; } - gchar *text = tvb_format_text(pinfo->pool, data_tvb, data_off + 2, l); + char *text = tvb_format_text(pinfo->pool, data_tvb, data_off + 2, l); ti = proto_tree_add_subtree_format( tree, data_tvb, data_off, l + 2, ett_f5ethtrailer_obj_names, NULL, text_format, text); @@ -2612,11 +2614,11 @@ dissect_dpt_trailer_noise_low(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre static int dissect_dpt_trailer_noise(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint32 pattern; + uint32_t pattern; pattern = tvb_get_ntohs(tvb, F5_DPT_V1_TLV_TYPE_OFF) << 16 | tvb_get_ntohs(tvb, F5_DPT_V1_TLV_VERSION_OFF); return ( - dissector_try_uint_new(noise_subdissector_table, pattern, tvb, pinfo, tree, FALSE, data)); + dissector_try_uint_new(noise_subdissector_table, pattern, tvb, pinfo, tree, false, data)); } /* dissect_dpt_trailer_noise() */ /*---------------------------------------------------------------------------*/ @@ -2633,7 +2635,7 @@ static int dissect_dpt_trailer_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *pi; - gint len; + int len; len = tvb_get_ntohs(tvb, F5_DPT_V1_TLV_LENGTH_OFF); @@ -2669,9 +2671,9 @@ dissect_dpt_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d { proto_item *pi; proto_tree *hdr_tree; - gint dpt_len; - gint dpt_ver; - gint o; /* offset*/ + int dpt_len; + int dpt_ver; + int o; /* offset*/ dpt_len = tvb_get_ntohs(tvb, F5_DPT_V1_HDR_LENGTH_OFF); dpt_ver = tvb_get_ntohs(tvb, F5_DPT_V1_HDR_VERSION_OFF); @@ -2699,8 +2701,8 @@ dissect_dpt_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d while (tvb_reported_length_remaining(tvb, o) >= F5_DPT_V1_TLV_HDR_LEN) { tvbuff_t *tvb_dpt_tlv; - gint tvb_dpt_tlv_len; - gint provider_id; + int tvb_dpt_tlv_len; + int provider_id; tvb_dpt_tlv_len = tvb_get_ntohs(tvb, o + F5_DPT_V1_TLV_LENGTH_OFF); /* Report an error if the length specified in the header is either @@ -2731,7 +2733,7 @@ dissect_dpt_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d provider_id = tvb_get_ntohs(tvb, o + F5_DPT_V1_TLV_PROVIDER_OFF); tvb_dpt_tlv = tvb_new_subset_length(tvb, o, tvb_dpt_tlv_len); if (dissector_try_uint_new( - provider_subdissector_table, provider_id, tvb_dpt_tlv, pinfo, tree, FALSE, data) + provider_subdissector_table, provider_id, tvb_dpt_tlv, pinfo, tree, false, data) == 0) { /* Render the TLV header as unknown */ dissect_dpt_trailer_unknown(tvb_dpt_tlv, pinfo, tree, data); @@ -2750,12 +2752,12 @@ dissect_dpt_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d * @param pinfo The pinfo structure for the frame * @param tree The tree to render the thrailer under * @param data Pointer to tdata for the trailer - * @return gint Number of bytes cosumed by the dissector + * @return int Number of bytes cosumed by the dissector */ -static gint +static int dissect_old_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { - guint offset = 0; + unsigned offset = 0; /* While we still have data in the trailer. For old format trailers, this needs * type, length, version (3 bytes) and for new format trailers, the magic header (4 bytes). @@ -2763,20 +2765,20 @@ dissect_old_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d */ while (tvb_reported_length_remaining(tvb, offset) >= F5_MIN_SANE) { /* length field does not include the type and length bytes. Add them back in */ - guint8 len = tvb_get_guint8(tvb, offset + F5_OFF_LENGTH) + F5_OFF_VERSION; + uint8_t len = tvb_get_uint8(tvb, offset + F5_OFF_LENGTH) + F5_OFF_VERSION; if (len > tvb_reported_length_remaining(tvb, offset) || len < F5_MIN_SANE || len > F5_MAX_SANE) { /* Invalid length - either a malformed trailer, corrupt packet, or not f5ethtrailer */ return offset; } - guint8 type = tvb_get_guint8(tvb, offset); - guint8 ver = tvb_get_guint8(tvb, offset + F5_OFF_VERSION); + uint8_t type = tvb_get_uint8(tvb, offset); + uint8_t ver = tvb_get_uint8(tvb, offset + F5_OFF_VERSION); /* Parse out the specified trailer. */ proto_tree *type_tree = NULL; proto_item *ti = NULL; f5eth_tap_data_t *tdata = (f5eth_tap_data_t *)data; - guint processed = 0; + unsigned processed = 0; switch (type) { case F5TYPE_LOW: @@ -2832,7 +2834,7 @@ dissect_old_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d * @param pinfo The pinfo structure for the frame * @param tree The tree to render the thrailer under * @param data Pointer to tdata for the trailer - * @return gint Number of bytes cosumed by the dissector + * @return int Number of bytes cosumed by the dissector * * New format trailers (BIG-IP 14.0 and later) begin with * 4-byte magic number (0xf5deb0f5) @@ -2856,10 +2858,10 @@ dissect_old_trailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *d static int dissect_f5ethtrailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint trailer_length; - guint offset = 0; + unsigned trailer_length; + unsigned offset = 0; found_t found = NONE; - gboolean has_fcs = FALSE; + bool has_fcs = false; if (tvb_reported_length(tvb) != tvb_captured_length(tvb)) { /* The trailers are really only helpful if we have the entire trailer. If we @@ -2871,7 +2873,7 @@ dissect_f5ethtrailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * was able to append f5ethtrailer. In many cases (and should be) this padding is zeros. The f5ethtrailer does not start with a zero, so trim off any leading zeros before looking for an f5ethtrailer. */ - while (tvb_offset_exists(tvb, offset) && tvb_get_gint8(tvb, offset) == 0) { + while (tvb_offset_exists(tvb, offset) && tvb_get_int8(tvb, offset) == 0) { offset++; } @@ -2905,13 +2907,13 @@ dissect_f5ethtrailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * common and likely wouldn't have been added after FCS anyway. If needed, the walk trailer prefernce would find the old format trailer after an FCS. This seems reasonable enough for old format trailers. */ - for (guint i = 0; i <= offset && i <= 4; i++) { + for (unsigned i = 0; i <= offset && i <= 4; i++) { if (tvb_get_ntohl(tvb, offset + 4 - i) == F5_DPT_V1_HDR_MAGIC) { if (tvb_get_ntohs(tvb, offset + 4 - i + F5_DPT_V1_HDR_LENGTH_OFF) > trailer_length) { return 0; } found = NEW_FORMAT; - has_fcs = TRUE; + has_fcs = true; offset += 4 - i; goto found_trailer; } @@ -2919,12 +2921,12 @@ dissect_f5ethtrailer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void * } /* Not new format? Are we old format? */ - guint tlv_type, tlv_length, tlv_ver; + unsigned tlv_type, tlv_length, tlv_ver; /* Check for old format trailers */ - tlv_type = tvb_get_guint8(tvb, offset); - tlv_length = tvb_get_guint8(tvb, offset + F5_OFF_LENGTH) + F5_OFF_VERSION; - tlv_ver = tvb_get_guint8(tvb, offset + F5_OFF_VERSION); + tlv_type = tvb_get_uint8(tvb, offset); + tlv_length = tvb_get_uint8(tvb, offset + F5_OFF_LENGTH) + F5_OFF_VERSION; + tlv_ver = tvb_get_uint8(tvb, offset + F5_OFF_VERSION); if ( tlv_length <= trailer_length && tlv_type >= F5TYPE_LOW && tlv_type <= F5TYPE_HIGH && tlv_length >= F5_MIN_SANE && tlv_length <= F5_MAX_SANE && @@ -3007,6 +3009,12 @@ found_trailer: return trailer_length; } /* dissect_f5ethtrailer() */ +static bool +dissect_f5ethtrailer_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) +{ + return dissect_f5ethtrailer(tvb, pinfo, tree, data) > 0; +} + /*-----------------------------------------------------------------------------------------------*/ /* Begin DPT TLS provider */ /*-----------------------------------------------------------------------------------------------*/ @@ -3049,8 +3057,8 @@ found_trailer: #define F5TLS_T2V1_LEN 393 typedef struct _F5TLS_ELEMENT { - guchar *data; /* Pointer to a string of bytes wmem_file_scope allocated as needed. */ - gint len; /* length of the item stored. */ + unsigned char *data; /* Pointer to a string of bytes wmem_file_scope allocated as needed. */ + int len; /* length of the item stored. */ } f5tls_element_t; /* @@ -3073,13 +3081,13 @@ typedef struct _F5TLS_CONVERSATION_DATA { * keylog entries to a unique list. */ typedef struct _F5TLS_PACKET_DATA { - gchar *cr_ms; + char *cr_ms; /* TLS 1.3 keylogs */ - gchar *cr_erly_traff; - gchar *cr_clnt_app; - gchar *cr_srvr_app; - gchar *cr_clnt_hs; - gchar *cr_srvr_hs; + char *cr_erly_traff; + char *cr_clnt_app; + char *cr_srvr_app; + char *cr_clnt_hs; + char *cr_srvr_hs; } f5tls_packet_data_t; typedef struct _F5TLS_DATA { @@ -3087,27 +3095,27 @@ typedef struct _F5TLS_DATA { f5tls_packet_data_t *pkt; } f5tls_data_t; -static int proto_f5ethtrailer_dpt_tls = -1; +static int proto_f5ethtrailer_dpt_tls; -static gint hf_f5tls_tls = -1; +static int hf_f5tls_tls; /* TLS 1.x fields */ -static gint hf_f5tls_secret_len = -1; -static gint hf_f5tls_mstr_sec = -1; -static gint hf_f5tls_clnt_rand = -1; -static gint hf_f5tls_srvr_rand = -1; +static int hf_f5tls_secret_len; +static int hf_f5tls_mstr_sec; +static int hf_f5tls_clnt_rand; +static int hf_f5tls_srvr_rand; /* TLS 1.3 fields */ -static gint hf_f5tls_early_traffic_sec = -1; -static gint hf_f5tls_clnt_hs_sec = -1; -static gint hf_f5tls_srvr_hs_sec = -1; -static gint hf_f5tls_clnt_app_sec = -1; -static gint hf_f5tls_srvr_app_sec = -1; -static gint hf_f5tls_keylog = -1; +static int hf_f5tls_early_traffic_sec; +static int hf_f5tls_clnt_hs_sec; +static int hf_f5tls_srvr_hs_sec; +static int hf_f5tls_clnt_app_sec; +static int hf_f5tls_srvr_app_sec; +static int hf_f5tls_keylog; -static gint ett_f5tls = -1; -static gint ett_f5tls_std = -1; -static gint ett_f5tls_ext = -1; +static int ett_f5tls; +static int ett_f5tls_std; +static int ett_f5tls_ext; static dissector_table_t tls_subdissector_table; @@ -3125,7 +3133,7 @@ typedef enum { * looks like the best way to do it. So, create a single, global field of zeros at file scope. * That should cut down on some overhead... */ -static guchar f5tls_zeros[F5TLS_ZEROS_LEN]; +static unsigned char f5tls_zeros[F5TLS_ZEROS_LEN]; /*-----------------------------------------------------------------------*/ /** Get a null terminated hexstring of a byte array @@ -3133,15 +3141,15 @@ static guchar f5tls_zeros[F5TLS_ZEROS_LEN]; * @param scope scope of the wmem allocate buffer * @param ba The byte aray to convert to a hexstring * @param ba_len Number of bytes to convert - * @return Null terminated gchar* wmem allocated - no need to free + * @return Null terminated char* wmem allocated - no need to free */ -static gchar * -f5eth_bytes_to_hexstrnz(wmem_allocator_t *scope, const guchar *ba, gint ba_len) +static char * +f5eth_bytes_to_hexstrnz(wmem_allocator_t *scope, const unsigned char *ba, int ba_len) { - gchar *hexstr; - gchar *end; + char *hexstr; + char *end; - hexstr = (gchar *)wmem_alloc(scope, ba_len * 2 + 1); + hexstr = (char *)wmem_alloc(scope, ba_len * 2 + 1); end = bytes_to_hexstr(hexstr, ba, ba_len); *end = '\0'; return hexstr; @@ -3159,11 +3167,11 @@ f5eth_bytes_to_hexstrnz(wmem_allocator_t *scope, const guchar *ba, gint ba_len) * @param yyyy Second crypto element in the keylog record (see above) * @return Null terminated keylog record wmem allocated with file scope */ -static gchar * +static char * f5eth_add_tls_keylog(packet_info *pinfo, keylog_t keylog_type, f5tls_element_t *xxxx, f5tls_element_t *yyyy) { - gchar *xxxx_hex; - gchar *yyyy_hex; + char *xxxx_hex; + char *yyyy_hex; xxxx_hex = f5eth_bytes_to_hexstrnz(pinfo->pool, xxxx->data, xxxx->len); yyyy_hex = f5eth_bytes_to_hexstrnz(pinfo->pool, yyyy->data, yyyy->len); @@ -3202,25 +3210,25 @@ f5eth_add_tls_keylog(packet_info *pinfo, keylog_t keylog_type, f5tls_element_t * * @param len Length of byte string to convert from the tvb * @return Is the entry different than previously seen */ -static gboolean +static bool f5eth_add_tls_element( - f5tls_element_t *element, packet_info *pinfo _U_, tvbuff_t *tvb, guint offset, gint len) + f5tls_element_t *element, packet_info *pinfo _U_, tvbuff_t *tvb, unsigned offset, int len) { if (element == NULL || len <= 0 || tvb_memeql(tvb, offset, f5tls_zeros, len) == 0) { /* Nothing to do */ - return FALSE; + return false; } if (element->len == len && tvb_memeql(tvb, offset, element->data, len) == 0) { /* unchanged */ - return FALSE; + return false; } /* Populate the element structure */ - element->data = (guchar *)wmem_realloc(wmem_file_scope(), element->data, len); + element->data = (unsigned char *)wmem_realloc(wmem_file_scope(), element->data, len); element->len = len; tvb_memcpy(tvb, element->data, offset, len); - return TRUE; + return true; } /* f5eth_add_tls_element() */ @@ -3237,9 +3245,9 @@ static int dissect_dpt_trailer_tls_type0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *pi; - gint len; - gint ver; - gint o; + int len; + int ver; + int o; f5tls_conversation_data_t *conv_data = NULL; f5tls_packet_data_t *pdata = NULL; @@ -3275,7 +3283,7 @@ dissect_dpt_trailer_tls_type0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre Assume that by the time the master secret is processed, the client random is available on the conversation data. */ if (!pinfo->fd->visited) { - gboolean ms_changed; + bool ms_changed; ms_changed = f5eth_add_tls_element( &conv_data->master_secret, pinfo, tvb, F5_DPT_V1_TLV_HDR_LEN, F5TLS_SECRET_LEN); @@ -3315,10 +3323,10 @@ static int dissect_dpt_trailer_tls_type2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) { proto_item *pi; - gint len; - gint ver; - gint o; - gint secret_len; + int len; + int ver; + int o; + int secret_len; f5tls_conversation_data_t *conv_data = NULL; f5tls_packet_data_t *pdata = NULL; @@ -3336,7 +3344,7 @@ dissect_dpt_trailer_tls_type2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre o = F5_DPT_V1_TLV_HDR_LEN; - secret_len = tvb_get_guint8(tvb, o); + secret_len = tvb_get_uint8(tvb, o); /* Add our fields */ pi = proto_tree_add_item(tree, hf_f5tls_secret_len, tvb, o, 1, ENC_NA); o += 1; @@ -3378,11 +3386,11 @@ dissect_dpt_trailer_tls_type2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre Assume that if a CRand exists on the conversation that it is the one that matches up with the newly set / changed secret. */ if (!pinfo->fd->visited) { - gboolean ets_changed = FALSE; - gboolean chs_changed = FALSE; - gboolean shs_changed = FALSE; - gboolean cap_changed = FALSE; - gboolean sap_changed = FALSE; + bool ets_changed = false; + bool chs_changed = false; + bool shs_changed = false; + bool cap_changed = false; + bool sap_changed = false; o = F5_DPT_V1_TLV_HDR_LEN + 1; @@ -3477,7 +3485,7 @@ dissect_dpt_trailer_tls_extended( tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *pi; - gint len; + int len; len = tvb_get_ntohs(tvb, F5_DPT_V1_TLV_LENGTH_OFF); @@ -3507,7 +3515,7 @@ dissect_dpt_trailer_tls_extended( static int dissect_dpt_trailer_tls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint32 pattern; + uint32_t pattern; conversation_t *conv = NULL; f5tls_data_t *tls_data = NULL; @@ -3534,11 +3542,11 @@ dissect_dpt_trailer_tls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi } } - /* Combine 2 byte TYPE with 2 byte VERSION into guint32 for the subdissector table lookup */ + /* Combine 2 byte TYPE with 2 byte VERSION into uint32_t for the subdissector table lookup */ pattern = tvb_get_ntohs(tvb, F5_DPT_V1_TLV_TYPE_OFF) << 16 | tvb_get_ntohs(tvb, F5_DPT_V1_TLV_VERSION_OFF); return ( - dissector_try_uint_new(tls_subdissector_table, pattern, tvb, pinfo, tree, FALSE, tls_data)); + dissector_try_uint_new(tls_subdissector_table, pattern, tvb, pinfo, tree, false, tls_data)); } /* dissect_f5dpt_tls() */ /*-----------------------------------------------------------------------------------------------*/ @@ -3552,11 +3560,11 @@ dissect_dpt_trailer_tls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi static void proto_init_f5ethtrailer(void) { - /** Need to set display_slot to TRUE when initially reading a capture. This covers the + /** Need to set display_slot to true when initially reading a capture. This covers the * situation when a user loads a capture that turns off slot display and then loads a * different capture that contains trailers, but does not have the F5INFO frame. In this * case, we need to turn the slot display back on. */ - display_slot = TRUE; + display_slot = true; /* Set the info column function to use based on whether or not an in/out only * preference is chosen. */ switch (pref_info_type) { @@ -3579,7 +3587,7 @@ proto_init_f5ethtrailer(void) ws_warning("Unable to register tap \"ip\" for f5ethtrailer: %s", error_string->str); g_string_free(error_string, TRUE); } else { - tap_ip_enabled = TRUE; + tap_ip_enabled = true; } error_string = register_tap_listener( "ipv6", &tap_ipv6_enabled, NULL, TL_REQUIRES_NOTHING, NULL, ipv6_tap_pkt, NULL, NULL); @@ -3587,7 +3595,7 @@ proto_init_f5ethtrailer(void) ws_warning("Unable to register tap \"ipv6\" for f5ethtrailer: %s", error_string->str); g_string_free(error_string, TRUE); } else { - tap_ipv6_enabled = TRUE; + tap_ipv6_enabled = true; } error_string = register_tap_listener( "tcp", &tap_tcp_enabled, NULL, TL_REQUIRES_NOTHING, NULL, tcp_tap_pkt, NULL, NULL); @@ -3595,7 +3603,7 @@ proto_init_f5ethtrailer(void) ws_warning("Unable to register tap \"tcp\" for f5ethtrailer: %s", error_string->str); g_string_free(error_string, TRUE); } else { - tap_tcp_enabled = TRUE; + tap_tcp_enabled = true; } } } @@ -3609,15 +3617,15 @@ f5ethtrailer_cleanup(void) { if (tap_tcp_enabled) { remove_tap_listener(&tap_tcp_enabled); - tap_tcp_enabled = FALSE; + tap_tcp_enabled = false; } if (tap_ipv6_enabled) { remove_tap_listener(&tap_ipv6_enabled); - tap_ipv6_enabled = FALSE; + tap_ipv6_enabled = false; } if (tap_ip_enabled) { remove_tap_listener(&tap_ip_enabled); - tap_ip_enabled = FALSE; + tap_ip_enabled = false; } } @@ -3906,7 +3914,7 @@ proto_register_f5ethtrailer(void) }, { &hf_peer_rtdom, { "Peer remote or local route domain", "f5ethtrailer.peerrtdom", FT_UINT16, - BASE_DEC, NULL, 0x0, "Peer route domain", HFILL } + BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_peer_remote_port, { "Peer remote port", "f5ethtrailer.peerremoteport", FT_UINT16, BASE_DEC, @@ -3918,7 +3926,7 @@ proto_register_f5ethtrailer(void) }, { &hf_peer_port, { "Peer remote or local port", "f5ethtrailer.peerport", FT_UINT16, BASE_DEC, - NULL, 0x0, "Peer port", HFILL } + NULL, 0x0, NULL, HFILL } }, { &hf_peer_nopeer, { "No peer connection information", "f5ethtrailer.nopeer", FT_NONE, BASE_NONE, @@ -3991,7 +3999,7 @@ proto_register_f5ethtrailer(void) }, }; - static gint *ett[] = { + static int *ett[] = { &ett_f5ethtrailer, &ett_f5ethtrailer_unknown, &ett_f5ethtrailer_low, @@ -4066,7 +4074,7 @@ proto_register_f5ethtrailer(void) "In/out only removes slot/tmm information. Brief shortens the string" " to >S/T (for in) or <S/T (for out). See \"Brief in/out characters\"" " below.", - (guint *)&pref_info_type, f5eth_display_strings, TRUE); + (unsigned *)&pref_info_type, f5eth_display_strings, true); prefs_register_string_preference(f5ethtrailer_module, "brief_inout_chars", "Brief in/out characters", @@ -4146,7 +4154,7 @@ proto_register_f5ethtrailer(void) void proto_reg_handoff_f5ethtrailer(void) { - heur_dissector_add("eth.trailer", dissect_f5ethtrailer, "F5 Ethernet Trailer", + heur_dissector_add("eth.trailer", dissect_f5ethtrailer_heur, "F5 Ethernet Trailer", "f5ethtrailer", proto_f5ethtrailer, HEURISTIC_ENABLE); /* Register helper dissectors */ @@ -4291,36 +4299,36 @@ static const string_string f5info_platform_strings[] = { * dissectors have a chance to dissect (and the Ethernet dissector does not * waste its time rendering Ethernet information for no reason). * - * TODO: This should return gint with how many bytes were consumed. + * TODO: This should return int with how many bytes were consumed. * * @param tvb Pointer to tvb * @param pinfo Pointer to packet info * @param tree Pointer to protocol tree * @param data Pointer to data structure (unused) - * @return gboolean + * @return bool */ -static gboolean +static bool dissect_f5fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint offset = 0; - const guint8 *object; - const gchar *platform = NULL; - const gchar *platform_name = NULL; - gint objlen; + unsigned offset = 0; + const uint8_t *object; + const char *platform = NULL; + const char *platform_name = NULL; + int objlen; struct f5fileinfo_tap_data *tap_data; /* Must be the first packet */ if (pinfo->fd->num > 1) - return FALSE; + return false; - if (tvb_captured_length(tvb) >= (gint)sizeof(fileinfomagic1)) { + if (tvb_captured_length(tvb) >= (int)sizeof(fileinfomagic1)) { if (tvb_memeql(tvb, 0, fileinfomagic1, sizeof(fileinfomagic1)) == 0) offset = sizeof(fileinfomagic1); } /* Didn't find the magic at the start of the packet. */ if (offset == 0) - return FALSE; + return false; col_set_str(pinfo->cinfo, COL_PROTOCOL, "FILEINFO"); @@ -4328,7 +4336,7 @@ dissect_f5fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da tap_data->magic = F5FILEINFO_TAP_MAGIC; while (tvb_captured_length_remaining(tvb, offset)) { - object = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &objlen, ENC_ASCII); + object = tvb_get_stringz_enc(pinfo->pool, tvb, offset, &objlen, ENC_ASCII); if (objlen <= 0 || object == NULL) break; @@ -4337,8 +4345,8 @@ dissect_f5fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_string(tree, hf_fi_command, tvb, offset + 5, objlen - 5, &object[5]); col_add_str(pinfo->cinfo, COL_INFO, &object[5]); } else if (strncmp(object, "VER: ", 5) == 0) { - guint i; - const guint8 *c; + unsigned i; + const uint8_t *c; proto_tree_add_string(tree, hf_fi_version, tvb, offset + 5, objlen - 5, &object[5]); for (c = object; *c && (*c < '0' || *c > '9'); c++); @@ -4359,13 +4367,15 @@ dissect_f5fileinfo(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da "%s: %s", platform, platform_name); } else if (strncmp(object, "PROD: ", 6) == 0) proto_tree_add_string(tree, hf_fi_product, tvb, offset + 6, objlen - 6, &object[6]); + else if (strncmp(object, "SESS: ", 6) == 0) + proto_tree_add_string(tree, hf_fi_session, tvb, offset + 6, objlen - 6, &object[6]); offset += objlen; } tvb_set_reported_length(tvb, offset); tap_queue_packet(tap_f5fileinfo, pinfo, tap_data); f5eth_process_f5info(platform); - return TRUE; + return true; } /* dissect_f5fileinfo() */ /** @@ -4400,6 +4410,10 @@ proto_register_f5fileinfo(void) { "Platform product", "f5fileinfo.product", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_fi_session, + { "Session", "f5fileinfo.session", FT_STRINGZ, BASE_NONE, + NULL, 0x0, NULL, HFILL } + }, }; proto_f5fileinfo = proto_register_protocol("F5 Capture Information", "FILEINFO", "f5fileinfo"); |