]>
Commit | Line | Data |
---|---|---|
718e3744 | 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 | ||
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 | ||
39 | extern int dump_open; | |
40 | extern int dump_update; | |
41 | extern int dump_keepalive; | |
42 | extern int dump_notify; | |
43 | ||
44 | extern int Debug_Event; | |
45 | extern int Debug_Keepalive; | |
46 | extern int Debug_Update; | |
47 | extern 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 | 57 | extern void bgp_debug_init (void); |
58 | extern void bgp_packet_dump (struct stream *); | |
718e3744 | 59 | |
94f2b392 | 60 | extern int debug (unsigned int option); |
718e3744 | 61 | |
0b2aa3a0 | 62 | extern unsigned long conf_bgp_debug_as4; |
16286195 | 63 | extern unsigned long conf_bgp_debug_neighbor_events; |
718e3744 | 64 | extern unsigned long conf_bgp_debug_packet; |
718e3744 | 65 | extern unsigned long conf_bgp_debug_keepalive; |
66 | extern unsigned long conf_bgp_debug_update; | |
a39275d7 | 67 | extern unsigned long conf_bgp_debug_zebra; |
fb018d25 | 68 | extern unsigned long conf_bgp_debug_nht; |
3f9c7369 | 69 | extern unsigned long conf_bgp_debug_update_groups; |
718e3744 | 70 | |
0b2aa3a0 | 71 | extern unsigned long term_bgp_debug_as4; |
16286195 | 72 | extern unsigned long term_bgp_debug_neighbor_events; |
718e3744 | 73 | extern unsigned long term_bgp_debug_packet; |
718e3744 | 74 | extern unsigned long term_bgp_debug_keepalive; |
75 | extern unsigned long term_bgp_debug_update; | |
a39275d7 | 76 | extern unsigned long term_bgp_debug_zebra; |
fb018d25 | 77 | extern unsigned long term_bgp_debug_nht; |
3f9c7369 | 78 | extern unsigned long term_bgp_debug_update_groups; |
718e3744 | 79 | |
16286195 DS |
80 | extern struct list *bgp_debug_neighbor_events_peers; |
81 | extern struct list *bgp_debug_keepalive_peers; | |
82 | extern struct list *bgp_debug_update_in_peers; | |
83 | extern struct list *bgp_debug_update_out_peers; | |
84 | extern struct list *bgp_debug_update_prefixes; | |
85 | extern struct list *bgp_debug_zebra_prefixes; | |
86 | ||
87 | struct bgp_debug_filter | |
88 | { | |
89 | struct peer *peer; | |
90 | struct prefix *p; | |
91 | }; | |
92 | ||
0b2aa3a0 PJ |
93 | #define BGP_DEBUG_AS4 0x01 |
94 | #define BGP_DEBUG_AS4_SEGMENT 0x02 | |
95 | ||
16286195 | 96 | #define BGP_DEBUG_NEIGHBOR_EVENTS 0x01 |
718e3744 | 97 | #define BGP_DEBUG_PACKET 0x01 |
718e3744 | 98 | #define BGP_DEBUG_KEEPALIVE 0x01 |
99 | #define BGP_DEBUG_UPDATE_IN 0x01 | |
100 | #define BGP_DEBUG_UPDATE_OUT 0x02 | |
16286195 | 101 | #define BGP_DEBUG_UPDATE_PREFIX 0x04 |
a39275d7 | 102 | #define BGP_DEBUG_ZEBRA 0x01 |
fb018d25 | 103 | #define BGP_DEBUG_NHT 0x01 |
3f9c7369 | 104 | #define BGP_DEBUG_UPDATE_GROUPS 0x01 |
718e3744 | 105 | |
106 | #define BGP_DEBUG_PACKET_SEND 0x01 | |
107 | #define BGP_DEBUG_PACKET_SEND_DETAIL 0x02 | |
108 | ||
718e3744 | 109 | #define CONF_DEBUG_ON(a, b) (conf_bgp_debug_ ## a |= (BGP_DEBUG_ ## b)) |
110 | #define CONF_DEBUG_OFF(a, b) (conf_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b)) | |
111 | ||
112 | #define TERM_DEBUG_ON(a, b) (term_bgp_debug_ ## a |= (BGP_DEBUG_ ## b)) | |
113 | #define TERM_DEBUG_OFF(a, b) (term_bgp_debug_ ## a &= ~(BGP_DEBUG_ ## b)) | |
114 | ||
115 | #define DEBUG_ON(a, b) \ | |
116 | do { \ | |
117 | CONF_DEBUG_ON(a, b); \ | |
118 | TERM_DEBUG_ON(a, b); \ | |
119 | } while (0) | |
120 | #define DEBUG_OFF(a, b) \ | |
121 | do { \ | |
122 | CONF_DEBUG_OFF(a, b); \ | |
123 | TERM_DEBUG_OFF(a, b); \ | |
124 | } while (0) | |
125 | ||
126 | #define BGP_DEBUG(a, b) (term_bgp_debug_ ## a & BGP_DEBUG_ ## b) | |
127 | #define CONF_BGP_DEBUG(a, b) (conf_bgp_debug_ ## a & BGP_DEBUG_ ## b) | |
128 | ||
6d58272b | 129 | extern const char *bgp_type_str[]; |
718e3744 | 130 | |
94f2b392 | 131 | extern int bgp_dump_attr (struct peer *, struct attr *, char *, size_t); |
3f9c7369 | 132 | extern int bgp_debug_peer_updout_enabled(struct peer *peer); |
94f2b392 | 133 | extern void bgp_notify_print (struct peer *, struct bgp_notify *, const char *); |
718e3744 | 134 | |
b2d933f8 SH |
135 | extern const struct message bgp_status_msg[]; |
136 | extern const int bgp_status_msg_max; | |
16286195 DS |
137 | extern int bgp_debug_neighbor_events(struct peer *peer); |
138 | extern int bgp_debug_keepalive(struct peer *peer); | |
3f9c7369 DS |
139 | extern int bgp_debug_update(struct peer *peer, struct prefix *p, |
140 | struct update_group *updgrp, unsigned int inbound); | |
16286195 | 141 | extern int bgp_debug_zebra(struct prefix *p); |
00d252cb | 142 | |
143 | #endif /* _QUAGGA_BGP_DEBUG_H */ |