| 1 | /* |
|---|
| 2 | * Copyright (c) 1998-2001 |
|---|
| 3 | * University of Southern California/Information Sciences Institute. |
|---|
| 4 | * All rights reserved. |
|---|
| 5 | * |
|---|
| 6 | * Redistribution and use in source and binary forms, with or without |
|---|
| 7 | * modification, are permitted provided that the following conditions |
|---|
| 8 | * are met: |
|---|
| 9 | * 1. Redistributions of source code must retain the above copyright |
|---|
| 10 | * notice, this list of conditions and the following disclaimer. |
|---|
| 11 | * 2. Redistributions in binary form must reproduce the above copyright |
|---|
| 12 | * notice, this list of conditions and the following disclaimer in the |
|---|
| 13 | * documentation and/or other materials provided with the distribution. |
|---|
| 14 | * 3. Neither the name of the project nor the names of its contributors |
|---|
| 15 | * may be used to endorse or promote products derived from this software |
|---|
| 16 | * without specific prior written permission. |
|---|
| 17 | * |
|---|
| 18 | * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND |
|---|
| 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|---|
| 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|---|
| 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE |
|---|
| 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|---|
| 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
|---|
| 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|---|
| 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|---|
| 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|---|
| 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|---|
| 28 | * SUCH DAMAGE. |
|---|
| 29 | */ |
|---|
| 30 | /* |
|---|
| 31 | * $Id: debug.h,v 1.8 2001/09/10 20:31:36 pavlin Exp $ |
|---|
| 32 | */ |
|---|
| 33 | /* |
|---|
| 34 | * Part of this program has been derived from mrouted. |
|---|
| 35 | * The mrouted program is covered by the license in the accompanying file |
|---|
| 36 | * named "LICENSE.mrouted". |
|---|
| 37 | * |
|---|
| 38 | * The mrouted program is COPYRIGHT 1989 by The Board of Trustees of |
|---|
| 39 | * Leland Stanford Junior University. |
|---|
| 40 | * |
|---|
| 41 | */ |
|---|
| 42 | |
|---|
| 43 | extern unsigned long debug; |
|---|
| 44 | extern int log_nmsgs; |
|---|
| 45 | #define IF_DEBUG(l) if (debug && debug & (l)) |
|---|
| 46 | |
|---|
| 47 | #define LOG_MAX_MSGS 20 /* if > 20/minute then shut up for a while */ |
|---|
| 48 | #define LOG_SHUT_UP 600 /* shut up for 10 minutes */ |
|---|
| 49 | |
|---|
| 50 | /* Debug values definition */ |
|---|
| 51 | /* DVMRP reserved for future use */ |
|---|
| 52 | #define DEBUG_DVMRP_PRUNE 0x00000001 |
|---|
| 53 | #define DEBUG_DVMRP_ROUTE 0x00000002 |
|---|
| 54 | #define DEBUG_DVMRP_PEER 0x00000004 |
|---|
| 55 | #define DEBUG_DVMRP_TIMER 0x00000008 |
|---|
| 56 | #define DEBUG_DVMRP_DETAIL 0x01000000 |
|---|
| 57 | #define DEBUG_DVMRP ( DEBUG_DVMRP_PRUNE | DEBUG_DVMRP_ROUTE | \ |
|---|
| 58 | DEBUG_DVMRP_PEER ) |
|---|
| 59 | |
|---|
| 60 | /* IGMP related */ |
|---|
| 61 | #define DEBUG_IGMP_PROTO 0x00000010 |
|---|
| 62 | #define DEBUG_IGMP_TIMER 0x00000020 |
|---|
| 63 | #define DEBUG_IGMP_MEMBER 0x00000040 |
|---|
| 64 | #define DEBUG_MEMBER DEBUG_IGMP_MEMBER |
|---|
| 65 | #define DEBUG_IGMP ( DEBUG_IGMP_PROTO | DEBUG_IGMP_TIMER | \ |
|---|
| 66 | DEBUG_IGMP_MEMBER ) |
|---|
| 67 | |
|---|
| 68 | /* Misc */ |
|---|
| 69 | #define DEBUG_TRACE 0x00000080 |
|---|
| 70 | #define DEBUG_TIMEOUT 0x00000100 |
|---|
| 71 | #define DEBUG_PKT 0x00000200 |
|---|
| 72 | |
|---|
| 73 | /* Kernel related */ |
|---|
| 74 | #define DEBUG_IF 0x00000400 |
|---|
| 75 | #define DEBUG_KERN 0x00000800 |
|---|
| 76 | #define DEBUG_MFC 0x00001000 |
|---|
| 77 | #define DEBUG_RSRR 0x00002000 |
|---|
| 78 | |
|---|
| 79 | /* PIM related */ |
|---|
| 80 | #define DEBUG_PIM_HELLO 0x00004000 |
|---|
| 81 | #define DEBUG_PIM_REGISTER 0x00008000 |
|---|
| 82 | #define DEBUG_PIM_JOIN_PRUNE 0x00010000 |
|---|
| 83 | #define DEBUG_PIM_BOOTSTRAP 0x00020000 |
|---|
| 84 | #define DEBUG_PIM_ASSERT 0x00040000 |
|---|
| 85 | #define DEBUG_PIM_CAND_RP 0x00080000 |
|---|
| 86 | #define DEBUG_PIM_MRT 0x00100000 |
|---|
| 87 | #define DEBUG_PIM_TIMER 0x00200000 |
|---|
| 88 | #define DEBUG_PIM_RPF 0x00400000 |
|---|
| 89 | #define DEBUG_RPF DEBUG_PIM_RPF |
|---|
| 90 | #define DEBUG_PIM_DETAIL 0x00800000 |
|---|
| 91 | #define DEBUG_PIM ( DEBUG_PIM_HELLO | DEBUG_PIM_REGISTER | \ |
|---|
| 92 | DEBUG_PIM_JOIN_PRUNE | DEBUG_PIM_BOOTSTRAP | \ |
|---|
| 93 | DEBUG_PIM_ASSERT | DEBUG_PIM_CAND_RP | \ |
|---|
| 94 | DEBUG_PIM_MRT | DEBUG_PIM_TIMER | \ |
|---|
| 95 | DEBUG_PIM_RPF ) |
|---|
| 96 | |
|---|
| 97 | #define DEBUG_MRT ( DEBUG_DVMRP_ROUTE | DEBUG_PIM_MRT ) |
|---|
| 98 | #define DEBUG_NEIGHBORS ( DEBUG_DVMRP_PEER | DEBUG_PIM_HELLO ) |
|---|
| 99 | #define DEBUG_TIMER ( DEBUG_IGMP_TIMER | DEBUG_DVMRP_TIMER | \ |
|---|
| 100 | DEBUG_PIM_TIMER ) |
|---|
| 101 | #define DEBUG_ASSERT ( DEBUG_PIM_ASSERT ) |
|---|
| 102 | #define DEBUG_ALL 0xffffffff |
|---|
| 103 | |
|---|
| 104 | #define DEBUG_DEFAULT 0xffffffff/* default if "-d" given without value */ |
|---|
| 105 | |
|---|