packet-dhcp.c: Signed vs. unsigned warning fixes
Also some more whitespace fixes. Change-Id: I53bc7c4073ed495b14580d59798456b17851cda2 Reviewed-on: https://code.wireshark.org/review/36749 Petri-Dish: Jörg Mayer <jmayer@loplof.de> Tested-by: Petri Dish Buildbot Reviewed-by: Jörg Mayer <jmayer@loplof.de>
This commit is contained in:
parent
f74bd40eac
commit
4e909f2b65
|
@ -962,7 +962,7 @@ static const value_string o43pxeclient_boot_menu_types[] = {
|
|||
|
||||
static gboolean novell_string = FALSE;
|
||||
|
||||
static guint dhcp_uuid_endian = ENC_LITTLE_ENDIAN;
|
||||
static gint dhcp_uuid_endian = ENC_LITTLE_ENDIAN;
|
||||
|
||||
static const enum_val_t dhcp_uuid_endian_vals[] = {
|
||||
{ "Little Endian", "Little Endian", ENC_LITTLE_ENDIAN},
|
||||
|
@ -2447,7 +2447,7 @@ dissect_dhcpopt_client_full_domain_name(tvbuff_t *tvb, packet_info *pinfo, proto
|
|||
};
|
||||
guint8 fqdn_flags;
|
||||
int offset = 0, length = tvb_reported_length(tvb);
|
||||
const gchar *dns_name;
|
||||
const guchar *dns_name;
|
||||
guint dns_name_len;
|
||||
|
||||
if (length < 3) {
|
||||
|
@ -2466,7 +2466,7 @@ dissect_dhcpopt_client_full_domain_name(tvbuff_t *tvb, packet_info *pinfo, proto
|
|||
|
||||
if (length > 3) {
|
||||
if (fqdn_flags & F_FQDN_E) {
|
||||
get_dns_name(tvb, offset+3, length-3, offset+3, &dns_name, &dns_name_len);
|
||||
get_dns_name(tvb, offset+3, length-3, offset+3, (const char **)&dns_name, &dns_name_len);
|
||||
proto_tree_add_string(tree, hf_dhcp_fqdn_name,
|
||||
tvb, offset+3, length-3, format_text(wmem_packet_scope(), dns_name, dns_name_len));
|
||||
} else {
|
||||
|
@ -2773,7 +2773,7 @@ dissect_dhcpopt_dhcp_domain_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
|
|||
{
|
||||
int length = tvb_reported_length(tvb);
|
||||
gchar *name_out;
|
||||
const gchar *dns_name;
|
||||
const guchar *dns_name;
|
||||
guint dns_name_len;
|
||||
|
||||
/* Encoding Long Options in the Dynamic Host Configuration Protocol (DHCPv4) (RFC 3396) */
|
||||
|
@ -2808,7 +2808,7 @@ dissect_dhcpopt_dhcp_domain_search(tvbuff_t *tvb, packet_info *pinfo _U_, proto_
|
|||
while (composite_offset < tvb_reported_length(rfc3396_dns_domain_search_list.tvb_composite)) {
|
||||
/* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
|
||||
consumedx = get_dns_name(rfc3396_dns_domain_search_list.tvb_composite, composite_offset,
|
||||
tvb_reported_length(rfc3396_dns_domain_search_list.tvb_composite), 0, &dns_name, &dns_name_len);
|
||||
tvb_reported_length(rfc3396_dns_domain_search_list.tvb_composite), 0, (const gchar **)&dns_name, &dns_name_len);
|
||||
name_out = format_text(wmem_packet_scope(), dns_name, dns_name_len);
|
||||
if (rfc3396_dns_domain_search_list.total_number_of_block == 1) {
|
||||
/* RFC 3396 is not used, so we can easily link the fqdn with v_tree. */
|
||||
|
@ -2829,7 +2829,7 @@ static int
|
|||
dissect_dhcpopt_sip_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
||||
{
|
||||
int length = tvb_reported_length(tvb);
|
||||
const gchar *dns_name;
|
||||
const guchar *dns_name;
|
||||
guint dns_name_len;
|
||||
gchar *name_out;
|
||||
|
||||
|
@ -2882,7 +2882,7 @@ dissect_dhcpopt_sip_servers(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
while (composite_offset < tvb_reported_length(rfc3396_sip_server.tvb_composite)) {
|
||||
/* use the get_dns_name method that manages all techniques of RFC 1035 (compression pointer and so on) */
|
||||
consumedx = get_dns_name(rfc3396_sip_server.tvb_composite, composite_offset, tvb_reported_length(rfc3396_sip_server.tvb_composite),
|
||||
1 /* ignore enc */, &dns_name, &dns_name_len);
|
||||
1 /* ignore enc */, (const gchar **)&dns_name, &dns_name_len);
|
||||
name_out = format_text(wmem_packet_scope(), dns_name, dns_name_len);
|
||||
|
||||
if (rfc3396_sip_server.total_number_of_block == 1) {
|
||||
|
@ -3084,7 +3084,7 @@ static int
|
|||
dissect_dhcpopt_rdnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
||||
{
|
||||
int offset = 0;
|
||||
const gchar *dns_name;
|
||||
const guchar *dns_name;
|
||||
guint dns_name_len;
|
||||
|
||||
if (tvb_reported_length(tvb) < 10) {
|
||||
|
@ -3099,7 +3099,7 @@ dissect_dhcpopt_rdnss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void*
|
|||
proto_tree_add_item(tree, hf_dhcp_option_rdnss_sec_dns_server, tvb, offset, 4, ENC_BIG_ENDIAN);
|
||||
offset += 4;
|
||||
|
||||
get_dns_name(tvb, offset, tvb_reported_length_remaining(tvb,offset), offset, &dns_name, &dns_name_len);
|
||||
get_dns_name(tvb, offset, tvb_reported_length_remaining(tvb,offset), offset, (const gchar **)&dns_name, &dns_name_len);
|
||||
proto_tree_add_string(tree, hf_dhcp_option_rdnss_domain, tvb, offset,
|
||||
tvb_reported_length_remaining(tvb,offset), format_text(wmem_packet_scope(), dns_name, dns_name_len));
|
||||
|
||||
|
@ -3248,7 +3248,7 @@ dissect_dhcpopt_avaya_ip_telephone(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
int offset = 0;
|
||||
proto_tree *o242avaya_v_tree;
|
||||
proto_item *avaya_ti;
|
||||
const guint8 *avaya_option = NULL;
|
||||
const gchar *avaya_option = NULL;
|
||||
wmem_strbuf_t *avaya_param_buf = NULL;
|
||||
|
||||
/* minimum length is 5 bytes */
|
||||
|
@ -3256,7 +3256,7 @@ dissect_dhcpopt_avaya_ip_telephone(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
expert_add_info_format(pinfo, tree, &ei_dhcp_bad_length, "Avaya IP Telephone option length isn't >= 5");
|
||||
return 1;
|
||||
}
|
||||
avaya_ti = proto_tree_add_item_ret_string(tree, hf_dhcp_option242_avaya, tvb, offset, tvb_reported_length(tvb), ENC_ASCII|ENC_NA, wmem_packet_scope(), &avaya_option);
|
||||
avaya_ti = proto_tree_add_item_ret_string(tree, hf_dhcp_option242_avaya, tvb, offset, tvb_reported_length(tvb), ENC_ASCII|ENC_NA, wmem_packet_scope(), (const guint8 **)&avaya_option);
|
||||
o242avaya_v_tree = proto_item_add_subtree(avaya_ti, ett_dhcp_option242_suboption);
|
||||
avaya_param_buf = wmem_strbuf_new(wmem_packet_scope(), "");
|
||||
gchar **fields = wmem_strsplit(wmem_packet_scope(), avaya_option, ",", -1);
|
||||
|
@ -4799,11 +4799,11 @@ dissect_cisco_vendor_info_heur(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
|
||||
static int
|
||||
dissect_vendor_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tree *v_tree,
|
||||
tvbuff_t *tvb, int optoff, int optend)
|
||||
tvbuff_t *tvb, guint32 optoff, guint32 optend)
|
||||
{
|
||||
int suboptoff = optoff;
|
||||
guint32 suboptoff = optoff;
|
||||
guint8 subopt;
|
||||
int subopt_len;
|
||||
guint32 subopt_len;
|
||||
proto_item *item;
|
||||
proto_tree *sub_tree;
|
||||
|
||||
|
@ -4838,10 +4838,10 @@ dissect_vendor_generic_suboption(packet_info *pinfo, proto_item *v_ti, proto_tre
|
|||
static int
|
||||
dissect_dhcpopt_vi_vendor_specific_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
|
||||
{
|
||||
int offset = 0;
|
||||
int enterprise = 0;
|
||||
int s_end = 0;
|
||||
int option_data_len = 0;
|
||||
guint32 offset = 0;
|
||||
guint32 enterprise = 0;
|
||||
guint32 s_end = 0;
|
||||
guint32 option_data_len = 0;
|
||||
proto_item *vti;
|
||||
proto_tree *e_tree;
|
||||
|
||||
|
@ -5234,7 +5234,7 @@ dissect_vendor_tr111_suboption(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
}
|
||||
else if (o125_tr111_opt[subopt].ftype == oui) {
|
||||
/* Get hex string. Expecting 6 characters. */
|
||||
gchar *oui_string = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, subopt_len, ENC_ASCII);
|
||||
const gchar *oui_string = (gchar *)tvb_get_string_enc(wmem_packet_scope(), tvb, offset, subopt_len, ENC_ASCII);
|
||||
/* Convert to OUI number. Only 3 bytes so no data lost in downcast. */
|
||||
guint32 oui_number = (guint32)strtol(oui_string, NULL, 16);
|
||||
/* Add item using oui_vals */
|
||||
|
@ -6605,7 +6605,7 @@ dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v
|
|||
proto_tree *pkt_s_tree;
|
||||
proto_item *vti;
|
||||
int max_timer_val = 255;
|
||||
const gchar *dns_name;
|
||||
const guchar *dns_name;
|
||||
guint dns_name_len;
|
||||
|
||||
subopt = tvb_get_guint8(tvb, suboptoff);
|
||||
|
@ -6649,7 +6649,7 @@ dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v
|
|||
switch (prov_type) {
|
||||
|
||||
case 0:
|
||||
get_dns_name(tvb, suboptoff, subopt_len, suboptoff, &dns_name, &dns_name_len);
|
||||
get_dns_name(tvb, suboptoff, subopt_len, suboptoff, (const char **)&dns_name, &dns_name_len);
|
||||
proto_item_append_text(vti, "%s (%u byte%s)", format_text(wmem_packet_scope(), dns_name, dns_name_len),
|
||||
subopt_len - 1, plurality(subopt_len, "", "s") );
|
||||
break;
|
||||
|
@ -6707,7 +6707,7 @@ dissect_packetcable_ietf_ccc(packet_info *pinfo, proto_item *v_ti, proto_tree *v
|
|||
break;
|
||||
|
||||
case PKT_CCC_KRB_REALM: /* String values */
|
||||
get_dns_name(tvb, suboptoff, subopt_len, suboptoff, &dns_name, &dns_name_len);
|
||||
get_dns_name(tvb, suboptoff, subopt_len, suboptoff, (const gchar **)&dns_name, &dns_name_len);
|
||||
proto_item_append_text(vti, "%s (%u byte%s)", format_text(wmem_packet_scope(), dns_name, dns_name_len),
|
||||
subopt_len, plurality(subopt_len, "", "s") );
|
||||
suboptoff += subopt_len;
|
||||
|
|
Loading…
Reference in New Issue