diff options
Diffstat (limited to 'epan/dissectors/packet-kpasswd.c')
-rw-r--r-- | epan/dissectors/packet-kpasswd.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/epan/dissectors/packet-kpasswd.c b/epan/dissectors/packet-kpasswd.c index 85bf7b30e5..e7316481d1 100644 --- a/epan/dissectors/packet-kpasswd.c +++ b/epan/dissectors/packet-kpasswd.c @@ -22,22 +22,25 @@ void proto_register_kpasswd(void); void proto_reg_handoff_kpasswd(void); +static dissector_handle_t kpasswd_handle_udp; +static dissector_handle_t kpasswd_handle_tcp; + /* Desegment Kerberos over TCP messages */ static gboolean kpasswd_desegment = TRUE; -static int proto_kpasswd = -1; -static int hf_kpasswd_message_len = -1; -static int hf_kpasswd_version = -1; -static int hf_kpasswd_result = -1; -static int hf_kpasswd_result_string = -1; -static int hf_kpasswd_ap_req_len = -1; -static int hf_kpasswd_ap_req_data = -1; -static int hf_kpasswd_krb_priv_message = -1; -static int hf_kpasswd_ChangePasswdData = -1; +static int proto_kpasswd; +static int hf_kpasswd_message_len; +static int hf_kpasswd_version; +static int hf_kpasswd_result; +static int hf_kpasswd_result_string; +static int hf_kpasswd_ap_req_len; +static int hf_kpasswd_ap_req_data; +static int hf_kpasswd_krb_priv_message; +static int hf_kpasswd_ChangePasswdData; -static gint ett_kpasswd = -1; -static gint ett_ap_req_data = -1; -static gint ett_krb_priv_message = -1; +static gint ett_kpasswd; +static gint ett_ap_req_data; +static gint ett_krb_priv_message; #define UDP_PORT_KPASSWD 464 @@ -115,7 +118,7 @@ dissect_kpasswd_user_data_reply(packet_info *pinfo, tvbuff_t *tvb, proto_tree *t /* optional result string */ if(tvb_reported_length_remaining(tvb, offset) > 0){ - proto_tree_add_item(tree, hf_kpasswd_result_string, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA); + proto_tree_add_item(tree, hf_kpasswd_result_string, tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII); offset = tvb_reported_length(tvb); } @@ -288,8 +291,7 @@ proto_register_kpasswd(void) }; module_t *kpasswd_module; - proto_kpasswd = proto_register_protocol("MS Kpasswd", - "Kpasswd", "kpasswd"); + proto_kpasswd = proto_register_protocol("MS Kpasswd", "Kpasswd", "kpasswd"); proto_register_field_array(proto_kpasswd, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); @@ -300,16 +302,15 @@ proto_register_kpasswd(void) "Whether the Kpasswd dissector should reassemble messages spanning multiple TCP segments." " To use this option, you must also enable \"Allow subdissectors to reassemble TCP streams\" in the TCP protocol settings.", &kpasswd_desegment); + + /* Register dissectors */ + kpasswd_handle_udp = register_dissector("kpasswd.udp", dissect_kpasswd_udp, proto_kpasswd); + kpasswd_handle_tcp = register_dissector("kpasswd.tcp", dissect_kpasswd_tcp, proto_kpasswd); } void proto_reg_handoff_kpasswd(void) { - dissector_handle_t kpasswd_handle_udp; - dissector_handle_t kpasswd_handle_tcp; - - kpasswd_handle_udp = create_dissector_handle(dissect_kpasswd_udp, proto_kpasswd); - kpasswd_handle_tcp = create_dissector_handle(dissect_kpasswd_tcp, proto_kpasswd); dissector_add_uint_with_preference("udp.port", UDP_PORT_KPASSWD, kpasswd_handle_udp); dissector_add_uint_with_preference("tcp.port", TCP_PORT_KPASSWD, kpasswd_handle_tcp); } |