]> git.proxmox.com Git - mirror_frr.git/blame - ospfd/ospf_dump.h
Merge pull request #13677 from LabNConsulting/chopps/bad-abstract
[mirror_frr.git] / ospfd / ospf_dump.h
CommitLineData
acddc0ed 1// SPDX-License-Identifier: GPL-2.0-or-later
718e3744 2/*
3 * OSPFd dump routine.
4 * Copyright (C) 1999 Toshiaki Takada
718e3744 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
cb2bc4cb 37#define OSPF_DEBUG_EXTNL_LSA_AGGR 0x10
718e3744 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
16f1b9ee 45#define OSPF_DEBUG_TE 0x04
cf9b9f77
OD
46#define OSPF_DEBUG_EXT 0x08
47#define OSPF_DEBUG_SR 0x10
a4553b5b 48#define OSPF_DEBUG_TI_LFA 0x11
1febb13d 49#define OSPF_DEBUG_DEFAULTINFO 0x20
132a782e 50#define OSPF_DEBUG_LDP_SYNC 0x40
718e3744 51
3f87e1d8 52#define OSPF_DEBUG_GR 0x01
f96f2713 53
e4505a2e
RZ
54#define OSPF_DEBUG_BFD_LIB 0x01
55
a6c39c3d
CH
56#define OSPF_DEBUG_CLIENT_API 0x01
57
718e3744 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)
d62a17ae 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)
718e3744 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)
d62a17ae 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)
718e3744 88
89/* Macro for checking debug option. */
d62a17ae 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)
7743f2f8 92#define IS_DEBUG_OSPF_EVENT IS_DEBUG_OSPF(event, EVENT)
718e3744 93
7743f2f8 94#define IS_DEBUG_OSPF_NSSA IS_DEBUG_OSPF(nssa, NSSA)
718e3744 95
7743f2f8 96#define IS_DEBUG_OSPF_TE IS_DEBUG_OSPF(te, TE)
16f1b9ee 97
7743f2f8 98#define IS_DEBUG_OSPF_EXT IS_DEBUG_OSPF(ext, EXT)
cf9b9f77 99
7743f2f8 100#define IS_DEBUG_OSPF_SR IS_DEBUG_OSPF(sr, SR)
cf9b9f77 101
a4553b5b
G
102#define IS_DEBUG_OSPF_TI_LFA IS_DEBUG_OSPF(ti_lfa, TI_LFA)
103
1febb13d
S
104#define IS_DEBUG_OSPF_DEFAULT_INFO IS_DEBUG_OSPF(defaultinfo, DEFAULTINFO)
105
132a782e 106#define IS_DEBUG_OSPF_LDP_SYNC IS_DEBUG_OSPF(ldp_sync, LDP_SYNC)
3f87e1d8 107#define IS_DEBUG_OSPF_GR IS_DEBUG_OSPF(gr, GR)
a6c39c3d 108#define IS_DEBUG_OSPF_CLIENT_API IS_DEBUG_OSPF(client_api, CLIENT_API)
132a782e 109
d62a17ae 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)
718e3744 113
718e3744 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. */
118extern unsigned long term_debug_ospf_packet[];
119extern unsigned long term_debug_ospf_event;
120extern unsigned long term_debug_ospf_ism;
121extern unsigned long term_debug_ospf_nsm;
122extern unsigned long term_debug_ospf_lsa;
123extern unsigned long term_debug_ospf_zebra;
124extern unsigned long term_debug_ospf_nssa;
16f1b9ee 125extern unsigned long term_debug_ospf_te;
cf9b9f77
OD
126extern unsigned long term_debug_ospf_ext;
127extern unsigned long term_debug_ospf_sr;
a4553b5b 128extern unsigned long term_debug_ospf_ti_lfa;
1febb13d 129extern unsigned long term_debug_ospf_defaultinfo;
132a782e 130extern unsigned long term_debug_ospf_ldp_sync;
f96f2713 131extern unsigned long term_debug_ospf_gr;
e4505a2e 132extern unsigned long term_debug_ospf_bfd;
a6c39c3d 133extern unsigned long term_debug_ospf_client_api;
718e3744 134
135/* Message Strings. */
718e3744 136extern char *ospf_lsa_type_str[];
137
138/* Prototypes. */
02e701e4
DS
139extern const char *ospf_area_name_string(struct ospf_area *area);
140extern const char *ospf_area_desc_string(struct ospf_area *area);
141extern const char *ospf_if_name_string(struct ospf_interface *oip);
3766c36a 142extern int ospf_nbr_ism_state(struct ospf_neighbor *nbr);
059fd3a4 143extern void ospf_nbr_ism_state_message(struct ospf_neighbor *nbr, char *buf,
144 size_t size);
02e701e4
DS
145extern const char *ospf_timer_dump(struct event *e, char *buf, size_t size);
146extern const char *ospf_timeval_dump(struct timeval *t, char *buf, size_t size);
147extern void ospf_packet_dump(struct stream *s);
6243a7b5 148extern void ospf_debug_init(void);
718e3744 149
649654ab 150/* Appropriate buffer size to use with ospf_timer_dump and ospf_timeval_dump: */
151#define OSPF_TIME_DUMP_SIZE 16
152
718e3744 153#endif /* _ZEBRA_OSPF_DUMP_H */