]>
Commit | Line | Data |
---|---|---|
7f57883e DS |
1 | /* |
2 | * EIGRP Dump Functions and Debbuging. | |
3 | * Copyright (C) 2013-2014 | |
4 | * Authors: | |
5 | * Donnie Savage | |
6 | * Jan Janovic | |
7 | * Matej Perina | |
8 | * Peter Orsag | |
9 | * Peter Paluch | |
10 | * | |
11 | * This file is part of GNU Zebra. | |
12 | * | |
13 | * GNU Zebra is free software; you can redistribute it and/or modify it | |
14 | * under the terms of the GNU General Public License as published by the | |
15 | * Free Software Foundation; either version 2, or (at your option) any | |
16 | * later version. | |
17 | * | |
18 | * GNU Zebra is distributed in the hope that it will be useful, but | |
19 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | * General Public License for more details. | |
22 | * | |
896014f4 DL |
23 | * You should have received a copy of the GNU General Public License along |
24 | * with this program; see the file COPYING; if not, write to the Free Software | |
25 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
7f57883e DS |
26 | */ |
27 | ||
28 | #ifndef _ZEBRA_EIGRPD_DUMP_H_ | |
29 | #define _ZEBRA_EIGRPD_DUMP_H_ | |
30 | ||
31 | #define EIGRP_TIME_DUMP_SIZE 16 | |
32 | ||
33 | /* general debug flags */ | |
34 | extern unsigned long term_debug_eigrp; | |
35 | #define EIGRP_DEBUG_EVENT 0x01 | |
36 | #define EIGRP_DEBUG_DETAIL 0x02 | |
37 | #define EIGRP_DEBUG_TIMERS 0x04 | |
38 | ||
39 | /* neighbor debug flags */ | |
40 | extern unsigned long term_debug_eigrp_nei; | |
41 | #define EIGRP_DEBUG_NEI 0x01 | |
42 | ||
43 | /* packet debug flags */ | |
44 | extern unsigned long term_debug_eigrp_packet[]; | |
45 | #define EIGRP_DEBUG_UPDATE 0x01 | |
46 | #define EIGRP_DEBUG_REQUEST 0x02 | |
47 | #define EIGRP_DEBUG_QUERY 0x04 | |
48 | #define EIGRP_DEBUG_REPLY 0x08 | |
49 | #define EIGRP_DEBUG_HELLO 0x10 | |
50 | #define EIGRP_DEBUG_PROBE 0x40 | |
51 | #define EIGRP_DEBUG_ACK 0x80 | |
52 | #define EIGRP_DEBUG_SIAQUERY 0x200 | |
53 | #define EIGRP_DEBUG_SIAREPLY 0x400 | |
54 | #define EIGRP_DEBUG_STUB 0x800 | |
55 | #define EIGRP_DEBUG_PACKETS_ALL 0xfff | |
56 | ||
57 | extern unsigned long term_debug_eigrp_transmit; | |
58 | #define EIGRP_DEBUG_SEND 0x01 | |
59 | #define EIGRP_DEBUG_RECV 0x02 | |
60 | #define EIGRP_DEBUG_SEND_RECV 0x03 | |
61 | #define EIGRP_DEBUG_PACKET_DETAIL 0x04 | |
62 | ||
63 | /* zebra debug flags */ | |
64 | extern unsigned long term_debug_eigrp_zebra; | |
65 | #define EIGRP_DEBUG_ZEBRA_INTERFACE 0x01 | |
66 | #define EIGRP_DEBUG_ZEBRA_REDISTRIBUTE 0x02 | |
67 | #define EIGRP_DEBUG_ZEBRA 0x03 | |
68 | ||
69 | /* Macro for setting debug option. */ | |
70 | #define CONF_DEBUG_NEI_ON(a, b) conf_debug_eigrp_nei[a] |= (b) | |
71 | #define CONF_DEBUG_NEI_OFF(a, b) conf_debug_eigrp_nei[a] &= ~(b) | |
72 | #define TERM_DEBUG_NEI_ON(a, b) term_debug_eigrp_nei[a] |= (b) | |
73 | #define TERM_DEBUG_NEI_OFF(a, b) term_debug_eigrp_nei[a] &= ~(b) | |
d62a17ae | 74 | #define DEBUG_NEI_ON(a, b) \ |
75 | do { \ | |
76 | CONF_DEBUG_NEI_ON(a, b); \ | |
77 | TERM_DEBUG_NEI_ON(a, b); \ | |
78 | } while (0) | |
79 | #define DEBUG_NEI_OFF(a, b) \ | |
80 | do { \ | |
81 | CONF_DEBUG_NEI_OFF(a, b); \ | |
82 | TERM_DEBUG_NEI_OFF(a, b); \ | |
83 | } while (0) | |
7f57883e DS |
84 | |
85 | #define CONF_DEBUG_PACKET_ON(a, b) conf_debug_eigrp_packet[a] |= (b) | |
86 | #define CONF_DEBUG_PACKET_OFF(a, b) conf_debug_eigrp_packet[a] &= ~(b) | |
87 | #define TERM_DEBUG_PACKET_ON(a, b) term_debug_eigrp_packet[a] |= (b) | |
88 | #define TERM_DEBUG_PACKET_OFF(a, b) term_debug_eigrp_packet[a] &= ~(b) | |
d62a17ae | 89 | #define DEBUG_PACKET_ON(a, b) \ |
90 | do { \ | |
91 | CONF_DEBUG_PACKET_ON(a, b); \ | |
92 | TERM_DEBUG_PACKET_ON(a, b); \ | |
93 | } while (0) | |
94 | #define DEBUG_PACKET_OFF(a, b) \ | |
95 | do { \ | |
96 | CONF_DEBUG_PACKET_OFF(a, b); \ | |
97 | TERM_DEBUG_PACKET_OFF(a, b); \ | |
98 | } while (0) | |
7f57883e DS |
99 | |
100 | #define CONF_DEBUG_TRANSMIT_ON(a, b) conf_debug_eigrp_transmit |= (b) | |
101 | #define CONF_DEBUG_TRANSMIT_OFF(a, b) conf_debug_eigrp_transmit &= ~(b) | |
102 | #define TERM_DEBUG_TRANSMIT_ON(a, b) term_debug_eigrp_transmit |= (b) | |
103 | #define TERM_DEBUG_TRANSMIT_OFF(a, b) term_debug_eigrp_transmit &= ~(b) | |
d62a17ae | 104 | #define DEBUG_TRANSMIT_ON(a, b) \ |
105 | do { \ | |
106 | CONF_DEBUG_TRANSMIT_ON(a, b); \ | |
107 | TERM_DEBUG_TRANSMIT_ON(a, b); \ | |
108 | } while (0) | |
109 | #define DEBUG_TRANSMIT_OFF(a, b) \ | |
110 | do { \ | |
111 | CONF_DEBUG_TRANSMIT_OFF(a, b); \ | |
112 | TERM_DEBUG_TRANSMIT_OFF(a, b); \ | |
113 | } while (0) | |
7f57883e DS |
114 | |
115 | #define CONF_DEBUG_ON(a, b) conf_debug_eigrp_ ## a |= (EIGRP_DEBUG_ ## b) | |
116 | #define CONF_DEBUG_OFF(a, b) conf_debug_eigrp_ ## a &= ~(EIGRP_DEBUG_ ## b) | |
117 | #define TERM_DEBUG_ON(a, b) term_debug_eigrp_ ## a |= (EIGRP_DEBUG_ ## b) | |
118 | #define TERM_DEBUG_OFF(a, b) term_debug_eigrp_ ## a &= ~(EIGRP_DEBUG_ ## b) | |
d62a17ae | 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) | |
7f57883e DS |
129 | |
130 | /* Macro for checking debug option. */ | |
d62a17ae | 131 | #define IS_DEBUG_EIGRP_PACKET(a, b) \ |
132 | (term_debug_eigrp_packet[a] & EIGRP_DEBUG_##b) | |
133 | #define IS_DEBUG_EIGRP_TRANSMIT(a, b) \ | |
134 | (term_debug_eigrp_transmit & EIGRP_DEBUG_##b) | |
135 | #define IS_DEBUG_EIGRP_NEI(a, b) (term_debug_eigrp_nei & EIGRP_DEBUG_##b) | |
136 | #define IS_DEBUG_EIGRP(a, b) (term_debug_eigrp & EIGRP_DEBUG_##b) | |
7f57883e DS |
137 | #define IS_DEBUG_EIGRP_EVENT IS_DEBUG_EIGRP(event, EVENT) |
138 | ||
7f57883e | 139 | /* Prototypes. */ |
d62a17ae | 140 | extern const char *eigrp_if_name_string(struct eigrp_interface *); |
7f57883e DS |
141 | |
142 | extern void eigrp_ip_header_dump(struct ip *); | |
143 | extern void eigrp_header_dump(struct eigrp_header *); | |
144 | ||
d62a17ae | 145 | extern void show_ip_eigrp_interface_header(struct vty *, struct eigrp *); |
146 | extern void show_ip_eigrp_neighbor_header(struct vty *, struct eigrp *); | |
147 | extern void show_ip_eigrp_topology_header(struct vty *, struct eigrp *); | |
148 | extern void show_ip_eigrp_interface_detail(struct vty *, struct eigrp *, | |
149 | struct eigrp_interface *); | |
150 | extern void show_ip_eigrp_interface_sub(struct vty *, struct eigrp *, | |
151 | struct eigrp_interface *); | |
152 | extern void show_ip_eigrp_neighbor_sub(struct vty *, struct eigrp_neighbor *, | |
153 | int); | |
dc4accdd DS |
154 | extern void show_ip_eigrp_prefix_descriptor(struct vty *vty, |
155 | struct eigrp_prefix_descriptor *tn); | |
156 | extern void show_ip_eigrp_route_descriptor(struct vty *vty, struct eigrp *eigrp, | |
157 | struct eigrp_route_descriptor *ne, | |
158 | bool *first); | |
d62a17ae | 159 | |
160 | extern void eigrp_debug_init(void); | |
7f57883e DS |
161 | |
162 | #endif /* _ZEBRA_EIGRPD_DUMP_H_ */ |