]> git.proxmox.com Git - mirror_frr.git/blob - eigrpd/eigrp_dump.h
Merge remote-tracking branch 'origin/stable/2.0'
[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 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
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)
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)
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)
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)
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)
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)
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)
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)
129
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) \
136 (term_debug_eigrp_nei & EIGRP_DEBUG_ ## b)
137 #define IS_DEBUG_EIGRP(a, b) \
138 (term_debug_eigrp & EIGRP_DEBUG_ ## b)
139 #define IS_DEBUG_EIGRP_EVENT IS_DEBUG_EIGRP(event, EVENT)
140
141
142 /* Prototypes. */
143 extern const char *eigrp_if_name_string (struct eigrp_interface *);
144 extern const char *eigrp_if_ip_string (struct eigrp_interface *);
145 extern const char *eigrp_neigh_ip_string (struct eigrp_neighbor *);
146 extern const char *eigrp_topology_ip_string (struct eigrp_prefix_entry *);
147
148 extern void eigrp_ip_header_dump(struct ip *);
149 extern void eigrp_header_dump(struct eigrp_header *);
150
151 extern void show_ip_eigrp_interface_header (struct vty *, struct eigrp *);
152 extern void show_ip_eigrp_neighbor_header (struct vty *, struct eigrp *);
153 extern void show_ip_eigrp_topology_header (struct vty *, struct eigrp *);
154 extern void show_ip_eigrp_interface_detail (struct vty *, struct eigrp *,
155 struct eigrp_interface *);
156 extern void show_ip_eigrp_interface_sub (struct vty *, struct eigrp *,
157 struct eigrp_interface *);
158 extern void show_ip_eigrp_neighbor_sub (struct vty *, struct eigrp_neighbor *, int);
159 extern void show_ip_eigrp_prefix_entry (struct vty *, struct eigrp_prefix_entry *);
160 extern void show_ip_eigrp_neighbor_entry (struct vty *, struct eigrp *, struct eigrp_neighbor_entry *, int *);
161
162 extern void eigrp_debug_init (void);
163
164 #endif /* _ZEBRA_EIGRPD_DUMP_H_ */