#define BGPTYPE_AS4_PATH 17 /* RFC4893 */
#define BGPTYPE_AGGREGATOR4 18 /* RFC4893 */
#define BGPTYPE_PMSI_TUNNEL 22 /* draft-ietf-l3vpn-2547bis-mcast-bgp-02.txt */
+#define BGPTYPE_AIGP 26 /* RFC7311 */
#define BGPTYPE_ATTR_SET 128 /* draft-marques-ppvpn-ibgp */
#define BGP_MP_NLRI_MINSIZE 3 /* End of RIB Marker detection */
{ BGPTYPE_MP_UNREACH_NLRI, "Multi-Protocol Unreach NLRI"},
{ BGPTYPE_EXTD_COMMUNITIES, "Extended Community"},
{ BGPTYPE_PMSI_TUNNEL, "PMSI Tunnel"},
+ { BGPTYPE_AIGP, "Accumulated IGP Metric"},
{ BGPTYPE_ATTR_SET, "Attribute Set"},
{ 255, "Reserved for development"},
{ 0, NULL}
{ 0, NULL}
};
+#define BGP_AIGP_TLV 1
+
+static const struct tok bgp_aigp_values[] = {
+ { BGP_AIGP_TLV, "AIGP"},
+ { 0, NULL}
+};
+
/* Subsequent address family identifier, RFC2283 section 7 */
#define SAFNUM_RES 0
}
break;
}
+ case BGPTYPE_AIGP:
+ {
+ u_int8_t type;
+ u_int16_t length;
+
+ ND_TCHECK2(tptr[0], 3);
+
+ tlen = len;
+
+ while (tlen >= 3) {
+
+ type = *tptr;
+ length = EXTRACT_16BITS(tptr+1);
+
+ printf("\n\t %s TLV (%u), length %u",
+ tok2str(bgp_aigp_values, "Unknown", type),
+ type, length);
+
+
+ /*
+ * Check if we can read the TLV data.
+ */
+ ND_TCHECK2(tptr[3], length - 3);
+
+ switch (type) {
+
+ case BGP_AIGP_TLV:
+ ND_TCHECK2(tptr[3], 8);
+ printf(", metric %" PRIu64, EXTRACT_64BITS(tptr+3));
+ break;
+
+ default:
+ if (ndo->ndo_vflag <= 1) {
+ print_unknown_data(ndo, tptr+3,"\n\t ", length-3);
+ }
+ }
+
+ /*
+ * Header length includes TLV overhead.
+ */
+ if (length < 3) {
+ break;
+ }
+
+ tptr += length;
+ tlen -= length;
+ }
+ break;
+ }
case BGPTYPE_ATTR_SET:
ND_TCHECK2(tptr[0], 4);
if (len < 4)
bgp_vpn_attrset bgp_vpn_attrset.pcap bgp_vpn_attrset.out -t -v
mpbgp-linklocal-nexthop mpbgp-linklocal-nexthop.pcap mpbgp-linklocal-nexthop.out -t -v
bgp_infloop-v bgp-infinite-loop.pcap bgp_infloop-v.out -t -v
+bgp-aigp bgp-aigp.pcap bgp-aigp.out -t -v
# EAP tests
eapon1 eapon1.pcap eapon1.out -t
--- /dev/null
+IP (tos 0xc0, ttl 64, id 35063, offset 0, flags [none], proto TCP (6), length 182)
+ 172.16.20.5.59631 > 172.16.20.3.179: Flags [P.], cksum 0xe112 (correct), seq 3923783171:3923783301, ack 3341773693, win 16384, options [nop,nop,TS val 32734022 ecr 32695671], length 130: BGP
+ Update Message (2), length: 100
+ Origin (1), length: 1, Flags [T]: Incomplete
+ AS Path (2), length: 0, Flags [T]: empty
+ Multi Exit Discriminator (4), length: 4, Flags [O]: 0
+ Local Preference (5), length: 4, Flags [T]: 100
+ Community (8), length: 4, Flags [OT]: 65000:11201
+ Originator ID (9), length: 4, Flags [O]: 172.16.21.4
+ Cluster List (10), length: 4, Flags [O]: 172.16.20.5
+ Accumulated IGP Metric (26), length: 11, Flags [O]:
+ AIGP TLV (1), length 11, metric 2000
+ Multi-Protocol Reach NLRI (14), length: 17, Flags [OE]:
+ AFI: IPv4 (1), SAFI: labeled Unicast (4)
+ nexthop: 172.16.20.5, nh-length: 4, no SNPA
+ 172.16.21.4/32, label:300096 (bottom)
+ Update Message (2), length: 30
+ Multi-Protocol Unreach NLRI (15), length: 3, Flags [OE]:
+ AFI: IPv4 (1), SAFI: labeled Unicast (4)
+ End-of-Rib Marker (empty NLRI)