summaryrefslogtreecommitdiff
path: root/lib/route_opaque.h
blob: c5e7d6a327a8b8fade9244e4cc0aae65c8611f67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* Opaque data for Zebra from other daemons.
 *
 * Copyright (C) 2021 Donatas Abraitis <donatas.abraitis@gmail.com>
 *
 * This file is part of FRRouting (FRR).
 *
 * FRR is free software; you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2, or (at your option) any later version.
 *
 * FRR is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; see the file COPYING; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef FRR_ROUTE_OPAQUE_H
#define FRR_ROUTE_OPAQUE_H

#include "assert.h"
#include "zclient.h"

#include "bgpd/bgp_aspath.h"
#include "bgpd/bgp_community.h"
#include "bgpd/bgp_lcommunity.h"

struct bgp_zebra_opaque {
	char aspath[256];

	/* Show at least 10 communities AA:BB */
	char community[COMMUNITY_SIZE * 20];

	/* Show at least 10 large-communities AA:BB:CC */
	char lcommunity[LCOMMUNITY_SIZE * 30];

	/* 32 bytes seems enough because of
	 * bgp_path_selection_confed_as_path which is
	 * `Confederation based AS Path`.
	 */
	char selection_reason[BGP_MAX_SELECTION_REASON_STR_BUF];
};

static_assert(sizeof(struct bgp_zebra_opaque) <= ZAPI_MESSAGE_OPAQUE_LENGTH,
              "BGP opaque data shouldn't be larger than zebra's buffer");

#endif /* FRR_ROUTE_OPAQUE_H */