]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_packet.h
Merge pull request #3394 from karamalla0406/frr3360
[mirror_frr.git] / bgpd / bgp_packet.h
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 along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef _QUAGGA_BGP_PACKET_H
22 #define _QUAGGA_BGP_PACKET_H
23
24 #define BGP_NLRI_LENGTH 1U
25 #define BGP_TOTAL_ATTR_LEN 2U
26 #define BGP_UNFEASIBLE_LEN 2U
27
28 /* When to refresh */
29 #define REFRESH_IMMEDIATE 1
30 #define REFRESH_DEFER 2
31
32 /* ORF Common part flag */
33 #define ORF_COMMON_PART_ADD 0x00
34 #define ORF_COMMON_PART_REMOVE 0x80
35 #define ORF_COMMON_PART_REMOVE_ALL 0xC0
36 #define ORF_COMMON_PART_PERMIT 0x00
37 #define ORF_COMMON_PART_DENY 0x20
38
39 /* Packet send and receive function prototypes. */
40 extern void bgp_keepalive_send(struct peer *);
41 extern void bgp_open_send(struct peer *);
42 extern void bgp_notify_send(struct peer *, uint8_t, uint8_t);
43 extern void bgp_notify_send_with_data(struct peer *, uint8_t, uint8_t,
44 uint8_t *, size_t);
45 extern void bgp_route_refresh_send(struct peer *, afi_t, safi_t, uint8_t,
46 uint8_t, int);
47 extern void bgp_capability_send(struct peer *, afi_t, safi_t, int, int);
48 extern void bgp_default_update_send(struct peer *, struct attr *, afi_t, safi_t,
49 struct peer *);
50 extern void bgp_default_withdraw_send(struct peer *, afi_t, safi_t);
51
52 extern int bgp_capability_receive(struct peer *, bgp_size_t);
53
54 extern int bgp_nlri_parse(struct peer *, struct attr *, struct bgp_nlri *,
55 int mp_withdraw);
56
57 extern void bgp_update_restarted_peers(struct peer *);
58 extern void bgp_update_implicit_eors(struct peer *);
59 extern void bgp_check_update_delay(struct bgp *);
60
61 extern int bgp_packet_set_marker(struct stream *s, uint8_t type);
62 extern int bgp_packet_set_size(struct stream *s);
63
64 extern int bgp_generate_updgrp_packets(struct thread *);
65 extern int bgp_process_packet(struct thread *);
66
67 #endif /* _QUAGGA_BGP_PACKET_H */