1/* BGP open message handling
2   Copyright (C) 1999 Kunihiro Ishiguro
3
4This file is part of GNU Zebra.
5
6GNU Zebra is free software; you can redistribute it and/or modify it
7under the terms of the GNU General Public License as published by the
8Free Software Foundation; either version 2, or (at your option) any
9later version.
10
11GNU Zebra is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Zebra; see the file COPYING.  If not, write to the Free
18Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1902111-1307, USA.  */
20
21/* MP Capability information. */
22struct capability_mp
23{
24  u_int16_t afi;
25  u_char reserved;
26  u_char safi;
27};
28
29/* BGP open message capability. */
30struct capability
31{
32  u_char code;
33  u_char length;
34  struct capability_mp mpc;
35};
36
37/* Multiprotocol Extensions capabilities. */
38#define CAPABILITY_CODE_MP              1
39#define CAPABILITY_CODE_MP_LEN          4
40
41/* Route refresh capabilities. */
42#define CAPABILITY_CODE_REFRESH         2
43#define CAPABILITY_CODE_REFRESH_OLD   128
44#define CAPABILITY_CODE_REFRESH_LEN     0
45
46/* Cooperative Route Filtering Capability.  */
47#define CAPABILITY_CODE_ORF             3
48#define CAPABILITY_CODE_ORF_OLD       130
49
50/* ORF Type.  */
51#define ORF_TYPE_PREFIX                64
52#define ORF_TYPE_PREFIX_OLD           128
53
54/* ORF Mode.  */
55#define ORF_MODE_RECEIVE                1
56#define ORF_MODE_SEND                   2
57#define ORF_MODE_BOTH                   3
58
59/* Dynamic capability.  */
60#define CAPABILITY_CODE_DYNAMIC        66
61#define CAPABILITY_CODE_DYNAMIC_LEN     0
62
63/* Capability Message Action.  */
64#define CAPABILITY_ACTION_SET           0
65#define CAPABILITY_ACTION_UNSET         1
66
67int bgp_open_option_parse (struct peer *, u_char, int *);
68void bgp_open_capability (struct stream *, struct peer *);
69void bgp_capability_vty_out (struct vty *, struct peer *);
70