diff options
Diffstat (limited to 'epan/dissectors/packet-vrrp.c')
-rw-r--r-- | epan/dissectors/packet-vrrp.c | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/epan/dissectors/packet-vrrp.c b/epan/dissectors/packet-vrrp.c index 5263408d63..72ac275d46 100644 --- a/epan/dissectors/packet-vrrp.c +++ b/epan/dissectors/packet-vrrp.c @@ -24,30 +24,32 @@ void proto_register_vrrp(void); void proto_reg_handoff_vrrp(void); -static gint proto_vrrp = -1; -static gint ett_vrrp = -1; -static gint ett_vrrp_ver_type = -1; - -static gint hf_vrrp_ver_type = -1; -static gint hf_vrrp_version = -1; -static gint hf_vrrp_type = -1; -static gint hf_vrrp_virt_rtr_id = -1; -static gint hf_vrrp_prio = -1; -static gint hf_vrrp_addr_count = -1; -static gint hf_vrrp_checksum = -1; -static gint hf_vrrp_checksum_status = -1; -static gint hf_vrrp_auth_type = -1; -static gint hf_vrrp_adver_int = -1; -static gint hf_vrrp_reserved_mbz = -1; -static gint hf_vrrp_short_adver_int = -1; -static gint hf_vrrp_ip = -1; -static gint hf_vrrp_ip6 = -1; -static gint hf_vrrp_auth_string = -1; -static gint hf_vrrp_md5_auth_data = -1; +static dissector_handle_t vrrp_handle; + +static gint proto_vrrp; +static gint ett_vrrp; +static gint ett_vrrp_ver_type; + +static gint hf_vrrp_ver_type; +static gint hf_vrrp_version; +static gint hf_vrrp_type; +static gint hf_vrrp_virt_rtr_id; +static gint hf_vrrp_prio; +static gint hf_vrrp_addr_count; +static gint hf_vrrp_checksum; +static gint hf_vrrp_checksum_status; +static gint hf_vrrp_auth_type; +static gint hf_vrrp_adver_int; +static gint hf_vrrp_reserved_mbz; +static gint hf_vrrp_short_adver_int; +static gint hf_vrrp_ip; +static gint hf_vrrp_ip6; +static gint hf_vrrp_auth_string; +static gint hf_vrrp_md5_auth_data; static gboolean g_vrrp_v3_checksum_as_in_v2 = FALSE; -static expert_field ei_vrrp_checksum = EI_INIT; +static expert_field ei_vrrp_checksum; #define VRRP_VERSION_MASK 0xf0 #define VRRP_TYPE_MASK 0x0f @@ -204,7 +206,7 @@ dissect_vrrp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_ } if (auth_type == VRRP_AUTH_TYPE_SIMPLE_TEXT) { - proto_tree_add_item(vrrp_tree, hf_vrrp_auth_string, tvb, offset, VRRP_AUTH_DATA_LEN, ENC_ASCII|ENC_NA); + proto_tree_add_item(vrrp_tree, hf_vrrp_auth_string, tvb, offset, VRRP_AUTH_DATA_LEN, ENC_ASCII); offset += VRRP_AUTH_DATA_LEN; } else if (auth_type == VRRP_AUTH_TYPE_IP_MD5) { if (vrrp_len - offset >= 16) { @@ -312,11 +314,12 @@ void proto_register_vrrp(void) expert_module_t* expert_vrrp; module_t *vrrp_module; - proto_vrrp = proto_register_protocol("Virtual Router Redundancy Protocol", - "VRRP", "vrrp"); + proto_vrrp = proto_register_protocol("Virtual Router Redundancy Protocol", "VRRP", "vrrp"); proto_register_field_array(proto_vrrp, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + vrrp_handle = register_dissector("vrrp", dissect_vrrp, proto_vrrp); + expert_vrrp = expert_register_protocol(proto_vrrp); expert_register_field_array(expert_vrrp, ei, array_length(ei)); @@ -327,16 +330,11 @@ void proto_register_vrrp(void) "There is some ambiguity on how to calculate V3 checksums" "As in V3 will use a pseudo header(which may only be implemented for IPv6 by some manufacturers)", &g_vrrp_v3_checksum_as_in_v2); - - } void proto_reg_handoff_vrrp(void) { - dissector_handle_t vrrp_handle; - - vrrp_handle = create_dissector_handle(dissect_vrrp, proto_vrrp); dissector_add_uint("ip.proto", IP_PROTO_VRRP, vrrp_handle); } |