]>
Commit | Line | Data |
---|---|---|
718e3744 | 1 | /* |
2 | * OSPFd dump routine. | |
3 | * Copyright (C) 1999 Toshiaki Takada | |
4 | * | |
5 | * This file is part of GNU Zebra. | |
6 | * | |
7 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
8 | * under the terms of the GNU General Public License as published by the | |
9 | * Free Software Foundation; either version 2, or (at your option) any | |
10 | * later version. | |
11 | * | |
12 | * GNU Zebra is distributed in the hope that it will be useful, but | |
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * General Public License for more details. | |
16 | * | |
896014f4 DL |
17 | * You should have received a copy of the GNU General Public License along |
18 | * with this program; see the file COPYING; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
718e3744 | 20 | */ |
21 | ||
22 | #ifndef _ZEBRA_OSPF_DUMP_H | |
23 | #define _ZEBRA_OSPF_DUMP_H | |
24 | ||
25 | /* Debug Flags. */ | |
26 | #define OSPF_DEBUG_HELLO 0x01 | |
27 | #define OSPF_DEBUG_DB_DESC 0x02 | |
28 | #define OSPF_DEBUG_LS_REQ 0x04 | |
29 | #define OSPF_DEBUG_LS_UPD 0x08 | |
30 | #define OSPF_DEBUG_LS_ACK 0x10 | |
31 | #define OSPF_DEBUG_ALL 0x1f | |
32 | ||
33 | #define OSPF_DEBUG_SEND 0x01 | |
34 | #define OSPF_DEBUG_RECV 0x02 | |
35 | #define OSPF_DEBUG_SEND_RECV 0x03 | |
36 | #define OSPF_DEBUG_DETAIL 0x04 | |
37 | ||
38 | #define OSPF_DEBUG_ISM_STATUS 0x01 | |
39 | #define OSPF_DEBUG_ISM_EVENTS 0x02 | |
40 | #define OSPF_DEBUG_ISM_TIMERS 0x04 | |
41 | #define OSPF_DEBUG_ISM 0x07 | |
42 | #define OSPF_DEBUG_NSM_STATUS 0x01 | |
43 | #define OSPF_DEBUG_NSM_EVENTS 0x02 | |
44 | #define OSPF_DEBUG_NSM_TIMERS 0x04 | |
45 | #define OSPF_DEBUG_NSM 0x07 | |
46 | ||
47 | #define OSPF_DEBUG_LSA_GENERATE 0x01 | |
48 | #define OSPF_DEBUG_LSA_FLOODING 0x02 | |
49 | #define OSPF_DEBUG_LSA_INSTALL 0x04 | |
50 | #define OSPF_DEBUG_LSA_REFRESH 0x08 | |
51 | #define OSPF_DEBUG_LSA 0x0F | |
cb2bc4cb | 52 | #define OSPF_DEBUG_EXTNL_LSA_AGGR 0x10 |
718e3744 | 53 | |
54 | #define OSPF_DEBUG_ZEBRA_INTERFACE 0x01 | |
55 | #define OSPF_DEBUG_ZEBRA_REDISTRIBUTE 0x02 | |
56 | #define OSPF_DEBUG_ZEBRA 0x03 | |
57 | ||
58 | #define OSPF_DEBUG_EVENT 0x01 | |
59 | #define OSPF_DEBUG_NSSA 0x02 | |
16f1b9ee | 60 | #define OSPF_DEBUG_TE 0x04 |
cf9b9f77 OD |
61 | #define OSPF_DEBUG_EXT 0x08 |
62 | #define OSPF_DEBUG_SR 0x10 | |
a4553b5b | 63 | #define OSPF_DEBUG_TI_LFA 0x11 |
1febb13d | 64 | #define OSPF_DEBUG_DEFAULTINFO 0x20 |
132a782e | 65 | #define OSPF_DEBUG_LDP_SYNC 0x40 |
718e3744 | 66 | |
3f87e1d8 | 67 | #define OSPF_DEBUG_GR 0x01 |
f96f2713 | 68 | |
e4505a2e RZ |
69 | #define OSPF_DEBUG_BFD_LIB 0x01 |
70 | ||
718e3744 | 71 | /* Macro for setting debug option. */ |
72 | #define CONF_DEBUG_PACKET_ON(a, b) conf_debug_ospf_packet[a] |= (b) | |
73 | #define CONF_DEBUG_PACKET_OFF(a, b) conf_debug_ospf_packet[a] &= ~(b) | |
74 | #define TERM_DEBUG_PACKET_ON(a, b) term_debug_ospf_packet[a] |= (b) | |
75 | #define TERM_DEBUG_PACKET_OFF(a, b) term_debug_ospf_packet[a] &= ~(b) | |
d62a17ae | 76 | #define DEBUG_PACKET_ON(a, b) \ |
77 | do { \ | |
78 | CONF_DEBUG_PACKET_ON(a, b); \ | |
79 | TERM_DEBUG_PACKET_ON(a, b); \ | |
80 | } while (0) | |
81 | #define DEBUG_PACKET_OFF(a, b) \ | |
82 | do { \ | |
83 | CONF_DEBUG_PACKET_OFF(a, b); \ | |
84 | TERM_DEBUG_PACKET_OFF(a, b); \ | |
85 | } while (0) | |
718e3744 | 86 | |
87 | #define CONF_DEBUG_ON(a, b) conf_debug_ospf_ ## a |= (OSPF_DEBUG_ ## b) | |
88 | #define CONF_DEBUG_OFF(a, b) conf_debug_ospf_ ## a &= ~(OSPF_DEBUG_ ## b) | |
89 | #define TERM_DEBUG_ON(a, b) term_debug_ospf_ ## a |= (OSPF_DEBUG_ ## b) | |
90 | #define TERM_DEBUG_OFF(a, b) term_debug_ospf_ ## a &= ~(OSPF_DEBUG_ ## b) | |
d62a17ae | 91 | #define DEBUG_ON(a, b) \ |
92 | do { \ | |
93 | CONF_DEBUG_ON(a, b); \ | |
94 | TERM_DEBUG_ON(a, b); \ | |
95 | } while (0) | |
96 | #define DEBUG_OFF(a, b) \ | |
97 | do { \ | |
98 | CONF_DEBUG_OFF(a, b); \ | |
99 | TERM_DEBUG_OFF(a, b); \ | |
100 | } while (0) | |
718e3744 | 101 | |
102 | /* Macro for checking debug option. */ | |
d62a17ae | 103 | #define IS_DEBUG_OSPF_PACKET(a, b) (term_debug_ospf_packet[a] & OSPF_DEBUG_##b) |
104 | #define IS_DEBUG_OSPF(a, b) (term_debug_ospf_##a & OSPF_DEBUG_##b) | |
7743f2f8 | 105 | #define IS_DEBUG_OSPF_EVENT IS_DEBUG_OSPF(event, EVENT) |
718e3744 | 106 | |
7743f2f8 | 107 | #define IS_DEBUG_OSPF_NSSA IS_DEBUG_OSPF(nssa, NSSA) |
718e3744 | 108 | |
7743f2f8 | 109 | #define IS_DEBUG_OSPF_TE IS_DEBUG_OSPF(te, TE) |
16f1b9ee | 110 | |
7743f2f8 | 111 | #define IS_DEBUG_OSPF_EXT IS_DEBUG_OSPF(ext, EXT) |
cf9b9f77 | 112 | |
7743f2f8 | 113 | #define IS_DEBUG_OSPF_SR IS_DEBUG_OSPF(sr, SR) |
cf9b9f77 | 114 | |
a4553b5b G |
115 | #define IS_DEBUG_OSPF_TI_LFA IS_DEBUG_OSPF(ti_lfa, TI_LFA) |
116 | ||
1febb13d S |
117 | #define IS_DEBUG_OSPF_DEFAULT_INFO IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO) |
118 | ||
132a782e | 119 | #define IS_DEBUG_OSPF_LDP_SYNC IS_DEBUG_OSPF(ldp_sync, LDP_SYNC) |
3f87e1d8 | 120 | #define IS_DEBUG_OSPF_GR IS_DEBUG_OSPF(gr, GR) |
132a782e | 121 | |
d62a17ae | 122 | #define IS_CONF_DEBUG_OSPF_PACKET(a, b) \ |
123 | (conf_debug_ospf_packet[a] & OSPF_DEBUG_##b) | |
124 | #define IS_CONF_DEBUG_OSPF(a, b) (conf_debug_ospf_##a & OSPF_DEBUG_##b) | |
718e3744 | 125 | |
718e3744 | 126 | #define AREA_NAME(A) ospf_area_name_string ((A)) |
127 | #define IF_NAME(I) ospf_if_name_string ((I)) | |
128 | ||
129 | /* Extern debug flag. */ | |
130 | extern unsigned long term_debug_ospf_packet[]; | |
131 | extern unsigned long term_debug_ospf_event; | |
132 | extern unsigned long term_debug_ospf_ism; | |
133 | extern unsigned long term_debug_ospf_nsm; | |
134 | extern unsigned long term_debug_ospf_lsa; | |
135 | extern unsigned long term_debug_ospf_zebra; | |
136 | extern unsigned long term_debug_ospf_nssa; | |
16f1b9ee | 137 | extern unsigned long term_debug_ospf_te; |
cf9b9f77 OD |
138 | extern unsigned long term_debug_ospf_ext; |
139 | extern unsigned long term_debug_ospf_sr; | |
a4553b5b | 140 | extern unsigned long term_debug_ospf_ti_lfa; |
1febb13d | 141 | extern unsigned long term_debug_ospf_defaultinfo; |
132a782e | 142 | extern unsigned long term_debug_ospf_ldp_sync; |
f96f2713 | 143 | extern unsigned long term_debug_ospf_gr; |
e4505a2e | 144 | extern unsigned long term_debug_ospf_bfd; |
718e3744 | 145 | |
146 | /* Message Strings. */ | |
718e3744 | 147 | extern char *ospf_lsa_type_str[]; |
148 | ||
149 | /* Prototypes. */ | |
d62a17ae | 150 | extern const char *ospf_area_name_string(struct ospf_area *); |
151 | extern const char *ospf_area_desc_string(struct ospf_area *); | |
152 | extern const char *ospf_if_name_string(struct ospf_interface *); | |
3766c36a | 153 | extern int ospf_nbr_ism_state(struct ospf_neighbor *nbr); |
059fd3a4 | 154 | extern void ospf_nbr_state_message(struct ospf_neighbor *nbr, char *buf, |
155 | size_t size); | |
156 | extern void ospf_nbr_ism_state_message(struct ospf_neighbor *nbr, char *buf, | |
157 | size_t size); | |
d62a17ae | 158 | extern const char *ospf_timer_dump(struct thread *, char *, size_t); |
159 | extern const char *ospf_timeval_dump(struct timeval *, char *, size_t); | |
d62a17ae | 160 | extern void ospf_packet_dump(struct stream *); |
6243a7b5 | 161 | extern void ospf_debug_init(void); |
718e3744 | 162 | |
649654ab | 163 | /* Appropriate buffer size to use with ospf_timer_dump and ospf_timeval_dump: */ |
164 | #define OSPF_TIME_DUMP_SIZE 16 | |
165 | ||
718e3744 | 166 | #endif /* _ZEBRA_OSPF_DUMP_H */ |