]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_open.h
*: add indent control files
[mirror_frr.git] / bgpd / bgp_open.h
CommitLineData
718e3744 1/* BGP open message handling
896014f4
DL
2 * Copyright (C) 1999 Kunihiro Ishiguro
3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more 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 */
718e3744 20
00d252cb 21#ifndef _QUAGGA_BGP_OPEN_H
22#define _QUAGGA_BGP_OPEN_H
23
6d58272b
PJ
24/* Standard header for capability TLV */
25struct capability_header
26{
27 u_char code;
28 u_char length;
29};
30
31/* Generic MP capability data */
32struct capability_mp_data
718e3744 33{
b58ed1f8 34 iana_afi_t afi;
718e3744 35 u_char reserved;
4c9641ba 36 safi_t safi;
718e3744 37};
38
0b2aa3a0
PJ
39struct capability_as4
40{
41 uint32_t as4;
42};
43
538621f2 44struct graceful_restart_af
45{
4c9641ba
ML
46 afi_t afi;
47 safi_t safi;
538621f2 48 u_char flag;
49};
50
6d58272b
PJ
51struct capability_gr
52{
53 u_int16_t restart_flag_time;
54 struct graceful_restart_af gr[];
55};
56
538621f2 57/* Capability Code */
58#define CAPABILITY_CODE_MP 1 /* Multiprotocol Extensions */
59#define CAPABILITY_CODE_REFRESH 2 /* Route Refresh Capability */
60#define CAPABILITY_CODE_ORF 3 /* Cooperative Route Filtering Capability */
61#define CAPABILITY_CODE_RESTART 64 /* Graceful Restart Capability */
6d58272b 62#define CAPABILITY_CODE_AS4 65 /* 4-octet AS number Capability */
89eeecb8
DS
63#define CAPABILITY_CODE_DYNAMIC_OLD 66 /* Dynamic Capability, deprecated since 2003 */
64#define CAPABILITY_CODE_DYNAMIC 67 /* Dynamic Capability */
a82478b9 65#define CAPABILITY_CODE_ADDPATH 69 /* Addpath Capability */
04b6bdc0 66#define CAPABILITY_CODE_FQDN 73 /* Advertise hostname capabilty */
8a92a8a0 67#define CAPABILITY_CODE_ENHE 5 /* Extended Next Hop Encoding */
538621f2 68#define CAPABILITY_CODE_REFRESH_OLD 128 /* Route Refresh Capability(cisco) */
69#define CAPABILITY_CODE_ORF_OLD 130 /* Cooperative Route Filtering Capability(cisco) */
718e3744 70
04b6bdc0 71
538621f2 72/* Capability Length */
73#define CAPABILITY_CODE_MP_LEN 4
718e3744 74#define CAPABILITY_CODE_REFRESH_LEN 0
538621f2 75#define CAPABILITY_CODE_DYNAMIC_LEN 0
76#define CAPABILITY_CODE_RESTART_LEN 2 /* Receiving only case */
6d58272b 77#define CAPABILITY_CODE_AS4_LEN 4
a82478b9 78#define CAPABILITY_CODE_ADDPATH_LEN 4
8a92a8a0 79#define CAPABILITY_CODE_ENHE_LEN 6 /* NRLI AFI = 2, SAFI = 2, Nexthop AFI = 2 */
e978e1de
DS
80#define CAPABILITY_CODE_MIN_FQDN_LEN 2
81#define CAPABILITY_CODE_ORF_LEN 5
718e3744 82
83/* Cooperative Route Filtering Capability. */
718e3744 84
538621f2 85/* ORF Type */
718e3744 86#define ORF_TYPE_PREFIX 64
87#define ORF_TYPE_PREFIX_OLD 128
88
538621f2 89/* ORF Mode */
718e3744 90#define ORF_MODE_RECEIVE 1
91#define ORF_MODE_SEND 2
92#define ORF_MODE_BOTH 3
93
718e3744 94/* Capability Message Action. */
95#define CAPABILITY_ACTION_SET 0
96#define CAPABILITY_ACTION_UNSET 1
97
538621f2 98/* Graceful Restart */
99#define RESTART_R_BIT 0x8000
100#define RESTART_F_BIT 0x80
101
94f2b392 102extern int bgp_open_option_parse (struct peer *, u_char, int *);
103extern void bgp_open_capability (struct stream *, struct peer *);
856ca177 104extern void bgp_capability_vty_out (struct vty *, struct peer *, u_char, json_object *);
0b2aa3a0 105extern as_t peek_for_as4_capability (struct peer *, u_char);
00d252cb 106
107#endif /* _QUAGGA_BGP_OPEN_H */