diff options
Diffstat (limited to 'contrib/tcpdump/print-isoclns.c')
-rw-r--r-- | contrib/tcpdump/print-isoclns.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/contrib/tcpdump/print-isoclns.c b/contrib/tcpdump/print-isoclns.c index a4af8ad..00fce7e 100644 --- a/contrib/tcpdump/print-isoclns.c +++ b/contrib/tcpdump/print-isoclns.c @@ -395,12 +395,14 @@ static struct tok isis_subtlv_link_attribute_values[] = { }; #define ISIS_SUBTLV_AUTH_SIMPLE 1 +#define ISIS_SUBTLV_AUTH_GENERIC 3 /* rfc 5310 */ #define ISIS_SUBTLV_AUTH_MD5 54 #define ISIS_SUBTLV_AUTH_MD5_LEN 16 #define ISIS_SUBTLV_AUTH_PRIVATE 255 static struct tok isis_subtlv_auth_values[] = { { ISIS_SUBTLV_AUTH_SIMPLE, "simple text password"}, + { ISIS_SUBTLV_AUTH_GENERIC, "Generic Crypto key-id"}, { ISIS_SUBTLV_AUTH_MD5, "HMAC-MD5 password"}, { ISIS_SUBTLV_AUTH_PRIVATE, "Routing Domain private password"}, { 0, NULL } @@ -441,8 +443,8 @@ static struct tok clnp_flag_values[] = { #define ISIS_MASK_MTFLAGS(x) ((x)&0xf000) static struct tok isis_mt_flag_values[] = { - { 0x4000, "sub-TLVs present"}, - { 0x8000, "ATT bit set"}, + { 0x4000, "ATT bit set"}, + { 0x8000, "Overload bit set"}, { 0, NULL} }; @@ -618,10 +620,6 @@ struct isis_tlv_lsp { void isoclns_print(const u_int8_t *p, u_int length, u_int caplen) { - const struct isis_common_header *header; - - header = (const struct isis_common_header *)p; - if (caplen <= 1) { /* enough bytes on the wire ? */ printf("|OSI"); return; @@ -664,7 +662,7 @@ void isoclns_print(const u_int8_t *p, u_int length, u_int caplen) #ifdef INET6 case NLPID_IP6: - ip6_print(p+1, length-1); + ip6_print(gndo, p+1, length-1); break; #endif @@ -1179,15 +1177,15 @@ esis_print(const u_int8_t *pptr, u_int length) } /* now walk the options */ - while (li >= 2) { + while (li != 0) { u_int op, opli; const u_int8_t *tptr; - TCHECK2(*pptr, 2); if (li < 2) { printf(", bad opts/li"); return; } + TCHECK2(*pptr, 2); op = *pptr++; opli = *pptr++; li -= 2; @@ -1206,8 +1204,11 @@ esis_print(const u_int8_t *pptr, u_int length) switch (op) { case ESIS_OPTION_ES_CONF_TIME: - TCHECK2(*pptr, 2); - printf("%us", EXTRACT_16BITS(tptr)); + if (opli == 2) { + TCHECK2(*pptr, 2); + printf("%us", EXTRACT_16BITS(tptr)); + } else + printf("(bad length)"); break; case ESIS_OPTION_PROTOCOLS: @@ -1779,7 +1780,7 @@ static int isis_print (const u_int8_t *p, u_int length) u_int8_t pdu_type, max_area, id_length, tlv_type, tlv_len, tmp, alen, lan_alen, prefix_len; u_int8_t ext_is_len, ext_ip_len, mt_len; const u_int8_t *optr, *pptr, *tptr; - u_short packet_len,pdu_len; + u_short packet_len,pdu_len, key_id; u_int i,vendor_id; int sigcheck; @@ -2378,6 +2379,15 @@ static int isis_print (const u_int8_t *p, u_int length) printf(" (%s)", tok2str(signature_check_values, "Unknown", sigcheck)); break; + case ISIS_SUBTLV_AUTH_GENERIC: + key_id = EXTRACT_16BITS((tptr+1)); + printf("%u, password: ", key_id); + for(i=1 + sizeof(u_int16_t);i<tlv_len;i++) { + if (!TTEST2(*(tptr+i), 1)) + goto trunctlv; + printf("%02x",*(tptr+i)); + } + break; case ISIS_SUBTLV_AUTH_PRIVATE: default: if(!print_unknown_data(tptr+1,"\n\t\t ",tlv_len-1)) |