]> git.proxmox.com Git - mirror_frr.git/blob - eigrpd/eigrp_dump.h
eigrpd: Diverse Fixes
[mirror_frr.git] / eigrpd / eigrp_dump.h
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 *
23 * You should have received a copy of the GNU General Public License
24 * along with GNU Zebra; see the file COPYING. If not, write to the Free
25 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 * 02111-1307, USA.
27 */
28
29 #ifndef _ZEBRA_EIGRPD_DUMP_H_
30 #define _ZEBRA_EIGRPD_DUMP_H_
31
32 #define EIGRP_TIME_DUMP_SIZE 16
33
34 /* general debug flags */
35 extern unsigned long term_debug_eigrp;
36 #define EIGRP_DEBUG_EVENT 0x01
37 #define EIGRP_DEBUG_DETAIL 0x02
38 #define EIGRP_DEBUG_TIMERS 0x04
39
40 /* neighbor debug flags */
41 extern unsigned long term_debug_eigrp_nei;
42 #define EIGRP_DEBUG_NEI 0x01
43
44 /* packet debug flags */
45 extern unsigned long term_debug_eigrp_packet[];
46 #define EIGRP_DEBUG_UPDATE 0x01
47 #define EIGRP_DEBUG_REQUEST 0x02
48 #define EIGRP_DEBUG_QUERY 0x04
49 #define EIGRP_DEBUG_REPLY 0x08
50 #define EIGRP_DEBUG_HELLO 0x10
51 #define EIGRP_DEBUG_PROBE 0x40
52 #define EIGRP_DEBUG_ACK 0x80
53 #define EIGRP_DEBUG_SIAQUERY 0x200
54 #define EIGRP_DEBUG_SIAREPLY 0x400
55 #define EIGRP_DEBUG_STUB 0x800
56 #define EIGRP_DEBUG_PACKETS_ALL 0xfff
57
58 extern unsigned long term_debug_eigrp_transmit;
59 #define EIGRP_DEBUG_SEND 0x01
60 #define EIGRP_DEBUG_RECV 0x02
61 #define EIGRP_DEBUG_SEND_RECV 0x03
62 #define EIGRP_DEBUG_PACKET_DETAIL 0x04
63
64 /* zebra debug flags */
65 extern unsigned long term_debug_eigrp_zebra;
66 #define EIGRP_DEBUG_ZEBRA_INTERFACE 0x01
67 #define EIGRP_DEBUG_ZEBRA_REDISTRIBUTE 0x02
68 #define EIGRP_DEBUG_ZEBRA 0x03
69
70 /* Macro for setting debug option. */
71 #define CONF_DEBUG_NEI_ON(a, b) conf_debug_eigrp_nei[a] |= (b)
72 #define CONF_DEBUG_NEI_OFF(a, b) conf_debug_eigrp_nei[a] &= ~(b)
73 #define TERM_DEBUG_NEI_ON(a, b) term_debug_eigrp_nei[a] |= (b)
74 #define TERM_DEBUG_NEI_OFF(a, b) term_debug_eigrp_nei[a] &= ~(b)
75 #define DEBUG_NEI_ON(a, b) \
76 do { \
77 CONF_DEBUG_NEI_ON(a, b); \
78 TERM_DEBUG_NEI_ON(a, b); \
79 } while (0)
80 #define DEBUG_NEI_OFF(a, b) \
81 do { \
82 CONF_DEBUG_NEI_OFF(a, b); \
83 TERM_DEBUG_NEI_OFF(a, b); \
84 } while (0)
85
86 #define CONF_DEBUG_PACKET_ON(a, b) conf_debug_eigrp_packet[a] |= (b)
87 #define CONF_DEBUG_PACKET_OFF(a, b) conf_debug_eigrp_packet[a] &= ~(b)
88 #define TERM_DEBUG_PACKET_ON(a, b) term_debug_eigrp_packet[a] |= (b)
89 #define TERM_DEBUG_PACKET_OFF(a, b) term_debug_eigrp_packet[a] &= ~(b)
90 #define DEBUG_PACKET_ON(a, b) \
91 do { \
92 CONF_DEBUG_PACKET_ON(a, b); \
93 TERM_DEBUG_PACKET_ON(a, b); \
94 } while (0)
95 #define DEBUG_PACKET_OFF(a, b) \
96 do { \
97 CONF_DEBUG_PACKET_OFF(a, b); \
98 TERM_DEBUG_PACKET_OFF(a, b); \
99 } while (0)
100
101 #define CONF_DEBUG_TRANSMIT_ON(a, b) conf_debug_eigrp_transmit |= (b)
102 #define CONF_DEBUG_TRANSMIT_OFF(a, b) conf_debug_eigrp_transmit &= ~(b)
103 #define TERM_DEBUG_TRANSMIT_ON(a, b) term_debug_eigrp_transmit |= (b)
104 #define TERM_DEBUG_TRANSMIT_OFF(a, b) term_debug_eigrp_transmit &= ~(b)
105 #define DEBUG_TRANSMIT_ON(a, b) \
106 do { \
107 CONF_DEBUG_TRANSMIT_ON(a, b); \
108 TERM_DEBUG_TRANSMIT_ON(a, b); \
109 } while (0)
110 #define DEBUG_TRANSMIT_OFF(a, b) \
111 do { \
112 CONF_DEBUG_TRANSMIT_OFF(a, b); \
113 TERM_DEBUG_TRANSMIT_OFF(a, b); \
114 } while (0)
115
116 #define CONF_DEBUG_ON(a, b) conf_debug_eigrp_ ## a |= (EIGRP_DEBUG_ ## b)
117 #define CONF_DEBUG_OFF(a, b) conf_debug_eigrp_ ## a &= ~(EIGRP_DEBUG_ ## b)
118 #define TERM_DEBUG_ON(a, b) term_debug_eigrp_ ## a |= (EIGRP_DEBUG_ ## b)
119 #define TERM_DEBUG_OFF(a, b) term_debug_eigrp_ ## a &= ~(EIGRP_DEBUG_ ## b)
120 #define DEBUG_ON(a, b) \
121 do { \
122 CONF_DEBUG_ON(a, b); \
123 TERM_DEBUG_ON(a, b); \
124 } while (0)
125 #define DEBUG_OFF(a, b) \
126 do { \
127 CONF_DEBUG_OFF(a, b); \
128 TERM_DEBUG_OFF(a, b); \
129 } while (0)
130
131 /* Macro for checking debug option. */
132 #define IS_DEBUG_EIGRP_PACKET(a, b) \
133 (term_debug_eigrp_packet[a] & EIGRP_DEBUG_ ## b)
134 #define IS_DEBUG_EIGRP_TRANSMIT(a, b) \
135 (term_debug_eigrp_transmit & EIGRP_DEBUG_ ## b)
136 #define IS_DEBUG_EIGRP_NEI(a, b) \
137 (term_debug_eigrp_nei & EIGRP_DEBUG_ ## b)
138 #define IS_DEBUG_EIGRP(a, b) \
139 (term_debug_eigrp & EIGRP_DEBUG_ ## b)
140 #define IS_DEBUG_EIGRP_EVENT IS_DEBUG_EIGRP(event, EVENT)
141
142
143 /* Prototypes. */
144 extern const char *eigrp_if_name_string (struct eigrp_interface *);
145 extern const char *eigrp_if_ip_string (struct eigrp_interface *);
146 extern const char *eigrp_neigh_ip_string (struct eigrp_neighbor *);
147 extern const char *eigrp_topology_ip_string (struct eigrp_prefix_entry *);
148
149 extern void eigrp_ip_header_dump(struct ip *);
150 extern void eigrp_header_dump(struct eigrp_header *);
151
152 extern void show_ip_eigrp_interface_header (struct vty *, struct eigrp *);
153 extern void show_ip_eigrp_neighbor_header (struct vty *, struct eigrp *);
154 extern void show_ip_eigrp_topology_header (struct vty *, struct eigrp *);
155 extern void show_ip_eigrp_interface_detail (struct vty *, struct eigrp *,
156 struct eigrp_interface *);
157 extern void show_ip_eigrp_interface_sub (struct vty *, struct eigrp *,
158 struct eigrp_interface *);
159 extern void show_ip_eigrp_neighbor_sub (struct vty *, struct eigrp_neighbor *, int);
160 extern void show_ip_eigrp_prefix_entry (struct vty *, struct eigrp_prefix_entry *);
161 extern void show_ip_eigrp_neighbor_entry (struct vty *, struct eigrp *, struct eigrp_neighbor_entry *, int *);
162
163 extern void eigrp_debug_init (void);
164
165 #endif /* _ZEBRA_EIGRPD_DUMP_H_ */