Allow arplog to be used outside of if_arp.c

This commit is contained in:
roy 2016-09-15 18:17:29 +00:00
parent 406ea0ab88
commit bddde31ef2
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_arp.c,v 1.223 2016/09/07 13:01:39 roy Exp $ */ /* $NetBSD: if_arp.c,v 1.224 2016/09/15 18:17:29 roy Exp $ */
/*- /*-
* Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@ -68,7 +68,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.223 2016/09/07 13:01:39 roy Exp $"); __KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.224 2016/09/15 18:17:29 roy Exp $");
#ifdef _KERNEL_OPT #ifdef _KERNEL_OPT
#include "opt_ddb.h" #include "opt_ddb.h"
@ -149,12 +149,10 @@ static int arp_maxhold = 1; /* number of packets to hold per ARP entry */
int ip_dad_count = PROBE_NUM; int ip_dad_count = PROBE_NUM;
#ifdef ARP_DEBUG #ifdef ARP_DEBUG
static int arp_debug = 1; int arp_debug = 1;
#else #else
static int arp_debug = 0; int arp_debug = 0;
#endif #endif
#define arplog(level, fmt, args...) \
do { if (arp_debug) log(level, "%s: " fmt, __func__, ##args);} while (0)
static void arp_init(void); static void arp_init(void);

View File

@ -1,4 +1,4 @@
/* $NetBSD: in_var.h,v 1.81 2016/09/13 00:45:15 christos Exp $ */ /* $NetBSD: in_var.h,v 1.82 2016/09/15 18:17:29 roy Exp $ */
/*- /*-
* Copyright (c) 1998 The NetBSD Foundation, Inc. * Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -378,6 +378,9 @@ struct in_multi {
extern pktqueue_t *ip_pktq; extern pktqueue_t *ip_pktq;
extern int ip_dad_count; /* Duplicate Address Detection probes */ extern int ip_dad_count; /* Duplicate Address Detection probes */
extern int arp_debug;
#define arplog(level, fmt, args...) \
do { if (arp_debug) log(level, "%s: " fmt, __func__, ##args);} while (0)
/* /*
* Structure used by functions below to remember position when stepping * Structure used by functions below to remember position when stepping