- if (advance < 0)
- break;
- tptr += advance;
- }
- done:
- break;
-
- case BGPTYPE_MP_UNREACH_NLRI:
- ND_TCHECK2(tptr[0], BGP_MP_NLRI_MINSIZE);
- af = EXTRACT_16BITS(tptr);
- safi = tptr[2];
-
- ND_PRINT((ndo, "\n\t AFI: %s (%u), %sSAFI: %s (%u)",
- tok2str(af_values, "Unknown AFI", af),
- af,
- (safi>128) ? "vendor specific " : "", /* 128 is meanwhile wellknown */
- tok2str(bgp_safi_values, "Unknown SAFI", safi),
- safi));
-
- if (len == BGP_MP_NLRI_MINSIZE)
- ND_PRINT((ndo, "\n\t End-of-Rib Marker (empty NLRI)"));
-
- tptr += 3;
-
- while (len - (tptr - pptr) > 0) {
- switch (af<<8 | safi) {
- case (AFNUM_INET<<8 | SAFNUM_UNICAST):
- case (AFNUM_INET<<8 | SAFNUM_MULTICAST):
- case (AFNUM_INET<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_prefix4(ndo, tptr, len, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else if (advance == -3)
- break; /* bytes left, but not enough */
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET<<8 | SAFNUM_LABUNICAST):
- advance = decode_labeled_prefix4(ndo, tptr, len, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else if (advance == -3)
- break; /* bytes left, but not enough */
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET<<8 | SAFNUM_VPNUNICAST):
- case (AFNUM_INET<<8 | SAFNUM_VPNMULTICAST):
- case (AFNUM_INET<<8 | SAFNUM_VPNUNIMULTICAST):
- advance = decode_labeled_vpn_prefix4(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET6<<8 | SAFNUM_UNICAST):
- case (AFNUM_INET6<<8 | SAFNUM_MULTICAST):
- case (AFNUM_INET6<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_prefix6(ndo, tptr, len, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else if (advance == -3)
- break; /* bytes left, but not enough */
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET6<<8 | SAFNUM_LABUNICAST):
- advance = decode_labeled_prefix6(ndo, tptr, len, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else if (advance == -3)
- break; /* bytes left, but not enough */
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET6<<8 | SAFNUM_VPNUNICAST):
- case (AFNUM_INET6<<8 | SAFNUM_VPNMULTICAST):
- case (AFNUM_INET6<<8 | SAFNUM_VPNUNIMULTICAST):
- advance = decode_labeled_vpn_prefix6(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_VPLS<<8 | SAFNUM_VPLS):
- case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNICAST):
- case (AFNUM_L2VPN<<8 | SAFNUM_VPNMULTICAST):
- case (AFNUM_L2VPN<<8 | SAFNUM_VPNUNIMULTICAST):
- advance = decode_labeled_vpn_l2(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_NSAP<<8 | SAFNUM_UNICAST):
- case (AFNUM_NSAP<<8 | SAFNUM_MULTICAST):
- case (AFNUM_NSAP<<8 | SAFNUM_UNIMULTICAST):
- advance = decode_clnp_prefix(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_NSAP<<8 | SAFNUM_VPNUNICAST):
- case (AFNUM_NSAP<<8 | SAFNUM_VPNMULTICAST):
- case (AFNUM_NSAP<<8 | SAFNUM_VPNUNIMULTICAST):
- advance = decode_labeled_vpn_clnp_prefix(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET<<8 | SAFNUM_MDT):
- advance = decode_mdt_vpn_nlri(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- case (AFNUM_INET<<8 | SAFNUM_MULTICAST_VPN): /* fall through */
- case (AFNUM_INET6<<8 | SAFNUM_MULTICAST_VPN):
- advance = decode_multicast_vpn(ndo, tptr, buf, sizeof(buf));
- if (advance == -1)
- ND_PRINT((ndo, "\n\t (illegal prefix length)"));
- else if (advance == -2)
- goto trunc;
- else
- ND_PRINT((ndo, "\n\t %s", buf));
- break;
- default:
- ND_TCHECK2(*(tptr-3),tlen);
- ND_PRINT((ndo, "no AFI %u / SAFI %u decoder", af, safi));
- if (ndo->ndo_vflag <= 1)
- print_unknown_data(ndo, tptr-3, "\n\t ", tlen);
- advance = 0;
- tptr = pptr + len;
- break;