]> git.proxmox.com Git - mirror_frr.git/blob - ospfd/ospf_dump.h
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ospfd / ospf_dump.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * OSPFd dump routine.
4 * Copyright (C) 1999 Toshiaki Takada
5 */
6
7 #ifndef _ZEBRA_OSPF_DUMP_H
8 #define _ZEBRA_OSPF_DUMP_H
9
10 /* Debug Flags. */
11 #define OSPF_DEBUG_HELLO 0x01
12 #define OSPF_DEBUG_DB_DESC 0x02
13 #define OSPF_DEBUG_LS_REQ 0x04
14 #define OSPF_DEBUG_LS_UPD 0x08
15 #define OSPF_DEBUG_LS_ACK 0x10
16 #define OSPF_DEBUG_ALL 0x1f
17
18 #define OSPF_DEBUG_SEND 0x01
19 #define OSPF_DEBUG_RECV 0x02
20 #define OSPF_DEBUG_SEND_RECV 0x03
21 #define OSPF_DEBUG_DETAIL 0x04
22
23 #define OSPF_DEBUG_ISM_STATUS 0x01
24 #define OSPF_DEBUG_ISM_EVENTS 0x02
25 #define OSPF_DEBUG_ISM_TIMERS 0x04
26 #define OSPF_DEBUG_ISM 0x07
27 #define OSPF_DEBUG_NSM_STATUS 0x01
28 #define OSPF_DEBUG_NSM_EVENTS 0x02
29 #define OSPF_DEBUG_NSM_TIMERS 0x04
30 #define OSPF_DEBUG_NSM 0x07
31
32 #define OSPF_DEBUG_LSA_GENERATE 0x01
33 #define OSPF_DEBUG_LSA_FLOODING 0x02
34 #define OSPF_DEBUG_LSA_INSTALL 0x04
35 #define OSPF_DEBUG_LSA_REFRESH 0x08
36 #define OSPF_DEBUG_LSA 0x0F
37 #define OSPF_DEBUG_EXTNL_LSA_AGGR 0x10
38
39 #define OSPF_DEBUG_ZEBRA_INTERFACE 0x01
40 #define OSPF_DEBUG_ZEBRA_REDISTRIBUTE 0x02
41 #define OSPF_DEBUG_ZEBRA 0x03
42
43 #define OSPF_DEBUG_EVENT 0x01
44 #define OSPF_DEBUG_NSSA 0x02
45 #define OSPF_DEBUG_TE 0x04
46 #define OSPF_DEBUG_EXT 0x08
47 #define OSPF_DEBUG_SR 0x10
48 #define OSPF_DEBUG_TI_LFA 0x11
49 #define OSPF_DEBUG_DEFAULTINFO 0x20
50 #define OSPF_DEBUG_LDP_SYNC 0x40
51
52 #define OSPF_DEBUG_GR 0x01
53
54 #define OSPF_DEBUG_BFD_LIB 0x01
55
56 #define OSPF_DEBUG_CLIENT_API 0x01
57
58 /* Macro for setting debug option. */
59 #define CONF_DEBUG_PACKET_ON(a, b) conf_debug_ospf_packet[a] |= (b)
60 #define CONF_DEBUG_PACKET_OFF(a, b) conf_debug_ospf_packet[a] &= ~(b)
61 #define TERM_DEBUG_PACKET_ON(a, b) term_debug_ospf_packet[a] |= (b)
62 #define TERM_DEBUG_PACKET_OFF(a, b) term_debug_ospf_packet[a] &= ~(b)
63 #define DEBUG_PACKET_ON(a, b) \
64 do { \
65 CONF_DEBUG_PACKET_ON(a, b); \
66 TERM_DEBUG_PACKET_ON(a, b); \
67 } while (0)
68 #define DEBUG_PACKET_OFF(a, b) \
69 do { \
70 CONF_DEBUG_PACKET_OFF(a, b); \
71 TERM_DEBUG_PACKET_OFF(a, b); \
72 } while (0)
73
74 #define CONF_DEBUG_ON(a, b) conf_debug_ospf_ ## a |= (OSPF_DEBUG_ ## b)
75 #define CONF_DEBUG_OFF(a, b) conf_debug_ospf_ ## a &= ~(OSPF_DEBUG_ ## b)
76 #define TERM_DEBUG_ON(a, b) term_debug_ospf_ ## a |= (OSPF_DEBUG_ ## b)
77 #define TERM_DEBUG_OFF(a, b) term_debug_ospf_ ## a &= ~(OSPF_DEBUG_ ## b)
78 #define DEBUG_ON(a, b) \
79 do { \
80 CONF_DEBUG_ON(a, b); \
81 TERM_DEBUG_ON(a, b); \
82 } while (0)
83 #define DEBUG_OFF(a, b) \
84 do { \
85 CONF_DEBUG_OFF(a, b); \
86 TERM_DEBUG_OFF(a, b); \
87 } while (0)
88
89 /* Macro for checking debug option. */
90 #define IS_DEBUG_OSPF_PACKET(a, b) (term_debug_ospf_packet[a] & OSPF_DEBUG_##b)
91 #define IS_DEBUG_OSPF(a, b) (term_debug_ospf_##a & OSPF_DEBUG_##b)
92 #define IS_DEBUG_OSPF_EVENT IS_DEBUG_OSPF(event, EVENT)
93
94 #define IS_DEBUG_OSPF_NSSA IS_DEBUG_OSPF(nssa, NSSA)
95
96 #define IS_DEBUG_OSPF_TE IS_DEBUG_OSPF(te, TE)
97
98 #define IS_DEBUG_OSPF_EXT IS_DEBUG_OSPF(ext, EXT)
99
100 #define IS_DEBUG_OSPF_SR IS_DEBUG_OSPF(sr, SR)
101
102 #define IS_DEBUG_OSPF_TI_LFA IS_DEBUG_OSPF(ti_lfa, TI_LFA)
103
104 #define IS_DEBUG_OSPF_DEFAULT_INFO IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO)
105
106 #define IS_DEBUG_OSPF_LDP_SYNC IS_DEBUG_OSPF(ldp_sync, LDP_SYNC)
107 #define IS_DEBUG_OSPF_GR IS_DEBUG_OSPF(gr, GR)
108 #define IS_DEBUG_OSPF_CLIENT_API IS_DEBUG_OSPF(client_api, CLIENT_API)
109
110 #define IS_CONF_DEBUG_OSPF_PACKET(a, b) \
111 (conf_debug_ospf_packet[a] & OSPF_DEBUG_##b)
112 #define IS_CONF_DEBUG_OSPF(a, b) (conf_debug_ospf_##a & OSPF_DEBUG_##b)
113
114 #define AREA_NAME(A) ospf_area_name_string ((A))
115 #define IF_NAME(I) ospf_if_name_string ((I))
116
117 /* Extern debug flag. */
118 extern unsigned long term_debug_ospf_packet[];
119 extern unsigned long term_debug_ospf_event;
120 extern unsigned long term_debug_ospf_ism;
121 extern unsigned long term_debug_ospf_nsm;
122 extern unsigned long term_debug_ospf_lsa;
123 extern unsigned long term_debug_ospf_zebra;
124 extern unsigned long term_debug_ospf_nssa;
125 extern unsigned long term_debug_ospf_te;
126 extern unsigned long term_debug_ospf_ext;
127 extern unsigned long term_debug_ospf_sr;
128 extern unsigned long term_debug_ospf_ti_lfa;
129 extern unsigned long term_debug_ospf_defaultinfo;
130 extern unsigned long term_debug_ospf_ldp_sync;
131 extern unsigned long term_debug_ospf_gr;
132 extern unsigned long term_debug_ospf_bfd;
133 extern unsigned long term_debug_ospf_client_api;
134
135 /* Message Strings. */
136 extern char *ospf_lsa_type_str[];
137
138 /* Prototypes. */
139 extern const char *ospf_area_name_string(struct ospf_area *);
140 extern const char *ospf_area_desc_string(struct ospf_area *);
141 extern const char *ospf_if_name_string(struct ospf_interface *);
142 extern int ospf_nbr_ism_state(struct ospf_neighbor *nbr);
143 extern void ospf_nbr_state_message(struct ospf_neighbor *nbr, char *buf,
144 size_t size);
145 extern void ospf_nbr_ism_state_message(struct ospf_neighbor *nbr, char *buf,
146 size_t size);
147 extern const char *ospf_timer_dump(struct thread *, char *, size_t);
148 extern const char *ospf_timeval_dump(struct timeval *, char *, size_t);
149 extern void ospf_packet_dump(struct stream *);
150 extern void ospf_debug_init(void);
151
152 /* Appropriate buffer size to use with ospf_timer_dump and ospf_timeval_dump: */
153 #define OSPF_TIME_DUMP_SIZE 16
154
155 #endif /* _ZEBRA_OSPF_DUMP_H */