};
struct isis_spb_mcid {
- u_int8_t format_id;
- u_int8_t name[32];
+ u_int8_t format_id;
+ u_int8_t name[32];
u_int8_t revision_lvl[2];
- u_int8_t digest[16];
+ u_int8_t digest[16];
};
struct isis_subtlv_spb_mcid {
u_int8_t cist_external_root_path_cost[4];
u_int8_t bridge_priority[2];
u_int8_t spsourceid[4];
- u_int8_t no_of_trees;
+ u_int8_t no_of_trees;
};
#define CLNP_SEGMENT_PART 0x80
printf("OSI NLPID %s (0x%02x): ",
tok2str(nlpid_values,"Unknown",*p),
*p);
-
+
switch (*p) {
case NLPID_CLNP:
while (li >= 2) {
u_int op, opli;
const u_int8_t *tptr;
-
+
TCHECK2(*pptr, 2);
if (li < 2) {
printf(", bad opts/li");
li -= opli;
tptr = pptr;
tlen = opli;
-
+
printf("\n\t %s Option #%u, length %u, value: ",
tok2str(clnp_option_values,"Unknown",op),
op,
case CLNP_OPTION_ROUTE_RECORDING: /* those two options share the format */
- case CLNP_OPTION_SOURCE_ROUTING:
+ case CLNP_OPTION_SOURCE_ROUTING:
printf("%s %s",
tok2str(clnp_option_sr_rr_values,"Unknown",*tptr),
tok2str(clnp_option_sr_rr_string_values,"Unknown Option %u",op));
/* FIXME recursion protection */
clnp_print(pptr, length-clnp_header->length_indicator);
break;
- }
+ }
case CLNP_PDU_DT:
case CLNP_PDU_MD:
case CLNP_PDU_ERQ:
-
+
default:
/* dump the PDU specific data */
if (length-(pptr-optr) > 0) {
printf(" version %d packet not supported", esis_header->version);
return;
}
-
+
if (li > length) {
printf(" length indicator(%d) > PDU size (%d)!", li, length);
return;
li--;
printf("\n\t Number of Source Addresses: %u", source_address_number);
-
+
while (source_address_number > 0) {
TCHECK(*pptr);
if (li < 1) {
default:
if (vflag <= 1) {
- if (pptr < snapend)
+ if (pptr < snapend)
print_unknown_data(pptr,"\n\t ",snapend-pptr);
}
return;
while (li != 0) {
u_int op, opli;
const u_int8_t *tptr;
-
+
if (li < 2) {
printf(", bad opts/li");
return;
}
li -= opli;
tptr = pptr;
-
+
printf("\n\t %s Option #%u, length %u, value: ",
tok2str(esis_option_values,"Unknown",op),
op,
}
trunc:
return;
-}
+}
static void
printf( "ID: %d, Name: ", mcid->format_id);
- for(i=0; i<32; i++)
- {
+ for(i=0; i<32; i++)
+ {
printf("%c", mcid->name[i]);
if(mcid->name[i] == '\0')
break;
}
- printf("\n\t Lvl: %d",
+ printf("\n\t Lvl: %d",
EXTRACT_16BITS(mcid->revision_lvl));
printf( ", Digest: ");
- for(i=0;i<16;i++)
+ for(i=0;i<16;i++)
printf("%.2x ",mcid->digest[i]);
}
tptr++;
printf( "\n\t Digest: ");
-
+
for(i=1;i<=8; i++)
{
printf("%08x ", EXTRACT_32BITS(tptr));
if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_BVID_MIN_LEN))
goto trunctlv;
- printf("\n\t ECT: %08x",
+ printf("\n\t ECT: %08x",
EXTRACT_32BITS(tptr));
tptr = tptr+4;
break;
}
-
+
default:
break;
}
trunctlv:
printf("\n\t\t packet exceeded snapshot");
- return(1);
+ return(1);
}
static int
{
int stlv_type, stlv_len, tmp;
- while (len > 0)
- {
+ while (len > 0)
+ {
stlv_type = *(tptr++);
stlv_len = *(tptr++);
tok2str(isis_mt_capability_subtlv_values, "unknown", stlv_type),
stlv_type,
stlv_len);
-
+
len = len - 2;
switch (stlv_type)
- {
+ {
case ISIS_SUBTLV_SPB_INSTANCE:
- if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN))
+ if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_INSTANCE_MIN_LEN))
goto trunctlv;
printf("\n\t CIST Root-ID: %08x", EXTRACT_32BITS(tptr));
printf(", Path Cost: %08x", EXTRACT_32BITS(tptr));
tptr = tptr+4;
printf(", Prio: %d", EXTRACT_16BITS(tptr));
- tptr = tptr + 2;
- printf("\n\t RES: %d",
+ tptr = tptr + 2;
+ printf("\n\t RES: %d",
EXTRACT_16BITS(tptr) >> 5);
- printf(", V: %d",
+ printf(", V: %d",
(EXTRACT_16BITS(tptr) >> 4) & 0x0001);
- printf(", SPSource-ID: %d",
+ printf(", SPSource-ID: %d",
(EXTRACT_32BITS(tptr) & 0x000fffff));
tptr = tptr+4;
printf(", No of Trees: %x", *(tptr));
printf ("\n\t U:%d, M:%d, A:%d, RES:%d",
*(tptr) >> 7, (*(tptr) >> 6) & 0x01,
(*(tptr) >> 5) & 0x01, (*(tptr) & 0x1f));
-
+
tptr++;
-
+
printf (", ECT: %08x", EXTRACT_32BITS(tptr));
tptr = tptr + 4;
tptr = tptr + 3;
len = len - ISIS_SUBTLV_SPB_INSTANCE_VLAN_TUPLE_LEN;
- tmp--;
+ tmp--;
}
break;
case ISIS_SUBTLV_SPBM_SI:
- if (!TTEST2(*(tptr), 6))
+ if (!TTEST2(*(tptr), 6))
goto trunctlv;
printf("\n\t BMAC: %08x", EXTRACT_32BITS(tptr));
ident,
ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_delay),
ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_delay) ? "External" : "Internal");
-
+
if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_expense))
printf("%s Expense Metric: %u, %s",
ident,
ISIS_LSP_TLV_METRIC_VALUE(tlv_ip_reach->isis_metric_block.metric_expense),
ISIS_LSP_TLV_METRIC_IE(tlv_ip_reach->isis_metric_block.metric_expense) ? "External" : "Internal");
-
+
if (!ISIS_LSP_TLV_METRIC_SUPPORTED(tlv_ip_reach->isis_metric_block.metric_error))
printf("%s Error Metric: %u, %s",
ident,
break;
}
return(1);
-
+
trunctlv:
printf("%spacket exceeded snapshot",ident);
return(0);
u_int te_class,priority_level,gmpls_switch_cap;
union { /* int to float conversion buffer for several subTLVs */
- float f;
+ float f;
u_int32_t i;
} bw;
goto trunctlv;
switch(subt) {
- case ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP:
+ case ISIS_SUBTLV_EXT_IS_REACH_ADMIN_GROUP:
case ISIS_SUBTLV_EXT_IS_REACH_LINK_LOCAL_REMOTE_ID:
case ISIS_SUBTLV_EXT_IS_REACH_LINK_REMOTE_ID:
if (subl >= 4) {
printf(", %s", ipaddr_string(tptr));
break;
case ISIS_SUBTLV_EXT_IS_REACH_MAX_LINK_BW :
- case ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW:
+ case ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW:
if (subl >= 4) {
bw.i = EXTRACT_32BITS(tptr);
printf(", %.3f Mbps", bw.f*8/1000000 );
char ident_buffer[20];
int subtlv_type,subtlv_len,subtlv_sum_len;
int proc_bytes = 0; /* how many bytes did we process ? */
-
+
if (!TTEST2(*tptr, NODE_ID_LEN))
return(0);
printf(", Metric: %d",EXTRACT_24BITS(tptr));
tptr+=3;
}
-
+
if (!TTEST2(*tptr, 1))
return(0);
subtlv_sum_len=*(tptr++); /* read out subTLV length */
static int
isis_print_mtid (const u_int8_t *tptr,const char *ident) {
-
+
if (!TTEST2(*tptr, 2))
return(0);
metric = EXTRACT_32BITS(tptr);
processed=4;
tptr+=4;
-
+
if (afi == AF_INET) {
if (!TTEST2(*tptr, 1)) /* fetch status byte */
return (0);
return (0); /* somebody is fooling us */
byte_length = (bit_length + 7) / 8; /* prefix has variable length encoding */
-
+
if (!TTEST2(*tptr, byte_length))
return (0);
memset(prefix, 0, sizeof prefix); /* clear the copy buffer */
ident,
ip6addr_string(prefix),
bit_length);
-#endif
-
+#endif
+
printf(", Distribution: %s, Metric: %u",
ISIS_MASK_TLV_EXTD_IP_UPDOWN(status_byte) ? "down" : "up",
metric);
ISIS_MASK_TLV_EXTD_IP6_IE(status_byte) ? "External" : "Internal",
ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte) ? ", sub-TLVs present" : "");
#endif
-
+
if ((afi == AF_INET && ISIS_MASK_TLV_EXTD_IP_SUBTLV(status_byte))
#ifdef INET6
|| (afi == AF_INET6 && ISIS_MASK_TLV_EXTD_IP6_SUBTLV(status_byte))
sublen=*(tptr++);
processed+=sublen+1;
printf(" (%u)",sublen); /* print out subTLV length */
-
+
while (sublen>0) {
if (!TTEST2(*tptr,2))
return (0);
}
/* toss any non 6-byte sys-ID len PDUs */
- if (id_length != 6 ) {
+ if (id_length != 6 ) {
printf("bad packet -- illegal sys-ID length (%u)", id_length);
return (0);
}
header_lsp->checksum[1] = 0;
header_lsp->remaining_lifetime[0] = 0;
header_lsp->remaining_lifetime[1] = 0;
-
+
printf(", PDU length: %u, Flags: [ %s",
pdu_len,
ext_is_len = isis_print_ext_is_reach(tptr,"\n\t ",tlv_type);
if (ext_is_len == 0) /* did something go wrong ? */
goto trunctlv;
-
+
tmp-=ext_is_len;
tptr+=ext_is_len;
}
while (tmp >= NODE_ID_LEN+3+1) { /* is it worth attempting a decode ? */
ext_is_len = isis_print_ext_is_reach(tptr,"\n\t ",tlv_type);
if (ext_is_len == 0) /* did something go wrong ? */
- goto trunctlv;
+ goto trunctlv;
tmp-=ext_is_len;
tptr+=ext_is_len;
}
break;
case ISIS_SUBTLV_AUTH_GENERIC:
key_id = EXTRACT_16BITS((tptr+1));
- printf("%u, password: ", key_id);
+ printf("%u, password: ", key_id);
for(i=1 + sizeof(u_int16_t);i<tlv_len;i++) {
if (!TTEST2(*(tptr+i), 1))
goto trunctlv;
goto trunctlv;
printf("\n\t RES: %d, MTID(s): %d",
- (EXTRACT_16BITS (tptr) >> 12),
+ (EXTRACT_16BITS (tptr) >> 12),
(EXTRACT_16BITS (tptr) & 0x0fff));
tmp = tmp-2;
if (!TTEST2(*tptr, SYSTEM_ID_LEN))
goto trunctlv;
printf(", for %s",isis_print_id(tptr,SYSTEM_ID_LEN));
- }
+ }
break;
case ISIS_TLV_IDRP_INFO: