]> git.proxmox.com Git - mirror_frr.git/blame - lib/route_opaque.h
Merge pull request #10987 from opensourcerouting/fix/bgp_conditional_advertisements_r...
[mirror_frr.git] / lib / route_opaque.h
CommitLineData
94effaf0
DA
1/* Opaque data for Zebra from other daemons.
2 *
3 * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
4 *
5 * This file is part of FRRouting (FRR).
6 *
7 * FRR is free software; you can redistribute it and/or modify it under the
8 * terms of the GNU General Public License as published by the Free Software
9 * Foundation; either version 2, or (at your option) any later version.
10 *
11 * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 * details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#ifndef FRR_ROUTE_OPAQUE_H
22#define FRR_ROUTE_OPAQUE_H
23
b5bb70e3
IR
24#include "assert.h"
25#include "zclient.h"
26
959331a3
RW
27/* copied from bgpd/bgp_community.h */
28#define COMMUNITY_SIZE 4
29/* copied from bgpd/bgp_lcommunity.h */
30#define LCOMMUNITY_SIZE 12
31/* copied from bgpd/bgp_route.h */
32#define BGP_MAX_SELECTION_REASON_STR_BUF 32
94effaf0
DA
33
34struct bgp_zebra_opaque {
a9bf0ff2 35 char aspath[256];
94effaf0
DA
36
37 /* Show at least 10 communities AA:BB */
38 char community[COMMUNITY_SIZE * 20];
39
40 /* Show at least 10 large-communities AA:BB:CC */
41 char lcommunity[LCOMMUNITY_SIZE * 30];
1d7260a1
DA
42
43 /* 32 bytes seems enough because of
44 * bgp_path_selection_confed_as_path which is
45 * `Confederation based AS Path`.
46 */
47 char selection_reason[BGP_MAX_SELECTION_REASON_STR_BUF];
94effaf0
DA
48};
49
5b5d66c4
RW
50struct ospf_zebra_opaque {
51 char path_type[32];
52 char area_id[INET_ADDRSTRLEN];
53 char tag[16];
54};
55
b5bb70e3
IR
56static_assert(sizeof(struct bgp_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
57 "BGP opaque data shouldn't be larger than zebra's buffer");
5b5d66c4
RW
58static_assert(sizeof(struct ospf_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
59 "OSPF opaque data shouldn't be larger than zebra's buffer");
b5bb70e3 60
94effaf0 61#endif /* FRR_ROUTE_OPAQUE_H */