summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_route.c
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2023-01-11 13:24:47 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2023-09-18 15:07:32 +0200
commit8b531b110756bf8627b5716f433190a0748b5e76 (patch)
tree8e6aedafd631a05073461a8a0ea6afd4406e51be /bgpd/bgp_route.c
parentdoc: add the bgp link-state user documentation (diff)
downloadfrr-8b531b110756bf8627b5716f433190a0748b5e76.tar.xz
frr-8b531b110756bf8627b5716f433190a0748b5e76.zip
bgpd: store and send bgp link-state attributes
Add the ability to store a raw copy of the incoming BGP Link-State attributes and to redistribute them as is to other routes. New types of data BGP_ATTR_LS and BGP_ATTR_LS_DATA are defined. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r--bgpd/bgp_route.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 5b9a36121..30d99af0f 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -10112,6 +10112,7 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
json_object *json_peer = NULL;
json_object *json_string = NULL;
json_object *json_adv_to = NULL;
+ json_object *json_bgp_ls_attr = NULL;
int first = 0;
struct listnode *node, *nnode;
struct peer *peer;
@@ -11045,10 +11046,28 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp, struct bgp_dest *bn,
" Time until Long-lived stale route deleted: %lu\n",
llgr_remaining);
}
- if (safi == SAFI_LINKSTATE && json_paths)
- bgp_linkstate_nlri_prefix_json(
- json_path, bn->rn->p.u.prefix_linkstate.nlri_type,
- bn->rn->p.u.prefix_linkstate.ptr, bn->rn->p.prefixlen);
+
+ if (safi == SAFI_LINKSTATE) {
+ /* BGP Link-State NLRI */
+ if (json_paths)
+ bgp_linkstate_nlri_prefix_json(
+ json_path, bn->rn->p.u.prefix_linkstate.nlri_type,
+ bn->rn->p.u.prefix_linkstate.ptr, bn->rn->p.prefixlen);
+
+ /* BGP Link-State Attributes */
+ if (attr->link_state) {
+ if (json_paths) {
+ json_bgp_ls_attr = json_object_new_object();
+ json_object_object_add(json_path,
+ "linkStateAttributes",
+ json_bgp_ls_attr);
+ } else {
+ vty_out(vty, " BGP-LS attributes:\n");
+ }
+ bgp_linkstate_tlv_attribute_display(
+ vty, attr->link_state, 4, json_bgp_ls_attr);
+ }
+ }
/* Output some debug about internal state of the dest flags */
if (json_paths) {