aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2014-04-23 16:59:28 +0200
committerAnders Broman <a.broman58@gmail.com>2014-04-23 15:22:02 +0000
commitabbcaabccc111041c79e8e18314c93aef0f98483 (patch)
treed608c19441831cc14a3e61fb3be9b387fdb2b748 /asn1
parentcb8386c4de31978e0988ea10de25aa9c40e58834 (diff)
Kerberos: use auto generated code for ADDR-TYPE instead of a hand made value_string array
Change-Id: I74089fe609368fdd582aef1f2cb00a3905e0641b Reviewed-on: https://code.wireshark.org/review/1301 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/kerberos/kerberos.cnf16
-rw-r--r--asn1/kerberos/packet-kerberos-template.c24
2 files changed, 10 insertions, 30 deletions
diff --git a/asn1/kerberos/kerberos.cnf b/asn1/kerberos/kerberos.cnf
index 41d3cfe643..ff275fa0d8 100644
--- a/asn1/kerberos/kerberos.cnf
+++ b/asn1/kerberos/kerberos.cnf
@@ -28,7 +28,6 @@ AD-AND-OR
AD-KDCIssued
AD-LoginAlias
AD-MANDATORY-FOR-KDC
-ADDR-TYPE
AUTHDATA-TYPE
ChangePasswdDataMS
EncryptedData
@@ -60,6 +59,9 @@ TYPED-DATA
#.NO_EMIT ONLY_VALS
Applications
+#.MAKE_DEFINES
+ADDR-TYPE TYPE_PREFIX
+
#.FN_BODY MESSAGE-TYPE VAL_PTR = &msgtype
guint32 msgtype;
@@ -73,9 +75,10 @@ guint32 msgtype;
}
gbl_do_col_info=FALSE;
+##if 0
/* append the application type to the tree */
proto_item_append_text(tree, " %s", val_to_str(msgtype, krb5_msg_types, "Unknown:0x%x"));
-
+##endif
#.FN_BODY ERROR-CODE VAL_PTR = &krb5_errorcode
%(DEFAULT_BODY)s
@@ -195,11 +198,11 @@ guint32 msgtype;
address_str=(char*)wmem_alloc(wmem_packet_scope(), ADDRESS_STR_BUFSIZ);
address_str[0]=0;
switch(addr_type){
- case KRB5_ADDR_IPv4:
+ case KERBEROS_ADDR_TYPE_IPV4:
it=proto_tree_add_item(tree, hf_krb_address_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
g_snprintf(address_str,ADDRESS_STR_BUFSIZ,"%d.%d.%d.%d",tvb_get_guint8(tvb, offset),tvb_get_guint8(tvb, offset+1),tvb_get_guint8(tvb, offset+2),tvb_get_guint8(tvb, offset+3));
break;
- case KRB5_ADDR_NETBIOS:
+ case KERBEROS_ADDR_TYPE_NETBIOS:
{
char netbios_name[(NETBIOS_NAME_LEN - 1)*4 + 1];
int netbios_name_type;
@@ -210,7 +213,7 @@ guint32 msgtype;
it=proto_tree_add_string_format(tree, hf_krb_address_netbios, tvb, offset, 16, netbios_name, "NetBIOS Name: %s (%s)", address_str, netbios_name_type_descr(netbios_name_type));
}
break;
- case KRB5_ADDR_IPv6:
+ case KERBEROS_ADDR_TYPE_IPV6:
it=proto_tree_add_item(tree, hf_krb_address_ipv6, tvb, offset, INET6_ADDRLEN, ENC_NA);
g_snprintf(address_str, ADDRESS_STR_BUFSIZ, "%s", ip6_to_str((const struct e_in6_addr *)tvb_get_ptr(tvb, offset, INET6_ADDRLEN)));
break;
@@ -375,9 +378,6 @@ guint32 msgtype;
offset = dissect_ber_integer(implicit_tag, actx, tree, tvb, offset, hf_index,
(guint32*)actx->value_ptr);
-#.TYPE_ATTR
-HostAddress/addr-type TYPE=FT_UINT32 DISPLAY=BASE_DEC STRINGS=VALS(krb5_address_types)
-
#.FN_BODY KDC-REQ-BODY
conversation_t *conversation;
diff --git a/asn1/kerberos/packet-kerberos-template.c b/asn1/kerberos/packet-kerberos-template.c
index 526902c9ef..977025a969 100644
--- a/asn1/kerberos/packet-kerberos-template.c
+++ b/asn1/kerberos/packet-kerberos-template.c
@@ -160,6 +160,8 @@ static guint32 krb5_errorcode;
static guint32 gbl_keytype;
static gboolean gbl_do_col_info;
+#include "packet-kerberos-val.h"
+
static void
call_kerberos_callbacks(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int tag, kerberos_callbacks *cb)
{
@@ -778,16 +780,6 @@ g_warning("woohoo decrypted keytype:%d in frame:%u\n", keytype, pinfo->fd->num);
#define KRB5_MSG_ENC_KRB_CRED_PART 29 /* EncKrbCredPart */
#define KRB5_MSG_ERROR 30 /* KRB-ERROR type */
-/* address type constants */
-#define KRB5_ADDR_IPv4 0x02
-#define KRB5_ADDR_CHAOS 0x05
-#define KRB5_ADDR_XEROX 0x06
-#define KRB5_ADDR_ISO 0x07
-#define KRB5_ADDR_DECNET 0x0c
-#define KRB5_ADDR_APPLETALK 0x10
-#define KRB5_ADDR_NETBIOS 0x14
-#define KRB5_ADDR_IPv6 0x18
-
/* encryption type constants */
#define KRB5_ENCTYPE_NULL 0
#define KRB5_ENCTYPE_DES_CBC_CRC 1
@@ -1246,18 +1238,6 @@ static const value_string krb5_transited_types[] = {
};
#endif
-static const value_string krb5_address_types[] = {
- { KRB5_ADDR_IPv4, "IPv4"},
- { KRB5_ADDR_CHAOS, "CHAOS"},
- { KRB5_ADDR_XEROX, "XEROX"},
- { KRB5_ADDR_ISO, "ISO"},
- { KRB5_ADDR_DECNET, "DECNET"},
- { KRB5_ADDR_APPLETALK, "APPLETALK"},
- { KRB5_ADDR_NETBIOS, "NETBIOS"},
- { KRB5_ADDR_IPv6, "IPv6"},
- { 0, NULL },
-};
-
static const value_string krb5_msg_types[] = {
{ KRB5_MSG_TICKET, "Ticket" },
{ KRB5_MSG_AUTHENTICATOR, "Authenticator" },