]> git.proxmox.com Git - mirror_frr.git/blob - bgpd/bgp_debug.h
14a8c5fe6c9702cdf1ff59b00896565a2ebab50c
[mirror_frr.git] / bgpd / bgp_debug.h
1 /* BGP message debug header.
2 Copyright (C) 1996, 97, 98 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
21 /* sort of packet direction */
22 #define DUMP_ON 1
23 #define DUMP_SEND 2
24 #define DUMP_RECV 4
25
26 /* for dump_update */
27 #define DUMP_WITHDRAW 8
28 #define DUMP_NLRI 16
29
30 /* dump detail */
31 #define DUMP_DETAIL 32
32
33 extern int dump_open;
34 extern int dump_update;
35 extern int dump_keepalive;
36 extern int dump_notify;
37
38 extern int Debug_Event;
39 extern int Debug_Keepalive;
40 extern int Debug_Update;
41 extern int Debug_Radix;
42
43 #define NLRI 1
44 #define WITHDRAW 2
45 #define NO_OPT 3
46 #define SEND 4
47 #define RECV 5
48 #define DETAIL 6
49
50 /* Prototypes. */
51 void bgp_debug_init ();
52 void bgp_packet_dump (struct stream *);
53
54 int debug (unsigned int option);
55
56 extern unsigned long conf_bgp_debug_fsm;
57 extern unsigned long conf_bgp_debug_events;
58 extern unsigned long conf_bgp_debug_packet;
59 extern unsigned long conf_bgp_debug_filter;
60 extern unsigned long conf_bgp_debug_keepalive;
61 extern unsigned long conf_bgp_debug_update;
62 extern unsigned long conf_bgp_debug_normal;
63
64 extern unsigned long term_bgp_debug_fsm;
65 extern unsigned long term_bgp_debug_events;
66 extern unsigned long term_bgp_debug_packet;
67 extern unsigned long term_bgp_debug_filter;
68 extern unsigned long term_bgp_debug_keepalive;
69 extern unsigned long term_bgp_debug_update;
70 extern unsigned long term_bgp_debug_normal;
71
72 #define BGP_DEBUG_FSM 0x01
73 #define BGP_DEBUG_EVENTS 0x01
74 #define BGP_DEBUG_PACKET 0x01
75 #define BGP_DEBUG_FILTER 0x01
76 #define BGP_DEBUG_KEEPALIVE 0x01
77 #define BGP_DEBUG_UPDATE_IN 0x01
78 #define BGP_DEBUG_UPDATE_OUT 0x02
79 #define BGP_DEBUG_NORMAL 0x01
80
81 #define BGP_DEBUG_PACKET_SEND 0x01
82 #define BGP_DEBUG_PACKET_SEND_DETAIL 0x02
83
84 #define BGP_DEBUG_PACKET_RECV 0x01
85 #define BGP_DEBUG_PACKET_RECV_DETAIL 0x02
86
87 #define CONF_DEBUG_ON(a, b) (conf_bgp_debug_ ## a |= (BGP_DEBUG_ ## b))
88 #define CONF_DEBUG_OFF(a, b) (conf_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b))
89
90 #define TERM_DEBUG_ON(a, b) (term_bgp_debug_ ## a |= (BGP_DEBUG_ ## b))
91 #define TERM_DEBUG_OFF(a, b) (term_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b))
92
93 #define DEBUG_ON(a, b) \
94 do { \
95 CONF_DEBUG_ON(a, b); \
96 TERM_DEBUG_ON(a, b); \
97 } while (0)
98 #define DEBUG_OFF(a, b) \
99 do { \
100 CONF_DEBUG_OFF(a, b); \
101 TERM_DEBUG_OFF(a, b); \
102 } while (0)
103
104 #define BGP_DEBUG(a, b) (term_bgp_debug_ ## a & BGP_DEBUG_ ## b)
105 #define CONF_BGP_DEBUG(a, b) (conf_bgp_debug_ ## a & BGP_DEBUG_ ## b)
106
107 extern char *bgp_type_str[];
108
109 int bgp_dump_attr (struct peer *, struct attr *, char *, size_t);
110 void bgp_notify_print (struct peer *, struct bgp_notify *, char *);
111
112 extern struct message bgp_status_msg[];
113 extern int bgp_status_msg_max;