paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* BGP packet management header. |
| 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 |
| 17 | along with GNU Zebra; see the file COPYING. If not, write to the Free |
| 18 | Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 19 | 02111-1307, USA. */ |
| 20 | |
paul | 00d252c | 2005-05-23 14:19:54 +0000 | [diff] [blame] | 21 | #ifndef _QUAGGA_BGP_PACKET_H |
| 22 | #define _QUAGGA_BGP_PACKET_H |
| 23 | |
paul | fd79ac9 | 2004-10-13 05:06:08 +0000 | [diff] [blame] | 24 | #define BGP_NLRI_LENGTH 1U |
| 25 | #define BGP_TOTAL_ATTR_LEN 2U |
| 26 | #define BGP_UNFEASIBLE_LEN 2U |
| 27 | #define BGP_WRITE_PACKET_MAX 10U |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 28 | |
| 29 | /* When to refresh */ |
| 30 | #define REFRESH_IMMEDIATE 1 |
| 31 | #define REFRESH_DEFER 2 |
| 32 | |
| 33 | /* ORF Common part flag */ |
| 34 | #define ORF_COMMON_PART_ADD 0x00 |
| 35 | #define ORF_COMMON_PART_REMOVE 0x80 |
| 36 | #define ORF_COMMON_PART_REMOVE_ALL 0xC0 |
| 37 | #define ORF_COMMON_PART_PERMIT 0x00 |
| 38 | #define ORF_COMMON_PART_DENY 0x20 |
| 39 | |
| 40 | /* Packet send and receive function prototypes. */ |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 41 | extern int bgp_read (struct thread *); |
| 42 | extern int bgp_write (struct thread *); |
Dinesh Dutt | d9ab53a | 2015-05-19 17:47:21 -0700 | [diff] [blame] | 43 | extern int bgp_connect_check (struct peer *, int change_state); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 44 | |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 45 | extern void bgp_keepalive_send (struct peer *); |
| 46 | extern void bgp_open_send (struct peer *); |
| 47 | extern void bgp_notify_send (struct peer *, u_int8_t, u_int8_t); |
| 48 | extern void bgp_notify_send_with_data (struct peer *, u_int8_t, u_int8_t, |
paul | 5228ad2 | 2004-06-04 17:58:18 +0000 | [diff] [blame] | 49 | u_int8_t *, size_t); |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 50 | extern void bgp_route_refresh_send (struct peer *, afi_t, safi_t, u_char, u_char, int); |
| 51 | extern void bgp_capability_send (struct peer *, afi_t, safi_t, int, int); |
| 52 | extern void bgp_default_update_send (struct peer *, struct attr *, |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 53 | afi_t, safi_t, struct peer *); |
paul | 94f2b39 | 2005-06-28 12:44:16 +0000 | [diff] [blame] | 54 | extern void bgp_default_withdraw_send (struct peer *, afi_t, safi_t); |
paul | 00d252c | 2005-05-23 14:19:54 +0000 | [diff] [blame] | 55 | |
Stephen Hemminger | da88ea8 | 2009-12-17 13:14:28 +0300 | [diff] [blame] | 56 | extern int bgp_capability_receive (struct peer *, bgp_size_t); |
| 57 | |
Paul Jakma | 518a4b7 | 2016-02-04 13:27:04 +0000 | [diff] [blame] | 58 | extern int bgp_nlri_parse (struct peer *, struct attr *, struct bgp_nlri *); |
| 59 | |
paul | 00d252c | 2005-05-23 14:19:54 +0000 | [diff] [blame] | 60 | #endif /* _QUAGGA_BGP_PACKET_H */ |