summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-cdp.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-cdp.c')
-rw-r--r--epan/dissectors/packet-cdp.c286
1 files changed, 144 insertions, 142 deletions
diff --git a/epan/dissectors/packet-cdp.c b/epan/dissectors/packet-cdp.c
index 6bf63b19..1c4bf1ce 100644
--- a/epan/dissectors/packet-cdp.c
+++ b/epan/dissectors/packet-cdp.c
@@ -18,6 +18,8 @@
#include <epan/nlpid.h>
#include <epan/etypes.h>
#include <epan/cisco_pid.h>
+#include <epan/tfs.h>
+#include <epan/unit_strings.h>
/*
*
@@ -51,120 +53,120 @@ static dissector_handle_t cdp_handle;
#define TLV_TYPE 0
#define TLV_LENGTH 2
-static int proto_cdp = -1;
-static int hf_cdp_version = -1;
-static int hf_cdp_checksum = -1;
-static int hf_cdp_checksum_status = -1;
-static int hf_cdp_ttl = -1;
-static int hf_cdp_tlvtype = -1;
-static int hf_cdp_tlvlength = -1;
-static int hf_cdp_nrgyz_tlvtype = -1;
-static int hf_cdp_nrgyz_tlvlength = -1;
-static int hf_cdp_deviceid = -1;
-static int hf_cdp_platform = -1;
-static int hf_cdp_portid = -1;
-static int hf_cdp_capabilities = -1;
-static int hf_cdp_capabilities_router = -1;
-static int hf_cdp_capabilities_trans_bridge = -1;
-static int hf_cdp_capabilities_src_bridge = -1;
-static int hf_cdp_capabilities_switch = -1;
-static int hf_cdp_capabilities_host = -1;
-static int hf_cdp_capabilities_igmp_capable = -1;
-static int hf_cdp_capabilities_repeater = -1;
-static int hf_cdp_capabilities_voip_phone = -1;
-static int hf_cdp_capabilities_remote = -1;
-static int hf_cdp_capabilities_cvta = -1;
-static int hf_cdp_capabilities_mac_relay = -1;
-static int hf_cdp_spare_poe_tlv = -1;
-static int hf_cdp_spare_poe_tlv_poe = -1;
-static int hf_cdp_spare_poe_tlv_spare_pair_arch = -1;
-static int hf_cdp_spare_poe_tlv_req_spare_pair_poe = -1;
-static int hf_cdp_spare_poe_tlv_pse_spare_pair_poe = -1;
+static int proto_cdp;
+static int hf_cdp_version;
+static int hf_cdp_checksum;
+static int hf_cdp_checksum_status;
+static int hf_cdp_ttl;
+static int hf_cdp_tlvtype;
+static int hf_cdp_tlvlength;
+static int hf_cdp_nrgyz_tlvtype;
+static int hf_cdp_nrgyz_tlvlength;
+static int hf_cdp_deviceid;
+static int hf_cdp_platform;
+static int hf_cdp_portid;
+static int hf_cdp_capabilities;
+static int hf_cdp_capabilities_router;
+static int hf_cdp_capabilities_trans_bridge;
+static int hf_cdp_capabilities_src_bridge;
+static int hf_cdp_capabilities_switch;
+static int hf_cdp_capabilities_host;
+static int hf_cdp_capabilities_igmp_capable;
+static int hf_cdp_capabilities_repeater;
+static int hf_cdp_capabilities_voip_phone;
+static int hf_cdp_capabilities_remote;
+static int hf_cdp_capabilities_cvta;
+static int hf_cdp_capabilities_mac_relay;
+static int hf_cdp_spare_poe_tlv;
+static int hf_cdp_spare_poe_tlv_poe;
+static int hf_cdp_spare_poe_tlv_spare_pair_arch;
+static int hf_cdp_spare_poe_tlv_req_spare_pair_poe;
+static int hf_cdp_spare_poe_tlv_pse_spare_pair_poe;
/* Generated from convert_proto_tree_add_text.pl */
-static int hf_cdp_num_tlvs_table = -1;
-static int hf_cdp_encrypted_data = -1;
-static int hf_cdp_cluster_ip = -1;
-static int hf_cdp_nrgyz_reply_to_backup_server_ip = -1;
-static int hf_cdp_nrgyz_reply_to_port = -1;
-static int hf_cdp_unknown_pad = -1;
-static int hf_cdp_cluster_version = -1;
-static int hf_cdp_hello_unknown = -1;
-static int hf_cdp_management_id = -1;
-static int hf_cdp_data = -1;
-static int hf_cdp_nrgyz_reply_to_ip_address = -1;
-static int hf_cdp_nrgyz_reply_to_name = -1;
-static int hf_cdp_nrgyz_reply_to_domain = -1;
-static int hf_cdp_nrgyz_reply_to_role = -1;
-static int hf_cdp_nrgyz_ip_address = -1;
-static int hf_cdp_nrgyz_ip6_address = -1;
-static int hf_cdp_model_number = -1;
-static int hf_cdp_nrgyz_reply_to_unknown_field = -1;
-static int hf_cdp_len_tlv_table = -1;
-static int hf_cdp_vtp_management_domain = -1;
-static int hf_cdp_hardware_version_id = -1;
-static int hf_cdp_cluster_unknown = -1;
-static int hf_cdp_native_vlan = -1;
-static int hf_cdp_ip_prefix = -1;
-static int hf_cdp_odr_default_gateway = -1;
-static int hf_cdp_power_consumption = -1;
-static int hf_cdp_cluster_status = -1;
-static int hf_cdp_power_requested = -1;
-static int hf_cdp_trust_bitmap = -1;
-static int hf_cdp_seen_sequence = -1;
-static int hf_cdp_system_name = -1;
-static int hf_cdp_power_available = -1;
-static int hf_cdp_cluster_commander_mac = -1;
-static int hf_cdp_mtu = -1;
-static int hf_cdp_protocol_length = -1;
-static int hf_cdp_system_serial_number = -1;
-static int hf_cdp_sequence_number = -1;
-static int hf_cdp_duplex = -1;
-static int hf_cdp_voice_vlan = -1;
-static int hf_cdp_request_id = -1;
-static int hf_cdp_cluster_sub_version = -1;
-static int hf_cdp_oui = -1;
-static int hf_cdp_nrgyz_reply_to_backup_server_port = -1;
-static int hf_cdp_cluster_master_ip = -1;
-static int hf_cdp_protocol = -1;
-static int hf_cdp_protocol_type = -1;
-static int hf_cdp_address = -1;
-static int hf_cdp_system_object_identifier = -1;
-static int hf_cdp_location_unknown = -1;
-static int hf_cdp_nrgyz_unknown_values = -1;
-static int hf_cdp_address_length = -1;
-static int hf_cdp_protocol_id = -1;
-static int hf_cdp_cluster_switch_mac = -1;
-static int hf_cdp_location = -1;
-static int hf_cdp_untrusted_port_cos = -1;
-static int hf_cdp_number_of_addresses = -1;
-static int hf_cdp_cluster_management_vlan = -1;
-static int hf_cdp_software_version = -1;
-
-static gint ett_cdp = -1;
-static gint ett_cdp_tlv = -1;
-static gint ett_cdp_nrgyz_tlv = -1;
-static gint ett_cdp_address = -1;
-static gint ett_cdp_capabilities = -1;
-static gint ett_cdp_spare_poe_tlv = -1;
-static gint ett_cdp_checksum = -1;
-
-static expert_field ei_cdp_invalid_data = EI_INIT;
-static expert_field ei_cdp_nrgyz_tlvlength = EI_INIT;
-static expert_field ei_cdp_checksum = EI_INIT;
+static int hf_cdp_num_tlvs_table;
+static int hf_cdp_encrypted_data;
+static int hf_cdp_cluster_ip;
+static int hf_cdp_nrgyz_reply_to_backup_server_ip;
+static int hf_cdp_nrgyz_reply_to_port;
+static int hf_cdp_unknown_pad;
+static int hf_cdp_cluster_version;
+static int hf_cdp_hello_unknown;
+static int hf_cdp_management_id;
+static int hf_cdp_data;
+static int hf_cdp_nrgyz_reply_to_ip_address;
+static int hf_cdp_nrgyz_reply_to_name;
+static int hf_cdp_nrgyz_reply_to_domain;
+static int hf_cdp_nrgyz_reply_to_role;
+static int hf_cdp_nrgyz_ip_address;
+static int hf_cdp_nrgyz_ip6_address;
+static int hf_cdp_model_number;
+static int hf_cdp_nrgyz_reply_to_unknown_field;
+static int hf_cdp_len_tlv_table;
+static int hf_cdp_vtp_management_domain;
+static int hf_cdp_hardware_version_id;
+static int hf_cdp_cluster_unknown;
+static int hf_cdp_native_vlan;
+static int hf_cdp_ip_prefix;
+static int hf_cdp_odr_default_gateway;
+static int hf_cdp_power_consumption;
+static int hf_cdp_cluster_status;
+static int hf_cdp_power_requested;
+static int hf_cdp_trust_bitmap;
+static int hf_cdp_seen_sequence;
+static int hf_cdp_system_name;
+static int hf_cdp_power_available;
+static int hf_cdp_cluster_commander_mac;
+static int hf_cdp_mtu;
+static int hf_cdp_protocol_length;
+static int hf_cdp_system_serial_number;
+static int hf_cdp_sequence_number;
+static int hf_cdp_duplex;
+static int hf_cdp_voice_vlan;
+static int hf_cdp_request_id;
+static int hf_cdp_cluster_sub_version;
+static int hf_cdp_oui;
+static int hf_cdp_nrgyz_reply_to_backup_server_port;
+static int hf_cdp_cluster_master_ip;
+static int hf_cdp_protocol;
+static int hf_cdp_protocol_type;
+static int hf_cdp_address;
+static int hf_cdp_system_object_identifier;
+static int hf_cdp_location_unknown;
+static int hf_cdp_nrgyz_unknown_values;
+static int hf_cdp_address_length;
+static int hf_cdp_protocol_id;
+static int hf_cdp_cluster_switch_mac;
+static int hf_cdp_location;
+static int hf_cdp_untrusted_port_cos;
+static int hf_cdp_number_of_addresses;
+static int hf_cdp_cluster_management_vlan;
+static int hf_cdp_software_version;
+
+static int ett_cdp;
+static int ett_cdp_tlv;
+static int ett_cdp_nrgyz_tlv;
+static int ett_cdp_address;
+static int ett_cdp_capabilities;
+static int ett_cdp_spare_poe_tlv;
+static int ett_cdp_checksum;
+
+static expert_field ei_cdp_invalid_data;
+static expert_field ei_cdp_nrgyz_tlvlength;
+static expert_field ei_cdp_checksum;
static int
dissect_address_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, int length, proto_tree *tree);
static void
dissect_capabilities(tvbuff_t *tvb, int offset, int length, proto_tree *tree);
static void
-dissect_nrgyz_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, guint16 length, guint16 num,
+dissect_nrgyz_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, uint16_t length, uint16_t num,
proto_tree *tree);
static void
dissect_spare_poe_tlv(tvbuff_t *tvb, int offset, int length, proto_tree *tree);
static void
-add_multi_line_string_to_tree(wmem_allocator_t *scope, proto_tree *tree, tvbuff_t *tvb, gint start,
- gint len, int hf);
+add_multi_line_string_to_tree(wmem_allocator_t *scope, proto_tree *tree, tvbuff_t *tvb, int start,
+ int len, int hf);
#define TYPE_DEVICE_ID 0x0001
#define TYPE_ADDRESS 0x0002
@@ -282,15 +284,15 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
proto_item *ti;
proto_tree *cdp_tree;
int offset = 0;
- guint16 type;
- guint16 length, data_length;
+ uint16_t type;
+ uint16_t length, data_length;
proto_item *tlvi;
proto_tree *tlv_tree;
int real_length;
- guint32 naddresses;
- guint32 power_avail_len, power_avail;
- guint32 power_req_len, power_req;
- gboolean first;
+ uint32_t naddresses;
+ uint32_t power_avail_len, power_avail;
+ uint32_t power_req_len, power_req;
+ bool first;
int addr_length;
vec_t cksum_vec[1];
@@ -324,9 +326,9 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
* the network data.
*/
if (data_length & 1) {
- guint8 *padded_buffer;
+ uint8_t *padded_buffer;
/* Allocate new buffer */
- padded_buffer = (guint8 *)wmem_alloc(pinfo->pool, data_length+1);
+ padded_buffer = (uint8_t *)wmem_alloc(pinfo->pool, data_length+1);
tvb_memcpy(tvb, padded_buffer, 0, data_length);
/* Swap bytes in last word */
padded_buffer[data_length] = padded_buffer[data_length-1];
@@ -386,8 +388,8 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
case TYPE_PORT_ID:
real_length = length;
if ((tvb_reported_length_remaining(tvb, offset) >= length + 3) &&
- (tvb_get_guint8(tvb, offset + real_length) != 0x00) &&
- (tvb_get_guint8(tvb, offset + real_length) != 0x10)) {
+ (tvb_get_uint8(tvb, offset + real_length) != 0x00) &&
+ (tvb_get_uint8(tvb, offset + real_length) != 0x10)) {
/* The length in the TLV doesn't appear to be the
length of the TLV, as the byte just past it
isn't the first byte of a 2-byte big-endian
@@ -506,7 +508,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
length -= 4;
while (length > 0) {
proto_tree_add_ipv4_format_value(tlv_tree, hf_cdp_ip_prefix, tvb, offset, 5, tvb_get_ntohl(tvb, offset),
- "%s/%u", tvb_ip_to_str(pinfo->pool, tvb, offset), tvb_get_guint8(tvb,offset+4));
+ "%s/%u", tvb_ip_to_str(pinfo->pool, tvb, offset), tvb_get_uint8(tvb,offset+4));
offset += 5;
length -= 5;
}
@@ -573,7 +575,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if (tree) {
tlv_tree = proto_tree_add_subtree_format(cdp_tree, tvb,
offset, length, ett_cdp_tlv, NULL, "Duplex: %s",
- tvb_get_guint8(tvb, offset + 4) ?
+ tvb_get_uint8(tvb, offset + 4) ?
"Full" : "Half" );
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, tvb, offset + TLV_TYPE, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, tvb, offset + TLV_LENGTH, 2, ENC_BIG_ENDIAN);
@@ -585,7 +587,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
case TYPE_VOIP_VLAN_REPLY:
tlvi = NULL;
if (tree) {
- guint32 vlan_id;
+ uint32_t vlan_id;
tlv_tree = proto_tree_add_subtree(cdp_tree, tvb,
offset, length, ett_cdp_tlv, &tlvi,
@@ -614,7 +616,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
case TYPE_VOIP_VLAN_QUERY:
tlvi = NULL;
if (tree) {
- guint32 vlan_id;
+ uint32_t vlan_id;
tlv_tree = proto_tree_add_subtree(cdp_tree, tvb,
offset, length, ett_cdp_tlv, &tlvi,
@@ -668,7 +670,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if (tree) {
tlv_tree = proto_tree_add_subtree_format(cdp_tree, tvb,
offset, length, ett_cdp_tlv, NULL, "Trust Bitmap: 0x%02X",
- tvb_get_guint8(tvb, offset + 4));
+ tvb_get_uint8(tvb, offset + 4));
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, tvb, offset + TLV_TYPE, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, tvb, offset + TLV_LENGTH, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_cdp_trust_bitmap, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
@@ -680,7 +682,7 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
if (tree) {
tlv_tree = proto_tree_add_subtree_format(cdp_tree, tvb,
offset, length, ett_cdp_tlv, NULL, "Untrusted port CoS: 0x%02X",
- tvb_get_guint8(tvb, offset + 4));
+ tvb_get_uint8(tvb, offset + 4));
proto_tree_add_item(tlv_tree, hf_cdp_tlvtype, tvb, offset + TLV_TYPE, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_cdp_tlvlength, tvb, offset + TLV_LENGTH, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tlv_tree, hf_cdp_untrusted_port_cos, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
@@ -771,12 +773,12 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
power_req_len -= 8;
/* Move offset to where the list of Power Request Values Exist */
offset += 8;
- first = TRUE;
+ first = true;
while (power_req_len >= 4) {
proto_tree_add_item_ret_uint(tlv_tree, hf_cdp_power_requested, tvb, offset, 4, ENC_BIG_ENDIAN, &power_req);
if (first) {
proto_item_append_text(tlvi, ": %u mW", power_req);
- first = FALSE;
+ first = false;
} else
proto_item_append_text(tlvi, ", %u mW", power_req);
power_req_len -= 4;
@@ -804,12 +806,12 @@ dissect_cdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
power_avail_len -= 8;
/* Move offset to where the list of Power Available Values Exist */
offset += 8;
- first = TRUE;
+ first = true;
while (power_avail_len >= 4) {
proto_tree_add_item_ret_uint(tlv_tree, hf_cdp_power_available, tvb, offset, 4, ENC_BIG_ENDIAN, &power_avail);
if (first) {
proto_item_append_text(tlvi, ": %u mW", power_avail);
- first = FALSE;
+ first = false;
} else
proto_item_append_text(tlvi, ", %u mW", power_avail);
power_avail_len -= 4;
@@ -1057,24 +1059,24 @@ dissect_address_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, int length, p
{
proto_item *ti;
proto_tree *address_tree;
- guint8 protocol_type;
- guint8 protocol_length;
+ uint8_t protocol_type;
+ uint8_t protocol_length;
int nlpid = 0;
- guint16 address_length;
- guint16 etypeid = 0;
- int hf_addr = -1;
+ uint16_t address_length;
+ uint16_t etypeid = 0;
+ int hf_addr = 0;
if (length < 1)
return -1;
address_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_cdp_address, &ti, "Truncated address");
- protocol_type = tvb_get_guint8(tvb, offset);
+ protocol_type = tvb_get_uint8(tvb, offset);
proto_tree_add_item(address_tree, hf_cdp_protocol_type, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
length -= 1;
if (length < 1)
return -1;
- protocol_length = tvb_get_guint8(tvb, offset);
+ protocol_length = tvb_get_uint8(tvb, offset);
proto_tree_add_item(address_tree, hf_cdp_protocol_length, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 1;
length -= 1;
@@ -1088,7 +1090,7 @@ dissect_address_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, int length, p
}
if ((protocol_type == PROTO_TYPE_NLPID) && (protocol_length == 1)) {
- nlpid = tvb_get_guint8(tvb, offset);
+ nlpid = tvb_get_uint8(tvb, offset);
proto_tree_add_bytes_format_value(address_tree, hf_cdp_protocol, tvb, offset, protocol_length, NULL, "%s",
val_to_str(nlpid, nlpid_vals, "Unknown (0x%02x)"));
} else if ((protocol_type == PROTO_TYPE_IEEE_802_2) && (protocol_length == 8) && (tvb_get_ntoh48(tvb, offset) == 0xAAAA03000000)) {
@@ -1155,7 +1157,7 @@ dissect_address_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, int length, p
}
}
- if (hf_addr == -1)
+ if (hf_addr == 0)
{
proto_tree_add_item(address_tree, hf_cdp_address, tvb, offset, address_length, ENC_NA);
if(address_length)
@@ -1191,10 +1193,10 @@ dissect_capabilities(tvbuff_t *tvb, int offset, int length, proto_tree *tree)
}
static void
-dissect_nrgyz_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, guint16 length, guint16 num,
+dissect_nrgyz_tlv(tvbuff_t *tvb, packet_info* pinfo, int offset, uint16_t length, uint16_t num,
proto_tree *tree)
{
- guint32 tlvt, tlvl;
+ uint32_t tlvt, tlvl;
proto_tree *etree = NULL;
char const *ttext = NULL;
@@ -1286,15 +1288,15 @@ dissect_spare_poe_tlv(tvbuff_t *tvb, int offset, int length,
}
static void
-add_multi_line_string_to_tree(wmem_allocator_t *scope, proto_tree *tree, tvbuff_t *tvb, gint start,
- gint len, int hf)
+add_multi_line_string_to_tree(wmem_allocator_t *scope, proto_tree *tree, tvbuff_t *tvb, int start,
+ int len, int hf)
{
- gint next;
+ int next;
int line_len;
int data_len;
while (len > 0) {
- line_len = tvb_find_line_end(tvb, start, len, &next, FALSE);
+ line_len = tvb_find_line_end(tvb, start, len, &next, false);
data_len = next - start;
proto_tree_add_string(tree, hf, tvb, start, data_len, tvb_format_stringzpad(scope, tvb, start, line_len));
start += data_len;
@@ -1311,7 +1313,7 @@ proto_register_cdp(void)
NULL, HFILL }},
{ &hf_cdp_ttl,
- { "TTL", "cdp.ttl", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, &units_second_seconds, 0x0,
+ { "TTL", "cdp.ttl", FT_UINT8, BASE_DEC|BASE_UNIT_STRING, UNS(&units_second_seconds), 0x0,
NULL, HFILL }},
{ &hf_cdp_checksum,
@@ -1444,7 +1446,7 @@ proto_register_cdp(void)
{ &hf_cdp_duplex, { "Duplex", "cdp.duplex", FT_BOOLEAN, BASE_NONE, TFS(&tfs_full_half), 0x0, NULL, HFILL }},
{ &hf_cdp_data, { "Data", "cdp.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_voice_vlan, { "Voice VLAN", "cdp.voice_vlan", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_cdp_power_consumption, { "Power Consumption", "cdp.power_consumption", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_mw, 0x0, NULL, HFILL }},
+ { &hf_cdp_power_consumption, { "Power Consumption", "cdp.power_consumption", FT_UINT16, BASE_DEC|BASE_UNIT_STRING, UNS(&units_mw), 0x0, NULL, HFILL }},
{ &hf_cdp_mtu, { "MTU", "cdp.mtu", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_trust_bitmap, { "Trust Bitmap", "cdp.trust_bitmap", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_untrusted_port_cos, { "Untrusted port CoS", "cdp.untrusted_port_cos", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
@@ -1454,8 +1456,8 @@ proto_register_cdp(void)
{ &hf_cdp_location, { "Location", "cdp.location", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_request_id, { "Request-ID", "cdp.request_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_management_id, { "Management-ID", "cdp.management_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
- { &hf_cdp_power_requested, { "Power Requested", "cdp.power_requested", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_mw, 0x0, NULL, HFILL }},
- { &hf_cdp_power_available, { "Power Available", "cdp.power_available", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_mw, 0x0, NULL, HFILL }},
+ { &hf_cdp_power_requested, { "Power Requested", "cdp.power_requested", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_mw), 0x0, NULL, HFILL }},
+ { &hf_cdp_power_available, { "Power Available", "cdp.power_available", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_mw), 0x0, NULL, HFILL }},
{ &hf_cdp_encrypted_data, { "Encrypted Data", "cdp.encrypted_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_seen_sequence, { "Seen Sequence?", "cdp.seen_sequence", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_cdp_sequence_number, { "Sequence Number", "cdp.sequence_number", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
@@ -1484,7 +1486,7 @@ proto_register_cdp(void)
{ &hf_cdp_software_version, { "Software version", "cdp.software_version", FT_STRINGZ, BASE_NONE, NULL, 0x0, NULL, HFILL }},
};
- static gint *ett[] = {
+ static int *ett[] = {
&ett_cdp,
&ett_cdp_tlv,
&ett_cdp_nrgyz_tlv,