]> git.proxmox.com Git - mirror_frr.git/blame - lib/route_opaque.h
Merge pull request #13649 from donaldsharp/unlock_the_node_or_else
[mirror_frr.git] / lib / route_opaque.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
94effaf0
DA
2/* Opaque data for Zebra from other daemons.
3 *
4 * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
94effaf0
DA
5 */
6
7#ifndef FRR_ROUTE_OPAQUE_H
8#define FRR_ROUTE_OPAQUE_H
9
b5bb70e3
IR
10#include "assert.h"
11#include "zclient.h"
12
959331a3
RW
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
94effaf0
DA
19
20struct bgp_zebra_opaque {
a9bf0ff2 21 char aspath[256];
94effaf0
DA
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];
1d7260a1
DA
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];
94effaf0
DA
34};
35
5b5d66c4
RW
36struct ospf_zebra_opaque {
37 char path_type[32];
38 char area_id[INET_ADDRSTRLEN];
39 char tag[16];
40};
41
b5bb70e3
IR
42static_assert(sizeof(struct bgp_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
43 "BGP opaque data shouldn't be larger than zebra's buffer");
5b5d66c4
RW
44static_assert(sizeof(struct ospf_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
45 "OSPF opaque data shouldn't be larger than zebra's buffer");
b5bb70e3 46
94effaf0 47#endif /* FRR_ROUTE_OPAQUE_H */