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