paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* BGP open message handling |
| 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_OPEN_H |
| 22 | #define _QUAGGA_BGP_OPEN_H |
| 23 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 24 | /* MP Capability information. */ |
| 25 | struct capability_mp |
| 26 | { |
| 27 | u_int16_t afi; |
| 28 | u_char reserved; |
| 29 | u_char safi; |
| 30 | }; |
| 31 | |
| 32 | /* BGP open message capability. */ |
| 33 | struct capability |
| 34 | { |
| 35 | u_char code; |
| 36 | u_char length; |
| 37 | struct capability_mp mpc; |
| 38 | }; |
| 39 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 40 | struct graceful_restart_af |
| 41 | { |
| 42 | u_int16_t afi; |
| 43 | u_char safi; |
| 44 | u_char flag; |
| 45 | }; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 47 | /* Capability Code */ |
| 48 | #define CAPABILITY_CODE_MP 1 /* Multiprotocol Extensions */ |
| 49 | #define CAPABILITY_CODE_REFRESH 2 /* Route Refresh Capability */ |
| 50 | #define CAPABILITY_CODE_ORF 3 /* Cooperative Route Filtering Capability */ |
| 51 | #define CAPABILITY_CODE_RESTART 64 /* Graceful Restart Capability */ |
| 52 | #define CAPABILITY_CODE_4BYTE_AS 65 /* 4-octet AS number Capability */ |
| 53 | #define CAPABILITY_CODE_DYNAMIC 66 /* Dynamic Capability */ |
| 54 | #define CAPABILITY_CODE_REFRESH_OLD 128 /* Route Refresh Capability(cisco) */ |
| 55 | #define CAPABILITY_CODE_ORF_OLD 130 /* Cooperative Route Filtering Capability(cisco) */ |
| 56 | |
| 57 | /* Capability Length */ |
| 58 | #define CAPABILITY_CODE_MP_LEN 4 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 59 | #define CAPABILITY_CODE_REFRESH_LEN 0 |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 60 | #define CAPABILITY_CODE_DYNAMIC_LEN 0 |
| 61 | #define CAPABILITY_CODE_RESTART_LEN 2 /* Receiving only case */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 62 | |
| 63 | /* Cooperative Route Filtering Capability. */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 64 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 65 | /* ORF Type */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 66 | #define ORF_TYPE_PREFIX 64 |
| 67 | #define ORF_TYPE_PREFIX_OLD 128 |
| 68 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 69 | /* ORF Mode */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 70 | #define ORF_MODE_RECEIVE 1 |
| 71 | #define ORF_MODE_SEND 2 |
| 72 | #define ORF_MODE_BOTH 3 |
| 73 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 74 | /* Capability Message Action. */ |
| 75 | #define CAPABILITY_ACTION_SET 0 |
| 76 | #define CAPABILITY_ACTION_UNSET 1 |
| 77 | |
hasso | 538621f | 2004-05-21 09:31:30 +0000 | [diff] [blame] | 78 | /* Graceful Restart */ |
| 79 | #define RESTART_R_BIT 0x8000 |
| 80 | #define RESTART_F_BIT 0x80 |
| 81 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 82 | int bgp_open_option_parse (struct peer *, u_char, int *); |
| 83 | void bgp_open_capability (struct stream *, struct peer *); |
| 84 | void bgp_capability_vty_out (struct vty *, struct peer *); |
paul | 00d252c | 2005-05-23 14:19:54 +0000 | [diff] [blame] | 85 | |
| 86 | #endif /* _QUAGGA_BGP_OPEN_H */ |