1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Opaque data for Zebra from other daemons.
4 * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
7 #ifndef FRR_ROUTE_OPAQUE_H
8 #define FRR_ROUTE_OPAQUE_H
13 /* copied from bgpd/bgp_community.h */
14 #define COMMUNITY_SIZE 4
15 /* copied from bgpd/bgp_lcommunity.h */
16 #define LCOMMUNITY_SIZE 12
17 /* copied from bgpd/bgp_route.h */
18 #define BGP_MAX_SELECTION_REASON_STR_BUF 32
20 struct bgp_zebra_opaque
{
23 /* Show at least 10 communities AA:BB */
24 char community
[COMMUNITY_SIZE
* 20];
26 /* Show at least 10 large-communities AA:BB:CC */
27 char lcommunity
[LCOMMUNITY_SIZE
* 30];
29 /* 32 bytes seems enough because of
30 * bgp_path_selection_confed_as_path which is
31 * `Confederation based AS Path`.
33 char selection_reason
[BGP_MAX_SELECTION_REASON_STR_BUF
];
36 struct ospf_zebra_opaque
{
38 char area_id
[INET_ADDRSTRLEN
];
42 static_assert(sizeof(struct bgp_zebra_opaque
) <= ZAPI_MESSAGE_OPAQUE_LENGTH
,
43 "BGP opaque data shouldn't be larger than zebra's buffer");
44 static_assert(sizeof(struct ospf_zebra_opaque
) <= ZAPI_MESSAGE_OPAQUE_LENGTH
,
45 "OSPF opaque data shouldn't be larger than zebra's buffer");
47 #endif /* FRR_ROUTE_OPAQUE_H */