1 /* BGP message debug header.
2 Copyright (C) 1996, 97, 98 Kunihiro Ishiguro
4 This file is part of GNU Zebra.
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
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.
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
21 #ifndef _QUAGGA_BGP_DEBUG_H
22 #define _QUAGGA_BGP_DEBUG_H
26 /* sort of packet direction */
32 #define DUMP_WITHDRAW 8
36 #define DUMP_DETAIL 32
39 extern int dump_update;
40 extern int dump_keepalive;
41 extern int dump_notify;
43 extern int Debug_Event;
44 extern int Debug_Keepalive;
45 extern int Debug_Update;
46 extern int Debug_Radix;
56 extern void bgp_debug_init (void);
57 extern void bgp_packet_dump (struct stream *);
59 extern int debug (unsigned int option);
61 extern unsigned long conf_bgp_debug_as4;
62 extern unsigned long conf_bgp_debug_fsm;
63 extern unsigned long conf_bgp_debug_events;
64 extern unsigned long conf_bgp_debug_packet;
65 extern unsigned long conf_bgp_debug_filter;
66 extern unsigned long conf_bgp_debug_keepalive;
67 extern unsigned long conf_bgp_debug_update;
68 extern unsigned long conf_bgp_debug_normal;
69 extern unsigned long conf_bgp_debug_zebra;
70 extern unsigned long conf_bgp_debug_allow_martians;
71 extern unsigned long conf_bgp_debug_nht;
73 extern unsigned long term_bgp_debug_as4;
74 extern unsigned long term_bgp_debug_fsm;
75 extern unsigned long term_bgp_debug_events;
76 extern unsigned long term_bgp_debug_packet;
77 extern unsigned long term_bgp_debug_filter;
78 extern unsigned long term_bgp_debug_keepalive;
79 extern unsigned long term_bgp_debug_update;
80 extern unsigned long term_bgp_debug_normal;
81 extern unsigned long term_bgp_debug_zebra;
82 extern unsigned long term_bgp_debug_allow_martians;
83 extern unsigned long term_bgp_debug_nht;
85 #define BGP_DEBUG_AS4 0x01
86 #define BGP_DEBUG_AS4_SEGMENT 0x02
88 #define BGP_DEBUG_FSM 0x01
89 #define BGP_DEBUG_EVENTS 0x01
90 #define BGP_DEBUG_PACKET 0x01
91 #define BGP_DEBUG_FILTER 0x01
92 #define BGP_DEBUG_KEEPALIVE 0x01
93 #define BGP_DEBUG_UPDATE_IN 0x01
94 #define BGP_DEBUG_UPDATE_OUT 0x02
95 #define BGP_DEBUG_NORMAL 0x01
96 #define BGP_DEBUG_ZEBRA 0x01
97 #define BGP_DEBUG_ALLOW_MARTIANS 0x01
98 #define BGP_DEBUG_NHT 0x01
100 #define BGP_DEBUG_PACKET_SEND 0x01
101 #define BGP_DEBUG_PACKET_SEND_DETAIL 0x02
103 #define BGP_DEBUG_PACKET_RECV 0x01
104 #define BGP_DEBUG_PACKET_RECV_DETAIL 0x02
106 #define CONF_DEBUG_ON(a, b) (conf_bgp_debug_ ## a |= (BGP_DEBUG_ ## b))
107 #define CONF_DEBUG_OFF(a, b) (conf_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b))
109 #define TERM_DEBUG_ON(a, b) (term_bgp_debug_ ## a |= (BGP_DEBUG_ ## b))
110 #define TERM_DEBUG_OFF(a, b) (term_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b))
112 #define DEBUG_ON(a, b) \
114 CONF_DEBUG_ON(a, b); \
115 TERM_DEBUG_ON(a, b); \
117 #define DEBUG_OFF(a, b) \
119 CONF_DEBUG_OFF(a, b); \
120 TERM_DEBUG_OFF(a, b); \
123 #define BGP_DEBUG(a, b) (term_bgp_debug_ ## a & BGP_DEBUG_ ## b)
124 #define CONF_BGP_DEBUG(a, b) (conf_bgp_debug_ ## a & BGP_DEBUG_ ## b)
126 extern const char *bgp_type_str[];
128 extern int bgp_dump_attr (struct peer *, struct attr *, char *, size_t);
129 extern void bgp_notify_print (struct peer *, struct bgp_notify *, const char *);
131 extern const struct message bgp_status_msg[];
132 extern const int bgp_status_msg_max;
134 #endif /* _QUAGGA_BGP_DEBUG_H */