forked from osmocom/wireshark
Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of having each caller cast its private data to (void**), we use void* in the uat_new() API itself. Inside uat_new(), we cast the void* to void**. Some dissectors use val64_string arrays, so a VALS64() macro was added for those, to avoid using VALS(), which is useful only for value_string arrays. packet-mq.c was changed because dissect_nt_sid() requires a char**, not a guint**. All other callers of dissect_nt_sid() use char*'s (and take the address of it) for their local storage. So, this was changed to follow the other practices. A confusion between gint and absolute_time_display_e in packet-time.c was cleared up. The ugliest fix is the addition of ip6_guint8_to_str(), for exactly one caller. The caller uses one type of ip6 address byte array, while ip6_to_str() expects another. This new function is in place until the various address implementations can be consolidated. Add VALS64() to the developer documentation. Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805 Reviewed-on: https://code.wireshark.org/review/48 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
parent
479d27c69e
commit
4cc694839d
|
@ -140,7 +140,7 @@ FIELDDISPLAY --For FT_UINT{8,16,24,32,64} and FT_INT{8,16,24,32,64):
|
|||
--For all other types:
|
||||
|
||||
BASE_NONE
|
||||
FIELDCONVERT VALS(x), RVALS(x), TFS(x), NULL
|
||||
FIELDCONVERT VALS(x), VALS64(x), RVALS(x), TFS(x), NULL
|
||||
BITMASK Used to mask a field not 8-bit aligned or with a size other
|
||||
than a multiple of 8 bits
|
||||
FIELDDESCR A brief description of the field, or NULL. [Please do not use ""].
|
||||
|
@ -873,6 +873,12 @@ For hf[] array FT_(U)INT* fields that need a 'valstringname_ext' struct, the
|
|||
'strings' field would be set to '&valstringname_ext'. Furthermore, the 'display'
|
||||
field must be ORed with 'BASE_EXT_STRING' (e.g. BASE_DEC|BASE_EXT_STRING).
|
||||
|
||||
-- val64_string
|
||||
|
||||
val64_strings are like value_strings, except that the integer type
|
||||
used is a guint64 (instead of guint32). Instead of using the VALS()
|
||||
macro for the 'strings' field in the header_field_info struct array,
|
||||
'VALS64()' is used.
|
||||
|
||||
-- Ranges
|
||||
If the field has a numeric type that might logically fit in ranges of values
|
||||
|
|
|
@ -64,6 +64,9 @@
|
|||
#include "emem.h"
|
||||
#include "wmem/wmem.h"
|
||||
|
||||
static void
|
||||
ip6_to_str_buf_len(const guchar* src, char *buf, size_t buf_len);
|
||||
|
||||
/*
|
||||
* If a user _does_ pass in a too-small buffer, this is probably
|
||||
* going to be too long to fit. However, even a partial string
|
||||
|
@ -125,6 +128,20 @@ ip6_to_str(const struct e_in6_addr *ad) {
|
|||
ip6_to_str_buf(ad, str);
|
||||
return str;
|
||||
}
|
||||
/* XXX FIXME
|
||||
This exists solely for a single call from ui/iface_lists.c,
|
||||
scan_local_interfaces(), and gcc's -fstrict-aliasing. The iface_lists.c
|
||||
code should be change to used a different type for its ip6 address,
|
||||
so that this function is no longer needed.
|
||||
*/
|
||||
const gchar *
|
||||
ip6_guint8_to_str(const guint8 *ad) {
|
||||
gchar *str;
|
||||
|
||||
str=(gchar *)ep_alloc(MAX_IP6_STR_LEN);
|
||||
ip6_to_str_buf_len((const guchar*)ad, str, MAX_IP6_STR_LEN);
|
||||
return str;
|
||||
}
|
||||
|
||||
#define IPV6_LENGTH 16
|
||||
const gchar *
|
||||
|
|
|
@ -614,7 +614,7 @@ void dfilter_macro_init(void) {
|
|||
sizeof(dfilter_macro_t),
|
||||
DFILTER_MACRO_FILENAME,
|
||||
TRUE,
|
||||
(void**) ¯os,
|
||||
¯os,
|
||||
&num_macros,
|
||||
0, /* doesn't affect anything that requires a GUI update */
|
||||
"ChDisplayFilterMacrosSection",
|
||||
|
|
|
@ -5411,7 +5411,7 @@ proto_register_ber(void)
|
|||
sizeof(oid_user_t),
|
||||
"oid",
|
||||
FALSE,
|
||||
(void**) &oid_users,
|
||||
&oid_users,
|
||||
&num_oid_users,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChObjectIdentifiers",
|
||||
|
|
|
@ -6620,7 +6620,7 @@ proto_register_bgp(void)
|
|||
BASE_DEC, VALS(link_state_nlri_protocol_id_values), 0x0, NULL, HFILL }},
|
||||
{ &hf_bgp_ls_nlri_node_identifier,
|
||||
{ "Identifier", "bgp.ls.nlri_node.identifier", FT_UINT64,
|
||||
BASE_DEC | BASE_VAL64_STRING, VALS(link_state_nlri_routing_universe_values), 0x0, NULL, HFILL }},
|
||||
BASE_DEC | BASE_VAL64_STRING, VALS64(link_state_nlri_routing_universe_values), 0x0, NULL, HFILL }},
|
||||
{ &hf_bgp_ls_ipv4_topology_prefix_nlri_type,
|
||||
{ "Link-State NLRI IPv4 Topology Prefix", "bgp.ls.ipv4_topology_prefix", FT_NONE,
|
||||
BASE_NONE, NULL, 0x0, NULL, HFILL}},
|
||||
|
|
|
@ -6984,7 +6984,7 @@ proto_register_bootp(void)
|
|||
sizeof(uat_bootp_record_t), /* record size */
|
||||
"custom_bootp", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &uat_bootp_records,/* data_ptr */
|
||||
&uat_bootp_records, /* data_ptr */
|
||||
&num_bootp_records_uat, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -1084,7 +1084,7 @@ proto_register_btrfcomm(void)
|
|||
sizeof(uat_rfcomm_channels_t),
|
||||
"rfcomm_channels",
|
||||
TRUE,
|
||||
(void**) &rfcomm_channels,
|
||||
&rfcomm_channels,
|
||||
&num_rfcomm_channels,
|
||||
UAT_AFFECTS_DISSECTION,
|
||||
NULL,
|
||||
|
|
|
@ -2037,7 +2037,7 @@ void proto_register_c1222(void) {
|
|||
sizeof(c1222_uat_data_t), /* record size */
|
||||
"c1222_decryption_table", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**)&c1222_uat_data, /* data_ptr */
|
||||
&c1222_uat_data, /* data_ptr */
|
||||
&num_c1222_uat_data, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -1460,7 +1460,7 @@ void proto_register_collectd(void)
|
|||
},
|
||||
{ &hf_collectd_data_severity,
|
||||
{ "Severity", "collectd.data.severity", FT_UINT64, BASE_HEX | BASE_VAL64_STRING,
|
||||
VALS(severity_names),
|
||||
VALS64(severity_names),
|
||||
0x0, NULL, HFILL }
|
||||
},
|
||||
{ &hf_collectd_data_message,
|
||||
|
|
|
@ -1021,7 +1021,7 @@ void proto_register_devicenet(void)
|
|||
sizeof(uat_devicenet_record_t), /* record size */
|
||||
"devicenet_bodytypes", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &uat_devicenet_records,/* data_ptr */
|
||||
&uat_devicenet_records, /* data_ptr */
|
||||
&num_devicenet_records_uat, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -4916,7 +4916,7 @@ void proto_register_dmp (void)
|
|||
sizeof(dmp_security_class_t),
|
||||
"dmp_security_classifications",
|
||||
TRUE,
|
||||
(void**) &dmp_security_classes,
|
||||
&dmp_security_classes,
|
||||
&num_dmp_security_classes,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChDMPSecurityClassifications",
|
||||
|
|
|
@ -3329,7 +3329,7 @@ proto_register_dtls(void)
|
|||
sizeof(ssldecrypt_assoc_t),
|
||||
"dtlsdecrypttablefile", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &dtlskeylist_uats, /* data_ptr */
|
||||
&dtlskeylist_uats, /* data_ptr */
|
||||
&ndtlsdecrypt, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChK12ProtocolsSection", /* TODO, need revision - help */
|
||||
|
|
|
@ -1482,7 +1482,7 @@ void proto_register_ess(void) {
|
|||
sizeof(ess_category_attributes_t),
|
||||
"ess_category_attributes",
|
||||
TRUE,
|
||||
(void**) &ess_category_attributes,
|
||||
&ess_category_attributes,
|
||||
&num_ess_category_attributes,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChEssCategoryAttributes",
|
||||
|
|
|
@ -1522,7 +1522,7 @@ proto_register_card_app_toolkit(void)
|
|||
},
|
||||
{ &hf_ctlv_aid_rid,
|
||||
{ "RID", "etsi_cat.comp_tlv.aid.rid",
|
||||
FT_UINT64, BASE_HEX|BASE_VAL64_STRING, VALS(aid_rid_vals), 0,
|
||||
FT_UINT64, BASE_HEX|BASE_VAL64_STRING, VALS64(aid_rid_vals), 0,
|
||||
NULL, HFILL },
|
||||
},
|
||||
{ &hf_ctlv_aid_pix_app_code_etsi,
|
||||
|
|
|
@ -3087,7 +3087,7 @@ proto_register_http(void)
|
|||
sizeof(header_field_t),
|
||||
"custom_http_header_fields",
|
||||
TRUE,
|
||||
(void**) &header_fields,
|
||||
&header_fields,
|
||||
&num_header_fields,
|
||||
/* specifies named fields, so affects dissection
|
||||
and the set of named fields */
|
||||
|
|
|
@ -22012,7 +22012,7 @@ proto_register_ieee80211 (void)
|
|||
sizeof(uat_wep_key_record_t), /* record size */
|
||||
"80211_keys", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &uat_wep_key_records,/* data_ptr */
|
||||
&uat_wep_key_records, /* data_ptr */
|
||||
&num_wepkeys_uat, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -2732,7 +2732,7 @@ void proto_register_ieee802154(void)
|
|||
sizeof(static_addr_t), /* record size */
|
||||
"802154_addresses", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**)&static_addrs, /* data_ptr */
|
||||
&static_addrs, /* data_ptr */
|
||||
&num_static_addrs, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -1230,7 +1230,7 @@ proto_register_imf(void)
|
|||
sizeof(header_field_t),
|
||||
"imf_header_fields",
|
||||
TRUE,
|
||||
(void**) &header_fields,
|
||||
&header_fields,
|
||||
&num_header_fields,
|
||||
/* specifies named fields, so affects dissection
|
||||
and the set of named fields */
|
||||
|
|
|
@ -2216,7 +2216,7 @@ proto_register_ipsec(void)
|
|||
sizeof(uat_esp_sa_record_t), /* record size */
|
||||
"esp_sa", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &uat_esp_sa_records, /* data_ptr */
|
||||
&uat_esp_sa_records, /* data_ptr */
|
||||
&num_sa_uat, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -6178,7 +6178,7 @@ proto_register_isakmp(void)
|
|||
sizeof(ikev1_uat_data_key_t),
|
||||
"ikev1_decryption_table",
|
||||
TRUE,
|
||||
(void**)&ikev1_uat_data,
|
||||
&ikev1_uat_data,
|
||||
&num_ikev1_uat_data,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChIKEv1DecryptionSection",
|
||||
|
@ -6198,7 +6198,7 @@ proto_register_isakmp(void)
|
|||
sizeof(ikev2_uat_data_t),
|
||||
"ikev2_decryption_table",
|
||||
TRUE,
|
||||
(void**)&ikev2_uat_data,
|
||||
&ikev2_uat_data,
|
||||
&num_ikev2_uat_data,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChIKEv2DecryptionSection",
|
||||
|
|
|
@ -466,7 +466,7 @@ proto_register_k12(void)
|
|||
sizeof(k12_handles_t),
|
||||
"k12_protos", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &k12_handles, /* data_ptr */
|
||||
&k12_handles, /* data_ptr */
|
||||
&nk12_handles, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChK12ProtocolsSection", /* help */
|
||||
|
|
|
@ -5863,7 +5863,7 @@ void proto_register_ldap(void) {
|
|||
sizeof(attribute_type_t),
|
||||
"custom_ldap_attribute_types",
|
||||
TRUE,
|
||||
(void**) &attribute_types,
|
||||
&attribute_types,
|
||||
&num_attribute_types,
|
||||
/* specifies named fields, so affects dissection
|
||||
and the set of named fields */
|
||||
|
|
|
@ -6896,7 +6896,7 @@ void proto_register_mac_lte(void)
|
|||
sizeof(lcid_drb_mapping_t),
|
||||
"drb_logchans",
|
||||
TRUE,
|
||||
(void**) &lcid_drb_mappings,
|
||||
&lcid_drb_mappings,
|
||||
&num_lcid_drb_mappings,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"", /* TODO: is this ref to help manual? */
|
||||
|
|
|
@ -2271,7 +2271,7 @@ static gint dissect_mq_sid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm
|
|||
{
|
||||
guint8 iSIDL;
|
||||
guint8 iSID;
|
||||
guint8 *sid_str;
|
||||
char *sid_str;
|
||||
gint bOffset = offset;
|
||||
|
||||
iSIDL = tvb_get_guint8(tvb, offset);
|
||||
|
@ -2284,7 +2284,7 @@ static gint dissect_mq_sid(tvbuff_t *tvb, proto_tree *tree, mq_parm_t *p_mq_parm
|
|||
offset++;
|
||||
if (iSID == MQ_MQSIDT_NT_SECURITY_ID)
|
||||
{
|
||||
offset = dissect_nt_sid(tvb, offset, tree, "SID", (char **)&sid_str, -1);
|
||||
offset = dissect_nt_sid(tvb, offset, tree, "SID", &sid_str, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2562,7 +2562,7 @@ void proto_register_pdcp(void)
|
|||
sizeof(uat_ue_keys_record_t), /* record size */
|
||||
"pdcp_lte_ue_keys", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &uat_ue_keys_records, /* data_ptr */
|
||||
&uat_ue_keys_records, /* data_ptr */
|
||||
&num_ue_keys_uat, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -1910,7 +1910,7 @@ void proto_register_pres(void) {
|
|||
sizeof(pres_user_t),
|
||||
"pres_context_list",
|
||||
TRUE,
|
||||
(void**) &pres_users,
|
||||
&pres_users,
|
||||
&num_pres_users,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChPresContextList",
|
||||
|
|
|
@ -5907,7 +5907,7 @@ proto_register_reload(void)
|
|||
sizeof(kind_t),
|
||||
"reload_kindids", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &kindidlist_uats, /* data_ptr */
|
||||
&kindidlist_uats, /* data_ptr */
|
||||
&nreloadkinds, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* Help section (currently a wiki page) */
|
||||
|
|
|
@ -4069,7 +4069,7 @@ proto_register_sccp(void)
|
|||
|
||||
|
||||
uat_t *users_uat = uat_new("SCCP Users Table", sizeof(sccp_user_t),
|
||||
"sccp_users", TRUE, (void**) &sccp_users,
|
||||
"sccp_users", TRUE, &sccp_users,
|
||||
&num_sccp_users, UAT_AFFECTS_DISSECTION,
|
||||
"ChSccpUsers", sccp_users_copy_cb,
|
||||
sccp_users_update_cb, sccp_users_free_cb,
|
||||
|
|
|
@ -4692,7 +4692,7 @@ proto_register_sctp(void)
|
|||
sizeof(type_field_t),
|
||||
"statistics_chunk_types",
|
||||
TRUE,
|
||||
(void**) &type_fields,
|
||||
&type_fields,
|
||||
&num_type_fields,
|
||||
0,
|
||||
NULL,
|
||||
|
|
|
@ -3999,7 +3999,7 @@ void proto_register_snmp(void) {
|
|||
sizeof(snmp_ue_assoc_t),
|
||||
"snmp_users",
|
||||
TRUE,
|
||||
(void**)&ueas,
|
||||
&ueas,
|
||||
&num_ueas,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChSNMPUsersSection",
|
||||
|
|
|
@ -5501,7 +5501,7 @@ proto_register_ssl(void)
|
|||
sizeof(ssldecrypt_assoc_t),
|
||||
"ssl_keys", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &sslkeylist_uats, /* data_ptr */
|
||||
&sslkeylist_uats, /* data_ptr */
|
||||
&nssldecrypt, /* numitems_ptr */
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* Help section (currently a wiki page) */
|
||||
|
|
|
@ -45,7 +45,13 @@ static int proto_time = -1;
|
|||
static int hf_time_time = -1;
|
||||
|
||||
static gint ett_time = -1;
|
||||
static absolute_time_display_e time_display_type = ABSOLUTE_TIME_LOCAL;
|
||||
/* Instead of using absolute_time_display_e as the type for
|
||||
* time_display_type, we use gint to avoid a type-punning problem
|
||||
* with prefs_register_enum_preference(). This variable is also
|
||||
* used with abs_time_secs_to_ep_str(), which _does_ take
|
||||
* an absolute_time_display_e, but gcc doesn't complain about
|
||||
* casting the gint to absolute_time_display_e */
|
||||
static gint time_display_type = ABSOLUTE_TIME_LOCAL;
|
||||
|
||||
/* This dissector works for TCP and UDP time packets */
|
||||
#define TIME_PORT 37
|
||||
|
|
|
@ -4405,7 +4405,7 @@ proto_register_ua3g(void)
|
|||
{ &hf_ua3g_ip_device_routing_reset_parameter_l10n_name, { "L10N_Name", "ua3g.ip.reset.parameter.l10n_name", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_value, { "Value", "ua3g.ip.start_rtp.parameter.value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_ip, { "IP", "ua3g.ip.start_rtp.parameter.ip", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, { "Compressor", "ua3g.ip.start_rtp.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(str_start_rtp_compressor), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_compressor, { "Compressor", "ua3g.ip.start_rtp.parameter.compressor", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(str_start_rtp_compressor), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_enabler, { "Enabler", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_send_qos, { "Must Send QOS Tickets", "ua3g.ip.start_rtp.parameter.enabler", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_ip_device_routing_start_rtp_parameter_uint, { "Value", "ua3g.ip.start_rtp.parameter.uint", FT_UINT64, BASE_DEC, NULL, 0x0, NULL, HFILL }},
|
||||
|
@ -4508,10 +4508,10 @@ proto_register_ua3g(void)
|
|||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_string, { "IP", "ua3g.ip.cs.cmd03.parameter.string", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip1, { "Type Of Equipment (first byte)", "ua3g.ip.cs.cmd03.parameter.type_of_equip1", FT_UINT8, BASE_DEC, VALS(cs_ip_device_routing_cmd03_first_byte_vals), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_type_of_equip2, { "Type Of Equipment (second byte)", "ua3g.ip.cs.cmd03.parameter.type_of_equip2", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_cmd03_second_byte_vals), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, { "Default Codec", "ua3g.ip.cs.cmd03.parameter.default_codec", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(str_cs_ip_device_routing_0F_compressor), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_default_codec, { "Default Codec", "ua3g.ip.cs.cmd03.parameter.default_codec", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(str_cs_ip_device_routing_0F_compressor), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_vad, { "VAD", "ua3g.ip.cs.cmd03.parameter.vad", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_ece, { "ECE", "ua3g.ip.cs.cmd03.parameter.ece", FT_BOOLEAN, 8, TFS(&tfs_on_off), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, { "Voice Mode", "ua3g.ip.cs.cmd03.parameter.voice_mode", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS(cs_ip_device_routing_cmd03_voice_mode_vals), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_voice_mode, { "Voice Mode", "ua3g.ip.cs.cmd03.parameter.voice_mode", FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(cs_ip_device_routing_cmd03_voice_mode_vals), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_delay_distribution, { "Delay Distribution", "ua3g.ip.cs.cmd03.parameter.delay_distribution", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_delay_distribution_range_vals), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_consecutive_bfi, { "Consecutive BFI", "ua3g.ip.cs.cmd03.parameter.consecutive_bfi", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_consecutive_bfi_range_vals), 0x0, NULL, HFILL }},
|
||||
{ &hf_ua3g_cs_ip_device_routing_cmd03_parameter_bfi_distribution, { "BFI Distribution", "ua3g.ip.cs.cmd03.parameter.bfi_distribution", FT_UINT16, BASE_DEC, VALS(cs_ip_device_routing_bfi_distribution_range_vals), 0x0, NULL, HFILL }},
|
||||
|
|
|
@ -234,7 +234,7 @@ void proto_register_user_encap(void)
|
|||
sizeof(user_encap_t),
|
||||
"user_dlts",
|
||||
TRUE,
|
||||
(void**) &encaps,
|
||||
&encaps,
|
||||
&num_encaps,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
"ChUserDLTsSection",
|
||||
|
|
|
@ -621,7 +621,7 @@ proto_register_vcdu(void)
|
|||
sizeof(uat_channel_t),
|
||||
"vcdu_bitstream_channels",
|
||||
TRUE,
|
||||
(void**)&uat_bitchannels,
|
||||
&uat_bitchannels,
|
||||
&num_channels_uat,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL,
|
||||
|
|
|
@ -1784,7 +1784,7 @@ proto_register_zbee_nwk_gp(void)
|
|||
}
|
||||
|
||||
zbee_gp_sec_key_table_uat = uat_new("ZigBee GP Security Keys", sizeof(uat_key_record_t), "zigbee_gp_keys", TRUE,
|
||||
(void **)&gp_uat_key_records, &num_uat_key_records, UAT_AFFECTS_DISSECTION, NULL, uat_key_record_copy_cb,
|
||||
&gp_uat_key_records, &num_uat_key_records, UAT_AFFECTS_DISSECTION, NULL, uat_key_record_copy_cb,
|
||||
uat_key_record_update_cb, uat_key_record_free_cb, NULL, key_uat_fields);
|
||||
|
||||
prefs_register_uat_preference(gp_zbee_prefs, "gp_key_table", "Pre-configured GP Security Keys",
|
||||
|
|
|
@ -278,7 +278,7 @@ void zbee_security_register(module_t *zbee_prefs, int proto)
|
|||
sizeof(uat_key_record_t),
|
||||
"zigbee_pc_keys",
|
||||
TRUE,
|
||||
(void**) &uat_key_records,
|
||||
&uat_key_records,
|
||||
&num_uat_key_records,
|
||||
UAT_AFFECTS_DISSECTION, /* affects dissection of packets, but not set of named fields */
|
||||
NULL, /* TODO: ptr to help manual? */
|
||||
|
|
|
@ -82,6 +82,9 @@ struct expert_field;
|
|||
/** Make a const value_string[] look like a _value_string pointer, used to set header_field_info.strings */
|
||||
#define VALS(x) (const struct _value_string*)(x)
|
||||
|
||||
/** Make a const val64_string[] look like a _val64_string pointer, used to set header_field_info.strings */
|
||||
#define VALS64(x) (const struct _val64_string*)(x)
|
||||
|
||||
/** Make a const true_false_string[] look like a _true_false_string pointer, used to set header_field_info.strings */
|
||||
#define TFS(x) (const struct true_false_string*)(x)
|
||||
|
||||
|
@ -375,7 +378,7 @@ struct _header_field_info {
|
|||
const char *abbrev; /**< [FIELDABBREV] abbreviated name of this field */
|
||||
enum ftenum type; /**< [FIELDTYPE] field type, one of FT_ (from ftypes.h) */
|
||||
int display; /**< [FIELDDISPLAY] one of BASE_, or field bit-width if FT_BOOLEAN and non-zero bitmask */
|
||||
const void *strings; /**< [FIELDCONVERT] value_string, range_string or true_false_string,
|
||||
const void *strings; /**< [FIELDCONVERT] value_string, val64_string, range_string or true_false_string,
|
||||
typically converted by VALS(), RVALS() or TFS().
|
||||
If this is an FT_PROTOCOL then it points to the
|
||||
associated protocol_t structure */
|
||||
|
|
|
@ -67,6 +67,8 @@ extern gchar* fcwwn_to_str (const guint8 *);
|
|||
WS_DLL_PUBLIC const gchar* tvb_fc_to_str(tvbuff_t *tvb, const gint offset);
|
||||
WS_DLL_PUBLIC gchar* tvb_fcwwn_to_str (tvbuff_t *tvb, const gint offset);
|
||||
WS_DLL_PUBLIC const gchar* ip6_to_str(const struct e_in6_addr *);
|
||||
WS_DLL_PUBLIC const gchar* ip6_guint8_to_str(const guint8 *ad);
|
||||
|
||||
WS_DLL_PUBLIC const gchar* tvb_ip6_to_str(tvbuff_t *tvb, const gint offset);
|
||||
void ip6_to_str_buf(const struct e_in6_addr *, gchar *);
|
||||
extern gchar* ipx_addr_to_str(const guint32, const guint8 *);
|
||||
|
|
11
epan/uat.c
11
epan/uat.c
|
@ -58,7 +58,7 @@ uat_t* uat_new(const char* name,
|
|||
size_t size,
|
||||
const char* filename,
|
||||
gboolean from_profile,
|
||||
void** data_ptr,
|
||||
void* data_ptr,
|
||||
guint* numitems_ptr,
|
||||
guint flags,
|
||||
const char* help,
|
||||
|
@ -85,7 +85,12 @@ uat_t* uat_new(const char* name,
|
|||
uat->record_size = size;
|
||||
uat->filename = g_strdup(filename);
|
||||
uat->from_profile = from_profile;
|
||||
uat->user_ptr = data_ptr;
|
||||
/* Callers of uat_new() pass in (void*) for data_ptr, because
|
||||
* that is the "universal" pointer type that can be cast to
|
||||
* anything. However, for our purposes, we want a (void**).
|
||||
* So, we cast (void*) data_ptr to (void**) here. That keeps
|
||||
* gcc -fstrict-aliasing from complaining. */
|
||||
uat->user_ptr = (void**) data_ptr;
|
||||
uat->nrows_p = numitems_ptr;
|
||||
uat->copy_cb = copy_cb;
|
||||
uat->update_cb = update_cb;
|
||||
|
@ -115,7 +120,7 @@ uat_t* uat_new(const char* name,
|
|||
|
||||
uat->ncols = i;
|
||||
|
||||
*data_ptr = NULL;
|
||||
*((void**)data_ptr) = NULL;
|
||||
*numitems_ptr = 0;
|
||||
|
||||
return uat;
|
||||
|
|
|
@ -245,7 +245,7 @@ typedef struct _uat_field_t {
|
|||
* @param size The size of the structure
|
||||
* @param filename The filename to be used (either in userdir or datadir)
|
||||
* @param from_profile TRUE if profile directory to be used
|
||||
* @param data_ptr A pointer to a null terminated array of pointers to the data
|
||||
* @param data_ptr Although a void*, this is really a pointer to a null terminated array of pointers to the data
|
||||
* @param num_items_ptr A pointer with number of items
|
||||
* @param flags flags indicating what this UAT affects
|
||||
* @param help A pointer to help text
|
||||
|
@ -262,7 +262,7 @@ uat_t* uat_new(const char* name,
|
|||
size_t size,
|
||||
const char* filename,
|
||||
gboolean from_profile,
|
||||
void** data_ptr,
|
||||
void* data_ptr,
|
||||
guint* num_items_ptr,
|
||||
guint flags,
|
||||
const char* help,
|
||||
|
|
|
@ -248,7 +248,7 @@ void register_pinfo_stat_trees(void) {
|
|||
sizeof(uat_plen_record_t), /* record size */
|
||||
"packet_lengths", /* filename */
|
||||
TRUE, /* from_profile */
|
||||
(void**) &uat_plen_records, /* data_ptr */
|
||||
&uat_plen_records, /* data_ptr */
|
||||
&num_plen_uat, /* numitems_ptr */
|
||||
0, /* not a dissector, so affects neither dissection nor fields */
|
||||
NULL, /* help */
|
||||
|
|
|
@ -176,7 +176,7 @@ scan_local_interfaces(void (*update_cb)(void))
|
|||
break;
|
||||
case IF_AT_IPv6:
|
||||
memcpy(temp_addr->addr.ip6_addr, addr->addr.ip6_addr, sizeof(addr->addr));
|
||||
g_string_append(ip_str, ip6_to_str((struct e_in6_addr *)&addr->addr.ip6_addr));
|
||||
g_string_append(ip_str, ip6_guint8_to_str(addr->addr.ip6_addr));
|
||||
break;
|
||||
default:
|
||||
/* In case we add non-IP addresses */
|
||||
|
|
Loading…
Reference in New Issue