2 * EIGRP Dump Functions and Debbuging.
3 * Copyright (C) 2013-2014
11 * This file is part of GNU Zebra.
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
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.
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
28 #ifndef _ZEBRA_EIGRPD_DUMP_H_
29 #define _ZEBRA_EIGRPD_DUMP_H_
31 #define EIGRP_TIME_DUMP_SIZE 16
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
39 /* neighbor debug flags */
40 extern unsigned long term_debug_eigrp_nei
;
41 #define EIGRP_DEBUG_NEI 0x01
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
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
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
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)
74 #define DEBUG_NEI_ON(a, b) \
76 CONF_DEBUG_NEI_ON(a, b); \
77 TERM_DEBUG_NEI_ON(a, b); \
79 #define DEBUG_NEI_OFF(a, b) \
81 CONF_DEBUG_NEI_OFF(a, b); \
82 TERM_DEBUG_NEI_OFF(a, b); \
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)
89 #define DEBUG_PACKET_ON(a, b) \
91 CONF_DEBUG_PACKET_ON(a, b); \
92 TERM_DEBUG_PACKET_ON(a, b); \
94 #define DEBUG_PACKET_OFF(a, b) \
96 CONF_DEBUG_PACKET_OFF(a, b); \
97 TERM_DEBUG_PACKET_OFF(a, b); \
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)
104 #define DEBUG_TRANSMIT_ON(a, b) \
106 CONF_DEBUG_TRANSMIT_ON(a, b); \
107 TERM_DEBUG_TRANSMIT_ON(a, b); \
109 #define DEBUG_TRANSMIT_OFF(a, b) \
111 CONF_DEBUG_TRANSMIT_OFF(a, b); \
112 TERM_DEBUG_TRANSMIT_OFF(a, b); \
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)
119 #define DEBUG_ON(a, b) \
121 CONF_DEBUG_ON(a, b); \
122 TERM_DEBUG_ON(a, b); \
124 #define DEBUG_OFF(a, b) \
126 CONF_DEBUG_OFF(a, b); \
127 TERM_DEBUG_OFF(a, b); \
130 /* Macro for checking debug option. */
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)
137 #define IS_DEBUG_EIGRP_EVENT IS_DEBUG_EIGRP(event, EVENT)
140 extern const char *eigrp_if_name_string(struct eigrp_interface
*);
141 extern const char *eigrp_if_ip_string(struct eigrp_interface
*);
142 extern const char *eigrp_neigh_ip_string(struct eigrp_neighbor
*);
143 extern const char *eigrp_topology_ip_string(struct eigrp_prefix_entry
*);
145 extern void eigrp_ip_header_dump(struct ip
*);
146 extern void eigrp_header_dump(struct eigrp_header
*);
148 extern void show_ip_eigrp_interface_header(struct vty
*, struct eigrp
*);
149 extern void show_ip_eigrp_neighbor_header(struct vty
*, struct eigrp
*);
150 extern void show_ip_eigrp_topology_header(struct vty
*, struct eigrp
*);
151 extern void show_ip_eigrp_interface_detail(struct vty
*, struct eigrp
*,
152 struct eigrp_interface
*);
153 extern void show_ip_eigrp_interface_sub(struct vty
*, struct eigrp
*,
154 struct eigrp_interface
*);
155 extern void show_ip_eigrp_neighbor_sub(struct vty
*, struct eigrp_neighbor
*,
157 extern void show_ip_eigrp_prefix_entry(struct vty
*,
158 struct eigrp_prefix_entry
*);
159 extern void show_ip_eigrp_nexthop_entry(struct vty
*vty
, struct eigrp
*eigrp
,
160 struct eigrp_nexthop_entry
*ne
,
163 extern void eigrp_debug_init(void);
165 #endif /* _ZEBRA_EIGRPD_DUMP_H_ */