summaryrefslogtreecommitdiff
path: root/lib/route_opaque.h
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-09-20 22:15:55 -0300
committerDavid Lamparter <equinox@opensourcerouting.org>2022-01-15 17:22:27 +0100
commit5b5d66c43142c3d60a1595e08b0c316df1f8c85a (patch)
tree4a67c34b3c959fec2b00f531db06255105aefcc2 /lib/route_opaque.h
parentc1879c8fc50243b1edd0b42ae365adf35f190a09 (diff)
lib, ospfd, ospf6d, zebra: add OSPF opaque route attributes
Update ospfd and ospf6d to send opaque route attributes to zebra. Those attributes are stored in the RIB and can be viewed using the "show ip[v6] route" commands (other than that, they are completely ignored by zebra). Example: ``` debian# show ip route 192.168.1.0/24 Routing entry for 192.168.1.0/24 Known via "ospf", distance 110, metric 20, best Last update 01:57:08 ago * 10.0.1.2, via eth-rt2, weight 1 OSPF path type : External-2 OSPF tag : 0 debian# debian# show ip route 192.168.1.0/24 json { "192.168.1.0\/24":[ { "prefix":"192.168.1.0\/24", "prefixLen":24, "protocol":"ospf", "vrfId":0, "vrfName":"default", "selected":true, [snip] "ospfPathType":"External-2", "ospfTag":"0" } ] } ``` Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/route_opaque.h')
-rw-r--r--lib/route_opaque.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/route_opaque.h b/lib/route_opaque.h
index 678a171e48..bf6081c054 100644
--- a/lib/route_opaque.h
+++ b/lib/route_opaque.h
@@ -47,7 +47,15 @@ struct bgp_zebra_opaque {
char selection_reason[BGP_MAX_SELECTION_REASON_STR_BUF];
};
+struct ospf_zebra_opaque {
+ char path_type[32];
+ char area_id[INET_ADDRSTRLEN];
+ char tag[16];
+};
+
static_assert(sizeof(struct bgp_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
"BGP opaque data shouldn't be larger than zebra's buffer");
+static_assert(sizeof(struct ospf_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
+ "OSPF opaque data shouldn't be larger than zebra's buffer");
#endif /* FRR_ROUTE_OPAQUE_H */