]> git.proxmox.com Git - mirror_frr.git/blame - bgpd/bgp_debug.h
quagga netlink buffer size increase
[mirror_frr.git] / bgpd / bgp_debug.h
CommitLineData
718e3744 1/* BGP message debug header.
2 Copyright (C) 1996, 97, 98 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_BGP_DEBUG_H
22#define _QUAGGA_BGP_DEBUG_H
23
0b2aa3a0 24#include "bgp_attr.h"
3f9c7369 25#include "bgp_updgrp.h"
0b2aa3a0 26
718e3744 27/* sort of packet direction */
28#define DUMP_ON 1
29#define DUMP_SEND 2
30#define DUMP_RECV 4
31
32/* for dump_update */
33#define DUMP_WITHDRAW 8
34#define DUMP_NLRI 16
35
36/* dump detail */
37#define DUMP_DETAIL 32
38
39extern int dump_open;
40extern int dump_update;
41extern int dump_keepalive;
42extern int dump_notify;
43
44extern int Debug_Event;
45extern int Debug_Keepalive;
46extern int Debug_Update;
47extern int Debug_Radix;
48
49#define NLRI 1
50#define WITHDRAW 2
51#define NO_OPT 3
52#define SEND 4
53#define RECV 5
54#define DETAIL 6
55
56/* Prototypes. */
94f2b392 57extern void bgp_debug_init (void);
58extern void bgp_packet_dump (struct stream *);
718e3744 59
94f2b392 60extern int debug (unsigned int option);
718e3744 61
0b2aa3a0 62extern unsigned long conf_bgp_debug_as4;
16286195 63extern unsigned long conf_bgp_debug_neighbor_events;
718e3744 64extern unsigned long conf_bgp_debug_packet;
718e3744 65extern unsigned long conf_bgp_debug_keepalive;
66extern unsigned long conf_bgp_debug_update;
9fbdd100 67extern unsigned long conf_bgp_debug_bestpath;
a39275d7 68extern unsigned long conf_bgp_debug_zebra;
fb018d25 69extern unsigned long conf_bgp_debug_nht;
3f9c7369 70extern unsigned long conf_bgp_debug_update_groups;
718e3744 71
0b2aa3a0 72extern unsigned long term_bgp_debug_as4;
16286195 73extern unsigned long term_bgp_debug_neighbor_events;
718e3744 74extern unsigned long term_bgp_debug_packet;
718e3744 75extern unsigned long term_bgp_debug_keepalive;
76extern unsigned long term_bgp_debug_update;
9fbdd100 77extern unsigned long term_bgp_debug_bestpath;
a39275d7 78extern unsigned long term_bgp_debug_zebra;
fb018d25 79extern unsigned long term_bgp_debug_nht;
3f9c7369 80extern unsigned long term_bgp_debug_update_groups;
718e3744 81
16286195
DS
82extern struct list *bgp_debug_neighbor_events_peers;
83extern struct list *bgp_debug_keepalive_peers;
84extern struct list *bgp_debug_update_in_peers;
85extern struct list *bgp_debug_update_out_peers;
86extern struct list *bgp_debug_update_prefixes;
9fbdd100 87extern struct list *bgp_debug_bestpath_prefixes;
16286195
DS
88extern struct list *bgp_debug_zebra_prefixes;
89
90struct bgp_debug_filter
91{
167d390a 92 char *host;
16286195
DS
93 struct prefix *p;
94};
95
0b2aa3a0
PJ
96#define BGP_DEBUG_AS4 0x01
97#define BGP_DEBUG_AS4_SEGMENT 0x02
98
9fbdd100 99#define BGP_DEBUG_BESTPATH 0x01
16286195 100#define BGP_DEBUG_NEIGHBOR_EVENTS 0x01
718e3744 101#define BGP_DEBUG_PACKET 0x01
718e3744 102#define BGP_DEBUG_KEEPALIVE 0x01
103#define BGP_DEBUG_UPDATE_IN 0x01
104#define BGP_DEBUG_UPDATE_OUT 0x02
16286195 105#define BGP_DEBUG_UPDATE_PREFIX 0x04
a39275d7 106#define BGP_DEBUG_ZEBRA 0x01
fb018d25 107#define BGP_DEBUG_NHT 0x01
3f9c7369 108#define BGP_DEBUG_UPDATE_GROUPS 0x01
718e3744 109
110#define BGP_DEBUG_PACKET_SEND 0x01
111#define BGP_DEBUG_PACKET_SEND_DETAIL 0x02
112
718e3744 113#define CONF_DEBUG_ON(a, b) (conf_bgp_debug_ ## a |= (BGP_DEBUG_ ## b))
114#define CONF_DEBUG_OFF(a, b) (conf_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b))
115
116#define TERM_DEBUG_ON(a, b) (term_bgp_debug_ ## a |= (BGP_DEBUG_ ## b))
117#define TERM_DEBUG_OFF(a, b) (term_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b))
118
119#define DEBUG_ON(a, b) \
120 do { \
121 CONF_DEBUG_ON(a, b); \
122 TERM_DEBUG_ON(a, b); \
123 } while (0)
124#define DEBUG_OFF(a, b) \
125 do { \
126 CONF_DEBUG_OFF(a, b); \
127 TERM_DEBUG_OFF(a, b); \
128 } while (0)
129
130#define BGP_DEBUG(a, b) (term_bgp_debug_ ## a & BGP_DEBUG_ ## b)
131#define CONF_BGP_DEBUG(a, b) (conf_bgp_debug_ ## a & BGP_DEBUG_ ## b)
132
6d58272b 133extern const char *bgp_type_str[];
718e3744 134
94f2b392 135extern int bgp_dump_attr (struct peer *, struct attr *, char *, size_t);
167d390a 136extern int bgp_debug_peer_updout_enabled(char *host);
94f2b392 137extern void bgp_notify_print (struct peer *, struct bgp_notify *, const char *);
718e3744 138
b2d933f8
SH
139extern const struct message bgp_status_msg[];
140extern const int bgp_status_msg_max;
16286195
DS
141extern int bgp_debug_neighbor_events(struct peer *peer);
142extern int bgp_debug_keepalive(struct peer *peer);
3f9c7369
DS
143extern int bgp_debug_update(struct peer *peer, struct prefix *p,
144 struct update_group *updgrp, unsigned int inbound);
9fbdd100 145extern int bgp_debug_bestpath(struct prefix *p);
16286195 146extern int bgp_debug_zebra(struct prefix *p);
00d252cb 147
148#endif /* _QUAGGA_BGP_DEBUG_H */