]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_packet.h
Merge pull request #5686 from qlyoung/fix-bgp-fqdn-capability-leak
[mirror_frr.git] / bgpd / bgp_packet.h
CommitLineData
718e3744 1/* BGP packet management header.
896014f4
DL
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 */
718e3744 20
00d252cb 21#ifndef _QUAGGA_BGP_PACKET_H
22#define _QUAGGA_BGP_PACKET_H
23
584470fb
DL
24#include "hook.h"
25
26DECLARE_HOOK(bgp_packet_dump,
27 (struct peer *peer, uint8_t type, bgp_size_t size,
28 struct stream *s),
29 (peer, type, size, s))
30
6fd04594
DL
31DECLARE_HOOK(bgp_packet_send,
32 (struct peer *peer, uint8_t type, bgp_size_t size,
33 struct stream *s),
34 (peer, type, size, s))
35
fd79ac91 36#define BGP_NLRI_LENGTH 1U
37#define BGP_TOTAL_ATTR_LEN 2U
38#define BGP_UNFEASIBLE_LEN 2U
718e3744 39
40/* When to refresh */
41#define REFRESH_IMMEDIATE 1
9ea364a2 42#define REFRESH_DEFER 2
718e3744 43
44/* ORF Common part flag */
9ea364a2
DA
45#define ORF_COMMON_PART_ADD 0x00
46#define ORF_COMMON_PART_REMOVE 0x80
47#define ORF_COMMON_PART_REMOVE_ALL 0xC0
48#define ORF_COMMON_PART_PERMIT 0x00
49#define ORF_COMMON_PART_DENY 0x20
718e3744 50
51/* Packet send and receive function prototypes. */
d62a17ae 52extern void bgp_keepalive_send(struct peer *);
53extern void bgp_open_send(struct peer *);
d7c0a89a
QY
54extern void bgp_notify_send(struct peer *, uint8_t, uint8_t);
55extern void bgp_notify_send_with_data(struct peer *, uint8_t, uint8_t,
56 uint8_t *, size_t);
57extern void bgp_route_refresh_send(struct peer *, afi_t, safi_t, uint8_t,
58 uint8_t, int);
d62a17ae 59extern void bgp_capability_send(struct peer *, afi_t, safi_t, int, int);
00d252cb 60
d62a17ae 61extern int bgp_capability_receive(struct peer *, bgp_size_t);
96e52474 62
d62a17ae 63extern int bgp_nlri_parse(struct peer *, struct attr *, struct bgp_nlri *,
64 int mp_withdraw);
96e52474 65
d62a17ae 66extern void bgp_update_restarted_peers(struct peer *);
67extern void bgp_update_implicit_eors(struct peer *);
68extern void bgp_check_update_delay(struct bgp *);
3f9c7369 69
d7c0a89a 70extern int bgp_packet_set_marker(struct stream *s, uint8_t type);
d62a17ae 71extern int bgp_packet_set_size(struct stream *s);
d3ecc69e 72
56257a44 73extern int bgp_generate_updgrp_packets(struct thread *);
424ab01d 74extern int bgp_process_packet(struct thread *);
3f9c7369 75
00d252cb 76#endif /* _QUAGGA_BGP_PACKET_H */