diff options
Diffstat (limited to 'epan/dissectors/packet-kerberos4.c')
-rw-r--r-- | epan/dissectors/packet-kerberos4.c | 225 |
1 files changed, 119 insertions, 106 deletions
diff --git a/epan/dissectors/packet-kerberos4.c b/epan/dissectors/packet-kerberos4.c index ed2a424de4..c62c9d0cf9 100644 --- a/epan/dissectors/packet-kerberos4.c +++ b/epan/dissectors/packet-kerberos4.c @@ -113,7 +113,7 @@ static int dissect_krb4_kdc_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean little_endian, int version) { nstime_t time_sec; - guint8 lifetime; + guint8 lifetime; if(version==TRANSARC_SPECIAL_VERSION){ proto_tree_add_item(tree, hf_krb4_unknown_transarc_blob, tvb, offset, 8, ENC_NA); @@ -154,7 +154,7 @@ static int dissect_krb4_kdc_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean little_endian) { nstime_t time_sec; - guint32 length; + guint32 length; /* Name */ offset=dissect_krb4_string(pinfo, hf_krb4_name, tree, tvb, offset); @@ -200,9 +200,9 @@ dissect_krb4_kdc_reply(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int static int dissect_krb4_appl_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, gboolean little_endian) { - guint8 tlen, rlen; + guint8 tlen, rlen; nstime_t time_sec; - guint8 lifetime; + guint8 lifetime; /* kvno */ proto_tree_add_item(tree, hf_krb4_kvno, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -256,7 +256,7 @@ dissect_krb4_auth_msg_type(packet_info *pinfo, proto_tree *parent_tree, tvbuff_t { proto_tree *tree; proto_item *item; - guint8 auth_msg_type; + guint8 auth_msg_type; auth_msg_type=tvb_get_guint8(tvb, offset); item = proto_tree_add_item(parent_tree, hf_krb4_auth_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN); @@ -284,8 +284,8 @@ dissect_krb4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d { proto_tree *tree; proto_item *item; - guint8 version, opcode; - int offset=0; + guint8 version, opcode; + int offset = 0; /* this should better have the value 4 or it might be a weirdo * Transarc AFS special unknown thing. @@ -349,109 +349,122 @@ dissect_krb4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void *d void proto_register_krb4(void) { - static hf_register_info hf[] = { - { &hf_krb4_version, - { "Version", "krb4.version", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Kerberos(v4) version number", HFILL }}, - { &hf_krb4_auth_msg_type, - { "Msg Type", "krb4.auth_msg_type", - FT_UINT8, BASE_HEX, NULL, 0x0, - "Message Type/Byte Order", HFILL }}, - { &hf_krb4_m_type, - { "M Type", "krb4.m_type", - FT_UINT8, BASE_HEX, VALS(m_type_vals), 0xfe, - "Message Type", HFILL }}, - { &hf_krb4_byte_order, - { "Byte Order", "krb4.byte_order", - FT_UINT8, BASE_HEX, VALS(byte_order_vals), 0x01, - NULL, HFILL }}, - { &hf_krb4_name, - { "Name", "krb4.name", - FT_STRINGZ, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_instance, - { "Instance", "krb4.instance", - FT_STRINGZ, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_realm, - { "Realm", "krb4.realm", - FT_STRINGZ, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_time_sec, - { "Time Sec", "krb4.time_sec", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_exp_date, - { "Exp Date", "krb4.exp_date", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_req_date, - { "Req Date", "krb4.req_date", - FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_lifetime, - { "Lifetime", "krb4.lifetime", - FT_UINT8, BASE_DEC, NULL, 0x00, - "Lifetime (in 5 min units)", HFILL }}, - { &hf_krb4_s_name, - { "Service Name", "krb4.s_name", - FT_STRINGZ, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_s_instance, - { "Service Instance", "krb4.s_instance", - FT_STRINGZ, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_kvno, - { "Kvno", "krb4.kvno", - FT_UINT8, BASE_DEC, NULL, 0x00, - "Key Version No", HFILL }}, - { &hf_krb4_length, - { "Length", "krb4.length", - FT_UINT32, BASE_DEC, NULL, 0x00, - "Length of encrypted blob", HFILL }}, - { &hf_krb4_ticket_length, - { "Ticket Length", "krb4.ticket.length", - FT_UINT8, BASE_DEC, NULL, 0x00, - "Length of ticket", HFILL }}, - { &hf_krb4_request_length, - { "Request Length", "krb4.request.length", - FT_UINT8, BASE_DEC, NULL, 0x00, - "Length of request", HFILL }}, - { &hf_krb4_ticket_blob, - { "Ticket Blob", "krb4.ticket.blob", - FT_BYTES, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_request_blob, - { "Request Blob", "krb4.request.blob", - FT_BYTES, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_encrypted_blob, - { "Encrypted Blob", "krb4.encrypted_blob", - FT_BYTES, BASE_NONE, NULL, 0x00, - NULL, HFILL }}, - { &hf_krb4_unknown_transarc_blob, - { "Unknown Transarc Blob", "krb4.unknown_transarc_blob", - FT_BYTES, BASE_NONE, NULL, 0x00, - "Unknown blob only present in Transarc packets", HFILL }}, - }; - static gint *ett[] = { - &ett_krb4, - &ett_krb4_auth_msg_type, - }; - - proto_krb4 = proto_register_protocol("Kerberos v4", - "KRB4", "krb4"); - new_register_dissector("krb4", dissect_krb4, proto_krb4); - proto_register_field_array(proto_krb4, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); + static hf_register_info hf[] = { + { &hf_krb4_version, + { "Version", "krb4.version", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Kerberos(v4) version number", HFILL }}, + { &hf_krb4_auth_msg_type, + { "Msg Type", "krb4.auth_msg_type", + FT_UINT8, BASE_HEX, NULL, 0x0, + "Message Type/Byte Order", HFILL }}, + { &hf_krb4_m_type, + { "M Type", "krb4.m_type", + FT_UINT8, BASE_HEX, VALS(m_type_vals), 0xfe, + "Message Type", HFILL }}, + { &hf_krb4_byte_order, + { "Byte Order", "krb4.byte_order", + FT_UINT8, BASE_HEX, VALS(byte_order_vals), 0x01, + NULL, HFILL }}, + { &hf_krb4_name, + { "Name", "krb4.name", + FT_STRINGZ, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_instance, + { "Instance", "krb4.instance", + FT_STRINGZ, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_realm, + { "Realm", "krb4.realm", + FT_STRINGZ, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_time_sec, + { "Time Sec", "krb4.time_sec", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_exp_date, + { "Exp Date", "krb4.exp_date", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_req_date, + { "Req Date", "krb4.req_date", + FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_lifetime, + { "Lifetime", "krb4.lifetime", + FT_UINT8, BASE_DEC, NULL, 0x00, + "Lifetime (in 5 min units)", HFILL }}, + { &hf_krb4_s_name, + { "Service Name", "krb4.s_name", + FT_STRINGZ, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_s_instance, + { "Service Instance", "krb4.s_instance", + FT_STRINGZ, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_kvno, + { "Kvno", "krb4.kvno", + FT_UINT8, BASE_DEC, NULL, 0x00, + "Key Version No", HFILL }}, + { &hf_krb4_length, + { "Length", "krb4.length", + FT_UINT32, BASE_DEC, NULL, 0x00, + "Length of encrypted blob", HFILL }}, + { &hf_krb4_ticket_length, + { "Ticket Length", "krb4.ticket.length", + FT_UINT8, BASE_DEC, NULL, 0x00, + "Length of ticket", HFILL }}, + { &hf_krb4_request_length, + { "Request Length", "krb4.request.length", + FT_UINT8, BASE_DEC, NULL, 0x00, + "Length of request", HFILL }}, + { &hf_krb4_ticket_blob, + { "Ticket Blob", "krb4.ticket.blob", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_request_blob, + { "Request Blob", "krb4.request.blob", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_encrypted_blob, + { "Encrypted Blob", "krb4.encrypted_blob", + FT_BYTES, BASE_NONE, NULL, 0x00, + NULL, HFILL }}, + { &hf_krb4_unknown_transarc_blob, + { "Unknown Transarc Blob", "krb4.unknown_transarc_blob", + FT_BYTES, BASE_NONE, NULL, 0x00, + "Unknown blob only present in Transarc packets", HFILL }}, + }; + static gint *ett[] = { + &ett_krb4, + &ett_krb4_auth_msg_type, + }; + + proto_krb4 = proto_register_protocol("Kerberos v4", + "KRB4", "krb4"); + new_register_dissector("krb4", dissect_krb4, proto_krb4); + proto_register_field_array(proto_krb4, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); } void proto_reg_handoff_krb4(void) { - dissector_handle_t krb4_handle; + dissector_handle_t krb4_handle; - krb4_handle = find_dissector("krb4"); - dissector_add_uint("udp.port", UDP_PORT_KRB4, krb4_handle); + krb4_handle = find_dissector("krb4"); + dissector_add_uint("udp.port", UDP_PORT_KRB4, krb4_handle); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ |