]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgpd.h
ptm-integration.patch
[mirror_frr.git] / bgpd / bgpd.h
CommitLineData
718e3744 1/* BGP message definition header.
2 Copyright (C) 1996, 97, 98, 99, 2000 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
00d252cb 21#ifndef _QUAGGA_BGPD_H
22#define _QUAGGA_BGPD_H
23
718e3744 24/* For union sockunion. */
25#include "sockunion.h"
26
27/* Typedef BGP specific types. */
0b2aa3a0
PJ
28typedef u_int32_t as_t;
29typedef u_int16_t as16_t; /* we may still encounter 16 Bit asnums */
718e3744 30typedef u_int16_t bgp_size_t;
31
32/* BGP master for system wide configurations and variables. */
33struct bgp_master
34{
35 /* BGP instance list. */
36 struct list *bgp;
37
38 /* BGP thread master. */
39 struct thread_master *master;
40
200df115 41 /* work queues */
42 struct work_queue *process_main_queue;
43 struct work_queue *process_rsclient_queue;
200df115 44
0df7c91f
PJ
45 /* Listening sockets */
46 struct list *listen_sockets;
47
718e3744 48 /* BGP port number. */
49 u_int16_t port;
50
3a02d1f7
PJ
51 /* Listener address */
52 char *address;
53
718e3744 54 /* BGP start time. */
55 time_t start_time;
56
57 /* Various BGP global configuration. */
58 u_char options;
59#define BGP_OPT_NO_FIB (1 << 0)
60#define BGP_OPT_MULTIPLE_INSTANCE (1 << 1)
61#define BGP_OPT_CONFIG_CISCO (1 << 2)
cccbc015 62#define BGP_OPT_NO_LISTEN (1 << 3)
718e3744 63};
64
73ac8160
DS
65/* BGP route-map structure. */
66struct bgp_rmap
67{
68 char *name;
69 struct route_map *map;
70};
71
718e3744 72/* BGP instance structure. */
73struct bgp
74{
75 /* AS number of this BGP instance. */
76 as_t as;
77
78 /* Name of this BGP instance. */
79 char *name;
200df115 80
0088b5dc
SH
81 /* Reference count to allow peer_delete to finish after bgp_delete */
82 int lock;
83
718e3744 84 /* Self peer. */
85 struct peer *peer_self;
86
87 /* BGP peer. */
88 struct list *peer;
89
90 /* BGP peer group. */
91 struct list *group;
92
fee0f4c6 93 /* BGP route-server-clients. */
94 struct list *rsclient;
95
718e3744 96 /* BGP configuration. */
97 u_int16_t config;
98#define BGP_CONFIG_ROUTER_ID (1 << 0)
99#define BGP_CONFIG_CLUSTER_ID (1 << 1)
100#define BGP_CONFIG_CONFEDERATION (1 << 2)
718e3744 101
102 /* BGP router identifier. */
103 struct in_addr router_id;
18a6dce6 104 struct in_addr router_id_static;
718e3744 105
106 /* BGP route reflector cluster ID. */
107 struct in_addr cluster_id;
108
109 /* BGP confederation information. */
110 as_t confed_id;
111 as_t *confed_peers;
112 int confed_peers_cnt;
113
abc920f8
DS
114 struct thread *t_startup; /* start-up timer on only once at the beginning */
115
116 u_int32_t v_maxmed_onstartup; /* Duration of max-med on start-up */
117#define BGP_MAXMED_ONSTARTUP_UNCONFIGURED 0 /* 0 means off, its the default */
118 u_int32_t maxmed_onstartup_value; /* Max-med value when active on start-up */
119 struct thread *t_maxmed_onstartup; /* non-null when max-med onstartup is on */
120 u_char maxmed_onstartup_over; /* Flag to make it effective only once */
121
122 u_char v_maxmed_admin; /* 1/0 if max-med administrative is on/off */
123#define BGP_MAXMED_ADMIN_UNCONFIGURED 0 /* Off by default */
124 u_int32_t maxmed_admin_value; /* Max-med value when administrative in on */
125#define BGP_MAXMED_VALUE_DEFAULT 4294967294 /* Maximum by default */
126
127 u_char maxmed_active; /* 1/0 if max-med is active or not */
128 u_int32_t maxmed_value; /* Max-med value when its active */
fe7d2a48 129
f188f2c4
DS
130 /* BGP update delay on startup */
131 struct thread *t_update_delay;
132 struct thread *t_establish_wait;
133 u_char update_delay_over;
4a16ae86
DS
134 u_char main_zebra_update_hold;
135 u_char main_peers_update_hold;
136 u_char rsclient_peers_update_hold;
f188f2c4
DS
137 u_int16_t v_update_delay;
138 u_int16_t v_establish_wait;
139 char update_delay_begin_time[64];
140 char update_delay_end_time[64];
4a16ae86
DS
141 char update_delay_zebra_resume_time[64];
142 char update_delay_peers_resume_time[64];
f188f2c4
DS
143 u_int32_t established;
144 u_int32_t restarted_peers;
145 u_int32_t implicit_eors;
146 u_int32_t explicit_eors;
147#define BGP_UPDATE_DELAY_DEF 0
148#define BGP_UPDATE_DELAY_MIN 0
149#define BGP_UPDATE_DELAY_MAX 3600
150
718e3744 151 /* BGP flags. */
8bd9d948 152 u_int32_t flags;
718e3744 153#define BGP_FLAG_ALWAYS_COMPARE_MED (1 << 0)
154#define BGP_FLAG_DETERMINISTIC_MED (1 << 1)
155#define BGP_FLAG_MED_MISSING_AS_WORST (1 << 2)
156#define BGP_FLAG_MED_CONFED (1 << 3)
157#define BGP_FLAG_NO_DEFAULT_IPV4 (1 << 4)
158#define BGP_FLAG_NO_CLIENT_TO_CLIENT (1 << 5)
159#define BGP_FLAG_ENFORCE_FIRST_AS (1 << 6)
160#define BGP_FLAG_COMPARE_ROUTER_ID (1 << 7)
161#define BGP_FLAG_ASPATH_IGNORE (1 << 8)
162#define BGP_FLAG_IMPORT_CHECK (1 << 9)
163#define BGP_FLAG_NO_FAST_EXT_FAILOVER (1 << 10)
848973c7 164#define BGP_FLAG_LOG_NEIGHBOR_CHANGES (1 << 11)
538621f2 165#define BGP_FLAG_GRACEFUL_RESTART (1 << 12)
6811845b 166#define BGP_FLAG_ASPATH_CONFED (1 << 13)
2fdd455c 167#define BGP_FLAG_ASPATH_MULTIPATH_RELAX (1 << 14)
8bd9d948 168#define BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY (1 << 15)
718e3744 169
170 /* BGP Per AF flags */
171 u_int16_t af_flags[AFI_MAX][SAFI_MAX];
172#define BGP_CONFIG_DAMPENING (1 << 0)
173
174 /* Static route configuration. */
175 struct bgp_table *route[AFI_MAX][SAFI_MAX];
176
177 /* Aggregate address configuration. */
178 struct bgp_table *aggregate[AFI_MAX][SAFI_MAX];
179
180 /* BGP routing information base. */
181 struct bgp_table *rib[AFI_MAX][SAFI_MAX];
182
73ac8160
DS
183 /* BGP table route-map. */
184 struct bgp_rmap table_map[AFI_MAX][SAFI_MAX];
185
718e3744 186 /* BGP redistribute configuration. */
187 u_char redist[AFI_MAX][ZEBRA_ROUTE_MAX];
188
189 /* BGP redistribute metric configuration. */
190 u_char redist_metric_flag[AFI_MAX][ZEBRA_ROUTE_MAX];
191 u_int32_t redist_metric[AFI_MAX][ZEBRA_ROUTE_MAX];
192
193 /* BGP redistribute route-map. */
73ac8160 194 struct bgp_rmap rmap[AFI_MAX][ZEBRA_ROUTE_MAX];
718e3744 195
196 /* BGP distance configuration. */
197 u_char distance_ebgp;
198 u_char distance_ibgp;
199 u_char distance_local;
200
201 /* BGP default local-preference. */
202 u_int32_t default_local_pref;
203
204 /* BGP default timer. */
205 u_int32_t default_holdtime;
206 u_int32_t default_keepalive;
538621f2 207
208 /* BGP graceful restart */
93406d87 209 u_int32_t restart_time;
210 u_int32_t stalepath_time;
165b5fff
JB
211
212 /* Maximum-paths configuration */
213 struct bgp_maxpaths_cfg {
214 u_int16_t maxpaths_ebgp;
215 u_int16_t maxpaths_ibgp;
5e242b0d
DS
216 u_int16_t ibgp_flags;
217#define BGP_FLAG_IBGP_MULTIPATH_SAME_CLUSTERLEN (1 << 0)
165b5fff 218 } maxpaths[AFI_MAX][SAFI_MAX];
cb1faec9
DS
219
220 u_int32_t wpkt_quanta; /* per peer packet quanta to write */
718e3744 221};
222
223/* BGP peer-group support. */
224struct peer_group
225{
226 /* Name of the peer-group. */
227 char *name;
228
229 /* Pointer to BGP. */
230 struct bgp *bgp;
231
232 /* Peer-group client list. */
233 struct list *peer;
234
235 /* Peer-group config */
236 struct peer *conf;
237};
238
239/* BGP Notify message format. */
240struct bgp_notify
241{
242 u_char code;
243 u_char subcode;
244 char *data;
245 bgp_size_t length;
246};
247
248/* Next hop self address. */
249struct bgp_nexthop
250{
251 struct interface *ifp;
252 struct in_addr v4;
253#ifdef HAVE_IPV6
254 struct in6_addr v6_global;
255 struct in6_addr v6_local;
256#endif /* HAVE_IPV6 */
257};
258
259/* BGP router distinguisher value. */
260#define BGP_RD_SIZE 8
261
262struct bgp_rd
263{
264 u_char val[BGP_RD_SIZE];
265};
266
fee0f4c6 267#define RMAP_IN 0
268#define RMAP_OUT 1
269#define RMAP_IMPORT 2
270#define RMAP_EXPORT 3
271#define RMAP_MAX 4
272
718e3744 273/* BGP filter structure. */
274struct bgp_filter
275{
276 /* Distribute-list. */
277 struct
278 {
279 char *name;
280 struct access_list *alist;
281 } dlist[FILTER_MAX];
282
283 /* Prefix-list. */
284 struct
285 {
286 char *name;
287 struct prefix_list *plist;
288 } plist[FILTER_MAX];
289
290 /* Filter-list. */
291 struct
292 {
293 char *name;
294 struct as_list *aslist;
295 } aslist[FILTER_MAX];
296
297 /* Route-map. */
298 struct
299 {
300 char *name;
301 struct route_map *map;
fee0f4c6 302 } map[RMAP_MAX];
718e3744 303
304 /* Unsuppress-map. */
305 struct
306 {
307 char *name;
308 struct route_map *map;
309 } usmap;
310};
311
6d85b15b
JBD
312/* IBGP/EBGP identifier. We also have a CONFED peer, which is to say,
313 a peer who's AS is part of our Confederation. */
314typedef enum
315{
316 BGP_PEER_IBGP = 1,
317 BGP_PEER_EBGP,
318 BGP_PEER_INTERNAL,
319 BGP_PEER_CONFED,
320} bgp_peer_sort_t;
321
d6661008
DS
322/* BGP message header and packet size. */
323#define BGP_MARKER_SIZE 16
324#define BGP_HEADER_SIZE 19
325#define BGP_MAX_PACKET_SIZE 4096
326
718e3744 327/* BGP neighbor structure. */
328struct peer
329{
330 /* BGP structure. */
331 struct bgp *bgp;
332
200df115 333 /* reference count, primarily to allow bgp_process'ing of route_node's
334 * to be done after a struct peer is deleted.
335 *
336 * named 'lock' for hysterical reasons within Quagga.
337 */
338 int lock;
339
718e3744 340 /* BGP peer group. */
341 struct peer_group *group;
342 u_char af_group[AFI_MAX][SAFI_MAX];
343
344 /* Peer's remote AS number. */
345 as_t as;
346
347 /* Peer's local AS number. */
348 as_t local_as;
349
6d85b15b
JBD
350 bgp_peer_sort_t sort;
351
718e3744 352 /* Peer's Change local AS number. */
353 as_t change_local_as;
354
355 /* Remote router ID. */
356 struct in_addr remote_id;
357
358 /* Local router ID. */
359 struct in_addr local_id;
360
fee0f4c6 361 /* Peer specific RIB when configured as route-server-client. */
362 struct bgp_table *rib[AFI_MAX][SAFI_MAX];
363
718e3744 364 /* Packet receive and send buffer. */
365 struct stream *ibuf;
366 struct stream_fifo *obuf;
367 struct stream *work;
368
8c71e481
PM
369 /* We use a separate stream to encode MP_REACH_NLRI for efficient
370 * NLRI packing. peer->work stores all the other attributes. The
371 * actual packet is then constructed by concatenating the two.
372 */
373 struct stream *scratch;
374
1ff9a340
DS
375 /* the doppelganger peer structure, due to dual TCP conn setup */
376 struct peer *doppelganger;
377
718e3744 378 /* Status of the peer. */
379 int status;
380 int ostatus;
381
0b2aa3a0
PJ
382 /* Peer index, used for dumping TABLE_DUMP_V2 format */
383 uint16_t table_dump_index;
384
718e3744 385 /* Peer information */
eb821189 386 int fd; /* File descriptor */
387 int ttl; /* TTL of TCP connection to the peer. */
fa411a21 388 int gtsm_hops; /* minimum hopcount to peer */
eb821189 389 char *desc; /* Description of the peer. */
390 unsigned short port; /* Destination port for peer */
391 char *host; /* Printable address of the peer. */
392 union sockunion su; /* Sockunion address of the peer. */
a80beece 393#define BGP_PEER_SU_UNSPEC(peer) (peer->su.sa.sa_family == AF_UNSPEC)
eb821189 394 time_t uptime; /* Last Up/Down time */
395 time_t readtime; /* Last read time */
396 time_t resettime; /* Last reset time */
718e3744 397
eb821189 398 unsigned int ifindex; /* ifindex of the BGP connection. */
a80beece 399 char *conf_if; /* neighbor interface config name. */
eb821189 400 char *ifname; /* bind interface name. */
401 char *update_if;
402 union sockunion *update_source;
403 struct zlog *log;
eb821189 404
405 union sockunion *su_local; /* Sockunion of local address. */
406 union sockunion *su_remote; /* Sockunion of remote address. */
407 int shared_network; /* Is this peer shared same network. */
408 struct bgp_nexthop nexthop; /* Nexthop */
718e3744 409
410 /* Peer address family configuration. */
411 u_char afc[AFI_MAX][SAFI_MAX];
412 u_char afc_nego[AFI_MAX][SAFI_MAX];
413 u_char afc_adv[AFI_MAX][SAFI_MAX];
414 u_char afc_recv[AFI_MAX][SAFI_MAX];
415
0a486e5f 416 /* Capability flags (reset in bgp_stop) */
0b2aa3a0 417 u_int16_t cap;
718e3744 418#define PEER_CAP_REFRESH_ADV (1 << 0) /* refresh advertised */
419#define PEER_CAP_REFRESH_OLD_RCV (1 << 1) /* refresh old received */
420#define PEER_CAP_REFRESH_NEW_RCV (1 << 2) /* refresh rfc received */
421#define PEER_CAP_DYNAMIC_ADV (1 << 3) /* dynamic advertised */
422#define PEER_CAP_DYNAMIC_RCV (1 << 4) /* dynamic received */
538621f2 423#define PEER_CAP_RESTART_ADV (1 << 5) /* restart advertised */
424#define PEER_CAP_RESTART_RCV (1 << 6) /* restart received */
0b2aa3a0
PJ
425#define PEER_CAP_AS4_ADV (1 << 7) /* as4 advertised */
426#define PEER_CAP_AS4_RCV (1 << 8) /* as4 received */
fe7d2a48
DS
427#define PEER_CAP_RESTART_BIT_ADV (1 << 9) /* sent restart state */
428#define PEER_CAP_RESTART_BIT_RCV (1 << 10) /* peer restart state */
718e3744 429
0a486e5f 430 /* Capability flags (reset in bgp_stop) */
718e3744 431 u_int16_t af_cap[AFI_MAX][SAFI_MAX];
432#define PEER_CAP_ORF_PREFIX_SM_ADV (1 << 0) /* send-mode advertised */
433#define PEER_CAP_ORF_PREFIX_RM_ADV (1 << 1) /* receive-mode advertised */
434#define PEER_CAP_ORF_PREFIX_SM_RCV (1 << 2) /* send-mode received */
435#define PEER_CAP_ORF_PREFIX_RM_RCV (1 << 3) /* receive-mode received */
436#define PEER_CAP_ORF_PREFIX_SM_OLD_RCV (1 << 4) /* send-mode received */
437#define PEER_CAP_ORF_PREFIX_RM_OLD_RCV (1 << 5) /* receive-mode received */
93406d87 438#define PEER_CAP_RESTART_AF_RCV (1 << 6) /* graceful restart afi/safi received */
439#define PEER_CAP_RESTART_AF_PRESERVE_RCV (1 << 7) /* graceful restart afi/safi F-bit received */
718e3744 440
441 /* Global configuration flags. */
442 u_int32_t flags;
443#define PEER_FLAG_PASSIVE (1 << 0) /* passive mode */
444#define PEER_FLAG_SHUTDOWN (1 << 1) /* shutdown */
445#define PEER_FLAG_DONT_CAPABILITY (1 << 2) /* dont-capability */
446#define PEER_FLAG_OVERRIDE_CAPABILITY (1 << 3) /* override-capability */
447#define PEER_FLAG_STRICT_CAP_MATCH (1 << 4) /* strict-match */
c9502438 448#define PEER_FLAG_DYNAMIC_CAPABILITY (1 << 5) /* dynamic capability */
6ffd2079 449#define PEER_FLAG_DISABLE_CONNECTED_CHECK (1 << 6) /* disable-connected-check */
c9502438 450#define PEER_FLAG_LOCAL_AS_NO_PREPEND (1 << 7) /* local-as no-prepend */
9d3f9705 451#define PEER_FLAG_LOCAL_AS_REPLACE_AS (1 << 8) /* local-as no-prepend replace-as */
1ff9a340
DS
452#define PEER_FLAG_DELETE (1 << 9) /* mark the peer for deleting */
453#define PEER_FLAG_CONFIG_NODE (1 << 10) /* the node to update configs on */
718e3744 454
93406d87 455 /* NSF mode (graceful restart) */
456 u_char nsf[AFI_MAX][SAFI_MAX];
457
718e3744 458 /* Per AF configuration flags. */
459 u_int32_t af_flags[AFI_MAX][SAFI_MAX];
460#define PEER_FLAG_SEND_COMMUNITY (1 << 0) /* send-community */
461#define PEER_FLAG_SEND_EXT_COMMUNITY (1 << 1) /* send-community ext. */
462#define PEER_FLAG_NEXTHOP_SELF (1 << 2) /* next-hop-self */
463#define PEER_FLAG_REFLECTOR_CLIENT (1 << 3) /* reflector-client */
464#define PEER_FLAG_RSERVER_CLIENT (1 << 4) /* route-server-client */
465#define PEER_FLAG_SOFT_RECONFIG (1 << 5) /* soft-reconfiguration */
466#define PEER_FLAG_AS_PATH_UNCHANGED (1 << 6) /* transparent-as */
467#define PEER_FLAG_NEXTHOP_UNCHANGED (1 << 7) /* transparent-next-hop */
468#define PEER_FLAG_MED_UNCHANGED (1 << 8) /* transparent-next-hop */
469#define PEER_FLAG_DEFAULT_ORIGINATE (1 << 9) /* default-originate */
470#define PEER_FLAG_REMOVE_PRIVATE_AS (1 << 10) /* remove-private-as */
471#define PEER_FLAG_ALLOWAS_IN (1 << 11) /* set allowas-in */
472#define PEER_FLAG_ORF_PREFIX_SM (1 << 12) /* orf capability send-mode */
473#define PEER_FLAG_ORF_PREFIX_RM (1 << 13) /* orf capability receive-mode */
474#define PEER_FLAG_MAX_PREFIX (1 << 14) /* maximum prefix */
475#define PEER_FLAG_MAX_PREFIX_WARNING (1 << 15) /* maximum prefix warning-only */
0df7c91f 476#define PEER_FLAG_NEXTHOP_LOCAL_UNCHANGED (1 << 16) /* leave link-local nexthop unchanged */
9e7a53c1 477#define PEER_FLAG_NEXTHOP_SELF_ALL (1 << 17) /* next-hop-self all */
0df7c91f
PJ
478
479 /* MD5 password */
480 char *password;
718e3744 481
482 /* default-originate route-map. */
483 struct
484 {
485 char *name;
486 struct route_map *map;
487 } default_rmap[AFI_MAX][SAFI_MAX];
488
489 /* Peer status flags. */
490 u_int16_t sflags;
491#define PEER_STATUS_ACCEPT_PEER (1 << 0) /* accept peer */
492#define PEER_STATUS_PREFIX_OVERFLOW (1 << 1) /* prefix-overflow */
493#define PEER_STATUS_CAPABILITY_OPEN (1 << 2) /* capability open send */
494#define PEER_STATUS_HAVE_ACCEPT (1 << 3) /* accept peer's parent */
495#define PEER_STATUS_GROUP (1 << 4) /* peer-group conf */
93406d87 496#define PEER_STATUS_NSF_MODE (1 << 5) /* NSF aware peer */
497#define PEER_STATUS_NSF_WAIT (1 << 6) /* wait comeback peer */
718e3744 498
0a486e5f 499 /* Peer status af flags (reset in bgp_stop) */
718e3744 500 u_int16_t af_sflags[AFI_MAX][SAFI_MAX];
501#define PEER_STATUS_ORF_PREFIX_SEND (1 << 0) /* prefix-list send peer */
502#define PEER_STATUS_ORF_WAIT_REFRESH (1 << 1) /* wait refresh received peer */
503#define PEER_STATUS_DEFAULT_ORIGINATE (1 << 2) /* default-originate peer */
e0701b79 504#define PEER_STATUS_PREFIX_THRESHOLD (1 << 3) /* exceed prefix-threshold */
505#define PEER_STATUS_PREFIX_LIMIT (1 << 4) /* exceed prefix-limit */
93406d87 506#define PEER_STATUS_EOR_SEND (1 << 5) /* end-of-rib send to peer */
507#define PEER_STATUS_EOR_RECEIVED (1 << 6) /* end-of-rib received from peer */
e0701b79 508
718e3744 509 /* Default attribute value for the peer. */
510 u_int32_t config;
511#define PEER_CONFIG_WEIGHT (1 << 0) /* Default weight. */
512#define PEER_CONFIG_TIMER (1 << 1) /* keepalive & holdtime */
513#define PEER_CONFIG_CONNECT (1 << 2) /* connect */
514#define PEER_CONFIG_ROUTEADV (1 << 3) /* route advertise */
515 u_int32_t weight;
516 u_int32_t holdtime;
517 u_int32_t keepalive;
518 u_int32_t connect;
519 u_int32_t routeadv;
520
521 /* Timer values. */
522 u_int32_t v_start;
523 u_int32_t v_connect;
524 u_int32_t v_holdtime;
525 u_int32_t v_keepalive;
526 u_int32_t v_asorig;
527 u_int32_t v_routeadv;
0a486e5f 528 u_int32_t v_pmax_restart;
93406d87 529 u_int32_t v_gr_restart;
718e3744 530
531 /* Threads. */
532 struct thread *t_read;
533 struct thread *t_write;
534 struct thread *t_start;
535 struct thread *t_connect;
536 struct thread *t_holdtime;
537 struct thread *t_keepalive;
538 struct thread *t_asorig;
539 struct thread *t_routeadv;
0a486e5f 540 struct thread *t_pmax_restart;
93406d87 541 struct thread *t_gr_restart;
542 struct thread *t_gr_stale;
64e580a7
PJ
543
544 /* workqueues */
545 struct work_queue *clear_node_queue;
546
718e3744 547 /* Statistics field */
548 u_int32_t open_in; /* Open message input count */
549 u_int32_t open_out; /* Open message output count */
550 u_int32_t update_in; /* Update message input count */
551 u_int32_t update_out; /* Update message ouput count */
552 time_t update_time; /* Update message received time. */
553 u_int32_t keepalive_in; /* Keepalive input count */
554 u_int32_t keepalive_out; /* Keepalive output count */
555 u_int32_t notify_in; /* Notify input count */
556 u_int32_t notify_out; /* Notify output count */
557 u_int32_t refresh_in; /* Route Refresh input count */
558 u_int32_t refresh_out; /* Route Refresh output count */
559 u_int32_t dynamic_cap_in; /* Dynamic Capability input count. */
560 u_int32_t dynamic_cap_out; /* Dynamic Capability output count. */
561
562 /* BGP state count */
563 u_int32_t established; /* Established */
564 u_int32_t dropped; /* Dropped */
565
f188f2c4
DS
566 /* Update delay related fields */
567 u_char update_delay_over; /* When this is set, BGP is no more waiting for EOR */
568
718e3744 569 /* Syncronization list and time. */
570 struct bgp_synchronize *sync[AFI_MAX][SAFI_MAX];
571 time_t synctime;
cb1faec9 572 time_t last_write; /* timestamp when the last UPDATE msg was written */
718e3744 573
574 /* Send prefix count. */
575 unsigned long scount[AFI_MAX][SAFI_MAX];
576
577 /* Announcement attribute hash. */
578 struct hash *hash[AFI_MAX][SAFI_MAX];
579
580 /* Notify data. */
581 struct bgp_notify notify;
582
583 /* Whole packet size to be read. */
584 unsigned long packet_size;
585
586 /* Filter structure. */
587 struct bgp_filter filter[AFI_MAX][SAFI_MAX];
588
589 /* ORF Prefix-list */
590 struct prefix_list *orf_plist[AFI_MAX][SAFI_MAX];
591
592 /* Prefix count. */
593 unsigned long pcount[AFI_MAX][SAFI_MAX];
594
595 /* Max prefix count. */
596 unsigned long pmax[AFI_MAX][SAFI_MAX];
e0701b79 597 u_char pmax_threshold[AFI_MAX][SAFI_MAX];
0a486e5f 598 u_int16_t pmax_restart[AFI_MAX][SAFI_MAX];
e0701b79 599#define MAXIMUM_PREFIX_THRESHOLD_DEFAULT 75
718e3744 600
601 /* allowas-in. */
602 char allowas_in[AFI_MAX][SAFI_MAX];
ac41b2a2 603
e0701b79 604 /* peer reset cause */
605 char last_reset;
606#define PEER_DOWN_RID_CHANGE 1 /* bgp router-id command */
607#define PEER_DOWN_REMOTE_AS_CHANGE 2 /* neighbor remote-as command */
608#define PEER_DOWN_LOCAL_AS_CHANGE 3 /* neighbor local-as command */
609#define PEER_DOWN_CLID_CHANGE 4 /* bgp cluster-id command */
610#define PEER_DOWN_CONFED_ID_CHANGE 5 /* bgp confederation identifier command */
611#define PEER_DOWN_CONFED_PEER_CHANGE 6 /* bgp confederation peer command */
612#define PEER_DOWN_RR_CLIENT_CHANGE 7 /* neighbor route-reflector-client command */
613#define PEER_DOWN_RS_CLIENT_CHANGE 8 /* neighbor route-server-client command */
614#define PEER_DOWN_UPDATE_SOURCE_CHANGE 9 /* neighbor update-source command */
615#define PEER_DOWN_AF_ACTIVATE 10 /* neighbor activate command */
616#define PEER_DOWN_USER_SHUTDOWN 11 /* neighbor shutdown command */
617#define PEER_DOWN_USER_RESET 12 /* clear ip bgp command */
618#define PEER_DOWN_NOTIFY_RECEIVED 13 /* notification received */
619#define PEER_DOWN_NOTIFY_SEND 14 /* notification send */
620#define PEER_DOWN_CLOSE_SESSION 15 /* tcp session close */
621#define PEER_DOWN_NEIGHBOR_DELETE 16 /* neghbor delete */
622#define PEER_DOWN_RMAP_BIND 17 /* neghbor peer-group command */
623#define PEER_DOWN_RMAP_UNBIND 18 /* no neighbor peer-group command */
624#define PEER_DOWN_CAPABILITY_CHANGE 19 /* neighbor capability command */
625#define PEER_DOWN_PASSIVE_CHANGE 20 /* neighbor passive command */
626#define PEER_DOWN_MULTIHOP_CHANGE 21 /* neighbor multihop command */
93406d87 627#define PEER_DOWN_NSF_CLOSE_SESSION 22 /* NSF tcp session close */
d6661008
DS
628unsigned long last_reset_cause_size;
629u_char last_reset_cause[BGP_MAX_PACKET_SIZE];
e0701b79 630
ac41b2a2 631 /* The kind of route-map Flags.*/
632 u_char rmap_type;
633#define PEER_RMAP_TYPE_IN (1 << 0) /* neighbor route-map in */
634#define PEER_RMAP_TYPE_OUT (1 << 1) /* neighbor route-map out */
635#define PEER_RMAP_TYPE_NETWORK (1 << 2) /* network route-map */
636#define PEER_RMAP_TYPE_REDISTRIBUTE (1 << 3) /* redistribute route-map */
637#define PEER_RMAP_TYPE_DEFAULT (1 << 4) /* default-originate route-map */
638#define PEER_RMAP_TYPE_NOSET (1 << 5) /* not allow to set commands */
fee0f4c6 639#define PEER_RMAP_TYPE_IMPORT (1 << 6) /* neighbor route-map import */
640#define PEER_RMAP_TYPE_EXPORT (1 << 7) /* neighbor route-map export */
718e3744 641};
642
0df7c91f
PJ
643#define PEER_PASSWORD_MINLEN (1)
644#define PEER_PASSWORD_MAXLEN (80)
645
718e3744 646/* This structure's member directly points incoming packet data
647 stream. */
648struct bgp_nlri
649{
650 /* AFI. */
651 afi_t afi;
652
653 /* SAFI. */
654 safi_t safi;
655
656 /* Pointer to NLRI byte stream. */
657 u_char *nlri;
658
659 /* Length of whole NLRI. */
660 bgp_size_t length;
661};
662
663/* BGP versions. */
664#define BGP_VERSION_4 4
718e3744 665
666/* Default BGP port number. */
667#define BGP_PORT_DEFAULT 179
668
718e3744 669/* BGP minimum message size. */
670#define BGP_MSG_OPEN_MIN_SIZE (BGP_HEADER_SIZE + 10)
671#define BGP_MSG_UPDATE_MIN_SIZE (BGP_HEADER_SIZE + 4)
672#define BGP_MSG_NOTIFY_MIN_SIZE (BGP_HEADER_SIZE + 2)
673#define BGP_MSG_KEEPALIVE_MIN_SIZE (BGP_HEADER_SIZE + 0)
674#define BGP_MSG_ROUTE_REFRESH_MIN_SIZE (BGP_HEADER_SIZE + 4)
675#define BGP_MSG_CAPABILITY_MIN_SIZE (BGP_HEADER_SIZE + 3)
676
677/* BGP message types. */
678#define BGP_MSG_OPEN 1
679#define BGP_MSG_UPDATE 2
680#define BGP_MSG_NOTIFY 3
681#define BGP_MSG_KEEPALIVE 4
682#define BGP_MSG_ROUTE_REFRESH_NEW 5
683#define BGP_MSG_CAPABILITY 6
684#define BGP_MSG_ROUTE_REFRESH_OLD 128
685
686/* BGP open optional parameter. */
687#define BGP_OPEN_OPT_AUTH 1
688#define BGP_OPEN_OPT_CAP 2
689
690/* BGP4 attribute type codes. */
691#define BGP_ATTR_ORIGIN 1
692#define BGP_ATTR_AS_PATH 2
693#define BGP_ATTR_NEXT_HOP 3
694#define BGP_ATTR_MULTI_EXIT_DISC 4
695#define BGP_ATTR_LOCAL_PREF 5
696#define BGP_ATTR_ATOMIC_AGGREGATE 6
697#define BGP_ATTR_AGGREGATOR 7
698#define BGP_ATTR_COMMUNITIES 8
699#define BGP_ATTR_ORIGINATOR_ID 9
700#define BGP_ATTR_CLUSTER_LIST 10
701#define BGP_ATTR_DPA 11
702#define BGP_ATTR_ADVERTISER 12
703#define BGP_ATTR_RCID_PATH 13
704#define BGP_ATTR_MP_REACH_NLRI 14
705#define BGP_ATTR_MP_UNREACH_NLRI 15
706#define BGP_ATTR_EXT_COMMUNITIES 16
0b2aa3a0
PJ
707#define BGP_ATTR_AS4_PATH 17
708#define BGP_ATTR_AS4_AGGREGATOR 18
41367172 709#define BGP_ATTR_AS_PATHLIMIT 21
718e3744 710
711/* BGP update origin. */
712#define BGP_ORIGIN_IGP 0
713#define BGP_ORIGIN_EGP 1
714#define BGP_ORIGIN_INCOMPLETE 2
715
716/* BGP notify message codes. */
717#define BGP_NOTIFY_HEADER_ERR 1
718#define BGP_NOTIFY_OPEN_ERR 2
719#define BGP_NOTIFY_UPDATE_ERR 3
720#define BGP_NOTIFY_HOLD_ERR 4
721#define BGP_NOTIFY_FSM_ERR 5
722#define BGP_NOTIFY_CEASE 6
723#define BGP_NOTIFY_CAPABILITY_ERR 7
724#define BGP_NOTIFY_MAX 8
725
4b4e07d2
DT
726#define BGP_NOTIFY_SUBCODE_UNSPECIFIC 0
727
718e3744 728/* BGP_NOTIFY_HEADER_ERR sub codes. */
729#define BGP_NOTIFY_HEADER_NOT_SYNC 1
730#define BGP_NOTIFY_HEADER_BAD_MESLEN 2
731#define BGP_NOTIFY_HEADER_BAD_MESTYPE 3
732#define BGP_NOTIFY_HEADER_MAX 4
733
734/* BGP_NOTIFY_OPEN_ERR sub codes. */
735#define BGP_NOTIFY_OPEN_UNSUP_VERSION 1
736#define BGP_NOTIFY_OPEN_BAD_PEER_AS 2
737#define BGP_NOTIFY_OPEN_BAD_BGP_IDENT 3
738#define BGP_NOTIFY_OPEN_UNSUP_PARAM 4
739#define BGP_NOTIFY_OPEN_AUTH_FAILURE 5
740#define BGP_NOTIFY_OPEN_UNACEP_HOLDTIME 6
741#define BGP_NOTIFY_OPEN_UNSUP_CAPBL 7
742#define BGP_NOTIFY_OPEN_MAX 8
743
744/* BGP_NOTIFY_UPDATE_ERR sub codes. */
745#define BGP_NOTIFY_UPDATE_MAL_ATTR 1
746#define BGP_NOTIFY_UPDATE_UNREC_ATTR 2
747#define BGP_NOTIFY_UPDATE_MISS_ATTR 3
748#define BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR 4
749#define BGP_NOTIFY_UPDATE_ATTR_LENG_ERR 5
750#define BGP_NOTIFY_UPDATE_INVAL_ORIGIN 6
751#define BGP_NOTIFY_UPDATE_AS_ROUTE_LOOP 7
752#define BGP_NOTIFY_UPDATE_INVAL_NEXT_HOP 8
753#define BGP_NOTIFY_UPDATE_OPT_ATTR_ERR 9
754#define BGP_NOTIFY_UPDATE_INVAL_NETWORK 10
755#define BGP_NOTIFY_UPDATE_MAL_AS_PATH 11
756#define BGP_NOTIFY_UPDATE_MAX 12
757
4b4e07d2 758/* BGP_NOTIFY_CEASE sub codes (RFC 4486). */
718e3744 759#define BGP_NOTIFY_CEASE_MAX_PREFIX 1
760#define BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN 2
761#define BGP_NOTIFY_CEASE_PEER_UNCONFIG 3
762#define BGP_NOTIFY_CEASE_ADMIN_RESET 4
763#define BGP_NOTIFY_CEASE_CONNECT_REJECT 5
764#define BGP_NOTIFY_CEASE_CONFIG_CHANGE 6
545acafb 765#define BGP_NOTIFY_CEASE_COLLISION_RESOLUTION 7
766#define BGP_NOTIFY_CEASE_OUT_OF_RESOURCE 8
767#define BGP_NOTIFY_CEASE_MAX 9
718e3744 768
769/* BGP_NOTIFY_CAPABILITY_ERR sub codes (draft-ietf-idr-dynamic-cap-02). */
770#define BGP_NOTIFY_CAPABILITY_INVALID_ACTION 1
771#define BGP_NOTIFY_CAPABILITY_INVALID_LENGTH 2
772#define BGP_NOTIFY_CAPABILITY_MALFORMED_CODE 3
773#define BGP_NOTIFY_CAPABILITY_MAX 4
774
775/* BGP finite state machine status. */
776#define Idle 1
777#define Connect 2
778#define Active 3
779#define OpenSent 4
780#define OpenConfirm 5
781#define Established 6
ca058a30
PJ
782#define Clearing 7
783#define Deleted 8
784#define BGP_STATUS_MAX 9
718e3744 785
786/* BGP finite state machine events. */
787#define BGP_Start 1
788#define BGP_Stop 2
789#define TCP_connection_open 3
790#define TCP_connection_closed 4
791#define TCP_connection_open_failed 5
792#define TCP_fatal_error 6
793#define ConnectRetry_timer_expired 7
794#define Hold_Timer_expired 8
795#define KeepAlive_timer_expired 9
796#define Receive_OPEN_message 10
797#define Receive_KEEPALIVE_message 11
798#define Receive_UPDATE_message 12
799#define Receive_NOTIFICATION_message 13
ca058a30
PJ
800#define Clearing_Completed 14
801#define BGP_EVENTS_MAX 15
718e3744 802
803/* BGP timers default value. */
5ca5f1c8 804#define BGP_INIT_START_TIMER 1
718e3744 805#define BGP_ERROR_START_TIMER 30
806#define BGP_DEFAULT_HOLDTIME 180
807#define BGP_DEFAULT_KEEPALIVE 60
808#define BGP_DEFAULT_ASORIGINATE 15
809#define BGP_DEFAULT_EBGP_ROUTEADV 30
810#define BGP_DEFAULT_IBGP_ROUTEADV 5
718e3744 811#define BGP_DEFAULT_CONNECT_RETRY 120
812
813/* BGP default local preference. */
814#define BGP_DEFAULT_LOCAL_PREF 100
815
538621f2 816/* BGP graceful restart */
817#define BGP_DEFAULT_RESTART_TIME 120
818#define BGP_DEFAULT_STALEPATH_TIME 360
819
42e6d745
DO
820/* RFC4364 */
821#define SAFI_MPLS_LABELED_VPN 128
718e3744 822
823/* Max TTL value. */
824#define TTL_MAX 255
825
826/* BGP uptime string length. */
827#define BGP_UPTIME_LEN 25
828
829/* Default configuration settings for bgpd. */
830#define BGP_VTY_PORT 2605
718e3744 831#define BGP_DEFAULT_CONFIG "bgpd.conf"
832
833/* Check AS path loop when we send NLRI. */
834/* #define BGP_SEND_ASPATH_CHECK */
835
718e3744 836/* Flag for peer_clear_soft(). */
837enum bgp_clear_type
838{
839 BGP_CLEAR_SOFT_NONE,
840 BGP_CLEAR_SOFT_OUT,
841 BGP_CLEAR_SOFT_IN,
842 BGP_CLEAR_SOFT_BOTH,
fee0f4c6 843 BGP_CLEAR_SOFT_IN_ORF_PREFIX,
844 BGP_CLEAR_SOFT_RSCLIENT
718e3744 845};
846
847/* Macros. */
848#define BGP_INPUT(P) ((P)->ibuf)
849#define BGP_INPUT_PNT(P) (STREAM_PNT(BGP_INPUT(P)))
6aa136f1
VS
850#define BGP_IS_VALID_STATE_FOR_NOTIF(S)\
851 (((S) == OpenSent) || ((S) == OpenConfirm) || ((S) == Established))
718e3744 852
718e3744 853/* Count prefix size from mask length */
854#define PSIZE(a) (((a) + 7) / (8))
855
856/* BGP error codes. */
857#define BGP_SUCCESS 0
858#define BGP_ERR_INVALID_VALUE -1
859#define BGP_ERR_INVALID_FLAG -2
860#define BGP_ERR_INVALID_AS -3
861#define BGP_ERR_INVALID_BGP -4
862#define BGP_ERR_PEER_GROUP_MEMBER -5
863#define BGP_ERR_MULTIPLE_INSTANCE_USED -6
864#define BGP_ERR_PEER_GROUP_MEMBER_EXISTS -7
865#define BGP_ERR_PEER_BELONGS_TO_GROUP -8
866#define BGP_ERR_PEER_GROUP_AF_UNCONFIGURED -9
867#define BGP_ERR_PEER_GROUP_NO_REMOTE_AS -10
868#define BGP_ERR_PEER_GROUP_CANT_CHANGE -11
869#define BGP_ERR_PEER_GROUP_MISMATCH -12
870#define BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT -13
871#define BGP_ERR_MULTIPLE_INSTANCE_NOT_SET -14
872#define BGP_ERR_AS_MISMATCH -15
873#define BGP_ERR_PEER_INACTIVE -16
874#define BGP_ERR_INVALID_FOR_PEER_GROUP_MEMBER -17
875#define BGP_ERR_PEER_GROUP_HAS_THE_FLAG -18
876#define BGP_ERR_PEER_FLAG_CONFLICT -19
877#define BGP_ERR_PEER_GROUP_SHUTDOWN -20
878#define BGP_ERR_PEER_FILTER_CONFLICT -21
879#define BGP_ERR_NOT_INTERNAL_PEER -22
880#define BGP_ERR_REMOVE_PRIVATE_AS -23
881#define BGP_ERR_AF_UNCONFIGURED -24
882#define BGP_ERR_SOFT_RECONFIG_UNCONFIGURED -25
883#define BGP_ERR_INSTANCE_MISMATCH -26
884#define BGP_ERR_LOCAL_AS_ALLOWED_ONLY_FOR_EBGP -27
885#define BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS -28
0df7c91f 886#define BGP_ERR_TCPSIG_FAILED -29
fa411a21 887#define BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK -30
f5a4827d 888#define BGP_ERR_NO_IBGP_WITH_TTLHACK -31
a80beece 889#define BGP_ERR_NO_INTERFACE_CONFIG -32
9d3f9705 890#define BGP_ERR_CANNOT_HAVE_LOCAL_AS_SAME_AS_REMOTE_AS -33
a80beece 891#define BGP_ERR_MAX -34
718e3744 892
893extern struct bgp_master *bm;
894
895extern struct thread_master *master;
896
897/* Prototypes. */
94f2b392 898extern void bgp_terminate (void);
899extern void bgp_reset (void);
65957886 900extern time_t bgp_clock (void);
94f2b392 901extern void bgp_zclient_reset (void);
902extern int bgp_nexthop_set (union sockunion *, union sockunion *,
718e3744 903 struct bgp_nexthop *, struct peer *);
94f2b392 904extern struct bgp *bgp_get_default (void);
905extern struct bgp *bgp_lookup (as_t, const char *);
906extern struct bgp *bgp_lookup_by_name (const char *);
907extern struct peer *peer_lookup (struct bgp *, union sockunion *);
a80beece
DS
908extern struct peer *peer_lookup_by_conf_if (struct bgp *, const char *);
909extern struct peer *peer_conf_interface_get(struct bgp *, const char *, afi_t,
910 safi_t);
911extern void bgp_peer_conf_if_to_su_update (struct peer *);
94f2b392 912extern struct peer_group *peer_group_lookup (struct bgp *, const char *);
913extern struct peer_group *peer_group_get (struct bgp *, const char *);
200df115 914extern struct peer *peer_lock (struct peer *);
915extern struct peer *peer_unlock (struct peer *);
6d85b15b 916extern bgp_peer_sort_t peer_sort (struct peer *peer);
94f2b392 917extern int peer_active (struct peer *);
918extern int peer_active_nego (struct peer *);
a80beece
DS
919extern struct peer *peer_create(union sockunion *, const char *, struct bgp *,
920 as_t, as_t, afi_t, safi_t);
94f2b392 921extern struct peer *peer_create_accept (struct bgp *);
1ff9a340 922extern void peer_xfer_config (struct peer *dst, struct peer *src);
94f2b392 923extern char *peer_uptime (time_t, char *, size_t);
924extern int bgp_config_write (struct vty *);
925extern void bgp_config_write_family_header (struct vty *, afi_t, safi_t, int *);
6b0655a2 926
94f2b392 927extern void bgp_master_init (void);
718e3744 928
94f2b392 929extern void bgp_init (void);
930extern void bgp_route_map_init (void);
718e3744 931
94f2b392 932extern int bgp_option_set (int);
933extern int bgp_option_unset (int);
934extern int bgp_option_check (int);
718e3744 935
94f2b392 936extern int bgp_get (struct bgp **, as_t *, const char *);
937extern int bgp_delete (struct bgp *);
718e3744 938
94f2b392 939extern int bgp_flag_set (struct bgp *, int);
940extern int bgp_flag_unset (struct bgp *, int);
941extern int bgp_flag_check (struct bgp *, int);
718e3744 942
0088b5dc
SH
943extern void bgp_lock (struct bgp *);
944extern void bgp_unlock (struct bgp *);
945
94f2b392 946extern int bgp_router_id_set (struct bgp *, struct in_addr *);
718e3744 947
94f2b392 948extern int bgp_cluster_id_set (struct bgp *, struct in_addr *);
949extern int bgp_cluster_id_unset (struct bgp *);
718e3744 950
94f2b392 951extern int bgp_confederation_id_set (struct bgp *, as_t);
952extern int bgp_confederation_id_unset (struct bgp *);
953extern int bgp_confederation_peers_check (struct bgp *, as_t);
718e3744 954
94f2b392 955extern int bgp_confederation_peers_add (struct bgp *, as_t);
956extern int bgp_confederation_peers_remove (struct bgp *, as_t);
718e3744 957
94f2b392 958extern int bgp_timers_set (struct bgp *, u_int32_t, u_int32_t);
959extern int bgp_timers_unset (struct bgp *);
718e3744 960
94f2b392 961extern int bgp_default_local_preference_set (struct bgp *, u_int32_t);
962extern int bgp_default_local_preference_unset (struct bgp *);
718e3744 963
f188f2c4
DS
964extern int bgp_update_delay_active (struct bgp *);
965extern int bgp_update_delay_configured (struct bgp *);
94f2b392 966extern int peer_rsclient_active (struct peer *);
a80beece
DS
967extern void peer_as_change (struct peer *, as_t);
968extern int peer_remote_as (struct bgp *, union sockunion *,const char *, as_t *,
969 afi_t, safi_t);
94f2b392 970extern int peer_group_remote_as (struct bgp *, const char *, as_t *);
971extern int peer_delete (struct peer *peer);
972extern int peer_group_delete (struct peer_group *);
973extern int peer_group_remote_as_delete (struct peer_group *);
718e3744 974
94f2b392 975extern int peer_activate (struct peer *, afi_t, safi_t);
976extern int peer_deactivate (struct peer *, afi_t, safi_t);
718e3744 977
a80beece
DS
978extern int peer_group_bind (struct bgp *, union sockunion *, struct peer *,
979 struct peer_group *, afi_t, safi_t, as_t *);
94f2b392 980extern int peer_group_unbind (struct bgp *, struct peer *, struct peer_group *,
718e3744 981 afi_t, safi_t);
982
94f2b392 983extern int peer_flag_set (struct peer *, u_int32_t);
984extern int peer_flag_unset (struct peer *, u_int32_t);
718e3744 985
94f2b392 986extern int peer_af_flag_set (struct peer *, afi_t, safi_t, u_int32_t);
987extern int peer_af_flag_unset (struct peer *, afi_t, safi_t, u_int32_t);
988extern int peer_af_flag_check (struct peer *, afi_t, safi_t, u_int32_t);
718e3744 989
94f2b392 990extern int peer_ebgp_multihop_set (struct peer *, int);
991extern int peer_ebgp_multihop_unset (struct peer *);
718e3744 992
94f2b392 993extern int peer_description_set (struct peer *, char *);
994extern int peer_description_unset (struct peer *);
718e3744 995
94f2b392 996extern int peer_update_source_if_set (struct peer *, const char *);
997extern int peer_update_source_addr_set (struct peer *, union sockunion *);
998extern int peer_update_source_unset (struct peer *);
718e3744 999
94f2b392 1000extern int peer_default_originate_set (struct peer *, afi_t, safi_t, const char *);
1001extern int peer_default_originate_unset (struct peer *, afi_t, safi_t);
718e3744 1002
94f2b392 1003extern int peer_port_set (struct peer *, u_int16_t);
1004extern int peer_port_unset (struct peer *);
718e3744 1005
94f2b392 1006extern int peer_weight_set (struct peer *, u_int16_t);
1007extern int peer_weight_unset (struct peer *);
718e3744 1008
94f2b392 1009extern int peer_timers_set (struct peer *, u_int32_t, u_int32_t);
1010extern int peer_timers_unset (struct peer *);
718e3744 1011
94f2b392 1012extern int peer_timers_connect_set (struct peer *, u_int32_t);
1013extern int peer_timers_connect_unset (struct peer *);
718e3744 1014
94f2b392 1015extern int peer_advertise_interval_set (struct peer *, u_int32_t);
1016extern int peer_advertise_interval_unset (struct peer *);
718e3744 1017
94f2b392 1018extern int peer_interface_set (struct peer *, const char *);
1019extern int peer_interface_unset (struct peer *);
718e3744 1020
94f2b392 1021extern int peer_distribute_set (struct peer *, afi_t, safi_t, int, const char *);
1022extern int peer_distribute_unset (struct peer *, afi_t, safi_t, int);
718e3744 1023
94f2b392 1024extern int peer_allowas_in_set (struct peer *, afi_t, safi_t, int);
1025extern int peer_allowas_in_unset (struct peer *, afi_t, safi_t);
718e3744 1026
9d3f9705 1027extern int peer_local_as_set (struct peer *, as_t, int, int);
94f2b392 1028extern int peer_local_as_unset (struct peer *);
718e3744 1029
94f2b392 1030extern int peer_prefix_list_set (struct peer *, afi_t, safi_t, int, const char *);
1031extern int peer_prefix_list_unset (struct peer *, afi_t, safi_t, int);
718e3744 1032
94f2b392 1033extern int peer_aslist_set (struct peer *, afi_t, safi_t, int, const char *);
1034extern int peer_aslist_unset (struct peer *,afi_t, safi_t, int);
718e3744 1035
94f2b392 1036extern int peer_route_map_set (struct peer *, afi_t, safi_t, int, const char *);
1037extern int peer_route_map_unset (struct peer *, afi_t, safi_t, int);
718e3744 1038
94f2b392 1039extern int peer_unsuppress_map_set (struct peer *, afi_t, safi_t, const char *);
0df7c91f
PJ
1040
1041extern int peer_password_set (struct peer *, const char *);
1042extern int peer_password_unset (struct peer *);
1043
94f2b392 1044extern int peer_unsuppress_map_unset (struct peer *, afi_t, safi_t);
718e3744 1045
94f2b392 1046extern int peer_maximum_prefix_set (struct peer *, afi_t, safi_t, u_int32_t, u_char, int, u_int16_t);
1047extern int peer_maximum_prefix_unset (struct peer *, afi_t, safi_t);
718e3744 1048
1ff9a340 1049extern int peer_clear (struct peer *, struct listnode **);
94f2b392 1050extern int peer_clear_soft (struct peer *, afi_t, safi_t, enum bgp_clear_type);
93406d87 1051
fa411a21
NH
1052extern int peer_ttl_security_hops_set (struct peer *, int);
1053extern int peer_ttl_security_hops_unset (struct peer *);
1054
00d252cb 1055#endif /* _QUAGGA_BGPD_H */