]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/pim6sd/debug.h
This commit was generated by cvs2svn to compensate for changes in r57416,
[FreeBSD/FreeBSD.git] / usr.sbin / pim6sd / debug.h
1 /*
2  * Copyright (C) 1999 LSIIT Laboratory.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the project nor the names of its contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD$
30  */
31 /*
32  *  Questions concerning this software should be directed to
33  *  Mickael Hoerdt (hoerdt@clarinet.u-strasbg.fr) LSIIT Strasbourg.
34  *
35  */
36 /*
37  * This program has been derived from pim6dd.
38  * The pim6dd program is covered by the license in the accompanying file
39  * named "LICENSE.pim6dd".
40  */
41 /*
42  * This program has been derived from pimd.
43  * The pimd program is covered by the license in the accompanying file
44  * named "LICENSE.pimd".
45  *
46  */
47
48
49
50 #ifndef DEBUG_H
51 #define DEBUG_H
52 #include <sys/types.h>
53 #include <stdio.h>
54
55 extern unsigned long    debug;
56 extern int log_nmsgs;
57 extern FILE *log_fp;
58 #define IF_DEBUG(l)     if (debug && debug & (l))
59
60 #define LOG_MAX_MSGS    20      /* if > 20/minute then shut up for a while */
61 #define LOG_SHUT_UP     600     /* shut up for 10 minutes */
62
63
64 /* Debug values definition */
65 /* DVMRP reserved for future use */
66
67 #define DEBUG_DVMRP_PRUNE     0x00000001
68 #define DEBUG_DVMRP_ROUTE     0x00000002
69 #define DEBUG_DVMRP_PEER      0x00000004
70 #define DEBUG_DVMRP_TIMER     0x00000008
71 #define DEBUG_DVMRP_DETAIL    0x01000000
72 #define DEBUG_DVMRP           ( DEBUG_DVMRP_PRUNE | DEBUG_DVMRP_ROUTE | \
73                                 DEBUG_DVMRP_PEER )
74
75 /* MLD related */
76
77 #define DEBUG_MLD_PROTO      0x00000010
78 #define DEBUG_MLD_TIMER      0x00000020
79 #define DEBUG_MLD_MEMBER     0x00000040
80 #define DEBUG_MEMBER          DEBUG_MLD_MEMBER
81 #define DEBUG_MLD             ( DEBUG_MLD_PROTO | DEBUG_MLD_TIMER | \
82                                 DEBUG_MLD_MEMBER )
83
84 /* Misc */
85
86 #define DEBUG_TRACE           0x00000080
87 #define DEBUG_TIMEOUT         0x00000100
88 #define DEBUG_PKT             0x00000200
89
90
91 /* Kernel related */
92
93 #define DEBUG_IF              0x00000400
94 #define DEBUG_KERN            0x00000800
95 #define DEBUG_MFC             0x00001000
96 #define DEBUG_RSRR            0x00002000
97
98 /* PIM related */
99
100 #define DEBUG_PIM_HELLO       0x00004000
101 #define DEBUG_PIM_REGISTER    0x00008000
102 #define DEBUG_PIM_JOIN_PRUNE  0x00010000
103 #define DEBUG_PIM_BOOTSTRAP   0x00020000
104 #define DEBUG_PIM_ASSERT      0x00040000
105 #define DEBUG_PIM_CAND_RP     0x00080000
106 #define DEBUG_PIM_MRT         0x00100000
107 #define DEBUG_PIM_TIMER       0x00200000
108 #define DEBUG_PIM_RPF         0x00400000
109 #define DEBUG_RPF             DEBUG_PIM_RPF
110 #define DEBUG_PIM_DETAIL      0x00800000
111 #define DEBUG_PIM             ( DEBUG_PIM_HELLO | DEBUG_PIM_REGISTER | \
112                                 DEBUG_PIM_JOIN_PRUNE | DEBUG_PIM_BOOTSTRAP | \
113                                 DEBUG_PIM_ASSERT | DEBUG_PIM_CAND_RP | \
114                                 DEBUG_PIM_MRT | DEBUG_PIM_TIMER | \
115                                 DEBUG_PIM_RPF )
116
117 #define DEBUG_MRT             ( DEBUG_DVMRP_ROUTE | DEBUG_PIM_MRT )
118 #define DEBUG_NEIGHBORS       ( DEBUG_DVMRP_PEER | DEBUG_PIM_HELLO )
119 #define DEBUG_TIMER           ( DEBUG_MLD_TIMER | DEBUG_DVMRP_TIMER | \
120                                 DEBUG_PIM_TIMER )
121 #define DEBUG_ASSERT          ( DEBUG_PIM_ASSERT )
122
123 /* CONFIG related */
124 #define DEBUG_CONF 0x01000000
125
126 #define DEBUG_ALL             0xffffffff
127 #define DEBUG_SWITCH              0x80000000
128
129 #define DEBUG_DEFAULT   0xffffffff/*  default if "-d" given without value */
130
131 #if defined(YIPS_DEBUG)
132 #define YIPSDEBUG(lev,arg) if ((debug & (lev)) == (lev)) { arg; }
133 #else
134 #define YIPSDEBUG(lev,arg)
135 #endif /* defined(YIPS_DEBUG) */
136
137 extern char *packet_kind        __P((u_int proto, u_int type,
138                          u_int code));
139 extern int  debug_kind      __P((u_int proto, u_int type,
140                          u_int code));
141 extern void log         __P((int, int, char *, ...));
142 extern int  log_level       __P((u_int proto, u_int type,
143                          u_int code));
144 extern void dump            __P((int i));
145 extern void fdump           __P((int i));
146 extern void cdump           __P((int i));
147 extern void dump_vifs       __P((FILE *fp));
148 extern void dump_nbrs       __P((FILE *fp));
149 extern void dump_pim_mrt        __P((FILE *fp));
150 extern int  dump_rp_set     __P((FILE *fp));
151 extern void dump_stat __P(());
152
153 #endif