282
286
case LDP_TLV_IPV4_TRANSPORT_ADDR:
283
288
printf("\n\t IPv4 Transport Address: %s", ipaddr_string(tptr));
286
291
case LDP_TLV_IPV6_TRANSPORT_ADDR:
287
293
printf("\n\t IPv6 Transport Address: %s", ip6addr_string(tptr));
290
296
case LDP_TLV_CONFIG_SEQ_NUMBER:
291
298
printf("\n\t Sequence Number: %u", EXTRACT_32BITS(tptr));
294
301
case LDP_TLV_ADDRESS_LIST:
302
TLV_TCHECK(LDP_TLV_ADDRESS_LIST_AFNUM_LEN);
295
303
af = EXTRACT_16BITS(tptr);
296
304
tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
297
305
tlv_tlen -= LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
331
342
case LDP_TLV_FEC:
332
344
fec_type = *tptr;
333
345
printf("\n\t %s FEC (0x%02x)",
334
346
tok2str(ldp_fec_values, "Unknown", fec_type),
338
351
switch(fec_type) {
340
353
case LDP_FEC_WILDCARD:
342
355
case LDP_FEC_PREFIX:
343
357
af = EXTRACT_16BITS(tptr);
358
tptr+=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
359
tlv_tlen-=LDP_TLV_ADDRESS_LIST_AFNUM_LEN;
345
360
if (af == AFNUM_INET) {
346
i=decode_prefix4(tptr,buf,sizeof(buf));
347
printf(": IPv4 prefix %s",buf);
361
i=decode_prefix4(tptr,tlv_tlen,buf,sizeof(buf));
365
printf(": IPv4 prefix (goes past end of TLV)");
367
printf(": IPv4 prefix (invalid length)");
369
printf(": IPv4 prefix %s",buf);
350
372
else if (af == AFNUM_INET6) {
351
i=decode_prefix6(tptr,buf,sizeof(buf));
352
printf(": IPv6 prefix %s",buf);
373
i=decode_prefix6(tptr,tlv_tlen,buf,sizeof(buf));
377
printf(": IPv4 prefix (goes past end of TLV)");
379
printf(": IPv6 prefix (invalid length)");
381
printf(": IPv6 prefix %s",buf);
385
printf(": Address family %u prefix", af);
356
387
case LDP_FEC_HOSTADDRESS:
358
389
case LDP_FEC_MARTINI_VC:
359
if (!TTEST2(*tptr, 11))
391
* According to RFC 4908, the VC info Length field can be zero,
392
* in which case not only are there no interface parameters,
361
396
vc_info_len = *(tptr+2);
398
if (vc_info_len == 0) {
399
printf(": %s, %scontrol word, group-ID %u, VC-info-length: %u",
400
tok2str(l2vpn_encaps_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff),
401
EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ",
402
EXTRACT_32BITS(tptr+3),
407
/* Make sure we have the VC ID as well */
363
409
printf(": %s, %scontrol word, group-ID %u, VC-ID %u, VC-info-length: %u",
364
410
tok2str(l2vpn_encaps_values, "Unknown", EXTRACT_16BITS(tptr)&0x7fff),
365
411
EXTRACT_16BITS(tptr)&0x8000 ? "" : "no ",
366
412
EXTRACT_32BITS(tptr+3),
367
413
EXTRACT_32BITS(tptr+7),
370
if (vc_info_len == 0) /* infinite loop protection */
416
goto trunc; /* minimum 4, for the VC ID */
417
vc_info_len -= 4; /* subtract out the VC ID, giving the length of the interface parameters */
419
/* Skip past the fixed information and the VC ID */
374
if (!TTEST2(*tptr, vc_info_len))
422
TLV_TCHECK(vc_info_len);
377
424
while (vc_info_len > 2) {
378
425
vc_info_tlv_type = *tptr;