]> git.proxmox.com Git - mirror_frr.git/blob - lib/route_opaque.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / lib / route_opaque.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* Opaque data for Zebra from other daemons.
3 *
4 * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
5 */
6
7 #ifndef FRR_ROUTE_OPAQUE_H
8 #define FRR_ROUTE_OPAQUE_H
9
10 #include "assert.h"
11 #include "zclient.h"
12
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
19
20 struct bgp_zebra_opaque {
21 char aspath[256];
22
23 /* Show at least 10 communities AA:BB */
24 char community[COMMUNITY_SIZE * 20];
25
26 /* Show at least 10 large-communities AA:BB:CC */
27 char lcommunity[LCOMMUNITY_SIZE * 30];
28
29 /* 32 bytes seems enough because of
30 * bgp_path_selection_confed_as_path which is
31 * `Confederation based AS Path`.
32 */
33 char selection_reason[BGP_MAX_SELECTION_REASON_STR_BUF];
34 };
35
36 struct ospf_zebra_opaque {
37 char path_type[32];
38 char area_id[INET_ADDRSTRLEN];
39 char tag[16];
40 };
41
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");
46
47 #endif /* FRR_ROUTE_OPAQUE_H */