diff options
author | paulzlabn <paulz@labn.net> | 2018-03-14 21:31:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-14 21:31:58 +0100 |
commit | 3f1224cd1a9408bdad6aca8c0c205211cb548d5c (patch) | |
tree | 87e6a52a3e7ad7b09caa3207f081fd92bc8fd018 /bgpd/bgp_route.c | |
parent | vtysh: add bgpd vpn-policy nodes (diff) | |
parent | Merge pull request #1821 from vivek-cumulus/pmsi-parse-display (diff) | |
download | frr-3f1224cd1a9408bdad6aca8c0c205211cb548d5c.tar.xz frr-3f1224cd1a9408bdad6aca8c0c205211cb548d5c.zip |
Merge branch 'master' into working/master/bgp-vpn-vrf-leaking
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 47 |
1 files changed, 41 insertions, 6 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 26f96d684..032b33229 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -82,6 +82,21 @@ extern const char *bgp_origin_str[]; extern const char *bgp_origin_long_str[]; +/* PMSI strings. */ +#define PMSI_TNLTYPE_STR_NO_INFO "No info" +#define PMSI_TNLTYPE_STR_DEFAULT PMSI_TNLTYPE_STR_NO_INFO +static const struct message bgp_pmsi_tnltype_str[] = { + {PMSI_TNLTYPE_NO_INFO, PMSI_TNLTYPE_STR_NO_INFO}, + {PMSI_TNLTYPE_RSVP_TE_P2MP, "RSVP-TE P2MP"}, + {PMSI_TNLTYPE_MLDP_P2MP, "mLDP P2MP"}, + {PMSI_TNLTYPE_PIM_SSM, "PIM-SSM"}, + {PMSI_TNLTYPE_PIM_SM, "PIM-SM"}, + {PMSI_TNLTYPE_PIM_BIDIR, "PIM-BIDIR"}, + {PMSI_TNLTYPE_INGR_REPL, "Ingress Replication"}, + {PMSI_TNLTYPE_MLDP_MP2MP, "mLDP MP2MP"}, + {0} +}; + struct bgp_node *bgp_afi_node_get(struct bgp_table *table, afi_t afi, safi_t safi, struct prefix *p, struct prefix_rd *prd) @@ -2285,12 +2300,13 @@ static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn, /* advertise/withdraw type-5 routes */ if ((afi == AFI_IP || afi == AFI_IP6) && (safi == SAFI_UNICAST)) { - if (new_select - && (!new_select->extra || !new_select->extra->parent)) - bgp_evpn_advertise_type5_route( - bgp, &rn->p, new_select->attr, afi, safi); - else if (old_select - && (!old_select->extra || !old_select->extra->parent)) + if (advertise_type5_routes(bgp, afi) && new_select && + (!new_select->extra || !new_select->extra->parent)) + bgp_evpn_advertise_type5_route(bgp, &rn->p, + new_select->attr, + afi, safi); + else if (advertise_type5_routes(bgp, afi) && old_select && + (!old_select->extra || !old_select->extra->parent)) bgp_evpn_withdraw_type5_route(bgp, &rn->p, afi, safi); } @@ -7197,6 +7213,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p, json_object *json_ext_community = NULL; json_object *json_lcommunity = NULL; json_object *json_last_update = NULL; + json_object *json_pmsi = NULL; json_object *json_nexthop_global = NULL; json_object *json_nexthop_ll = NULL; json_object *json_nexthops = NULL; @@ -7949,6 +7966,24 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct prefix *p, json_last_update); } else vty_out(vty, " Last update: %s", ctime(&tbuf)); + + /* Line 10 display PMSI tunnel attribute, if present */ + if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_PMSI_TUNNEL)) { + const char *str = lookup_msg(bgp_pmsi_tnltype_str, + attr->pmsi_tnl_type, + PMSI_TNLTYPE_STR_DEFAULT); + + if (json_paths) { + json_pmsi = json_object_new_object(); + json_object_string_add(json_pmsi, + "tunnelType", str); + json_object_object_add(json_path, "pmsi", + json_pmsi); + } else + vty_out(vty, " PMSI Tunnel Type: %s\n", + str); + } + } /* We've constructed the json object for this path, add it to the json |