Make the debugging variable that controls printing of UNI messages

accessible as a sysctl and move the debugging stuff out of DIAGNOSTICS.

Submitted by:	Vincent Jardin <vjardin@wanadoo.fr>
MFC after:	2 weeks
This commit is contained in:
Hartmut Brandt 2003-07-25 06:39:46 +00:00
parent 076f523998
commit 6c373d607e
5 changed files with 29 additions and 15 deletions

View file

@ -35,13 +35,14 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/syslog.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_var.h>
@ -74,7 +75,13 @@ struct uniarp *uniarp_nomaptab = NULL;
struct uniarp *uniarp_pvctab = NULL;
struct atm_time uniarp_timer = {0, 0}; /* Aging timer */
struct uniarp_stat uniarp_stat = {0};
/*
* net.harp.uni.uniarp_print
*/
int uniarp_print = 0;
SYSCTL_INT(_net_harp_uni, OID_AUTO, uniarp_print, CTLFLAG_RW,
&uniarp_print, 0, "dump UNI/ARP messages");
Atm_endpoint uniarp_endpt = {
NULL,

View file

@ -104,10 +104,8 @@ uniarp_cpcs_data(tok, m)
KBuffer *n;
int len, plen = sizeof(struct atmarp_hdr);
#ifdef DIAGNOSTIC
if (uniarp_print)
uniarp_pdu_print(ivp, m, "receive");
#endif
/*
* Verify IP's VCC state

View file

@ -34,12 +34,13 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/errno.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <netatm/port.h>
#include <netatm/queue.h>
@ -69,12 +70,15 @@ static void unisig_rcv_setup(struct unisig *, struct unisig_msg *);
/*
* Local variables
* net.harp.uni.unisig_print_msg
*
* 0 - disable
* 1 - dump UNI message
* 2 - dump UNI message + print decoded form
*/
#ifdef DIAGNOSTIC
static int unisig_print_msg = 0;
#endif
SYSCTL_INT(_net_harp_uni, OID_AUTO, unisig_print_msg, CTLFLAG_RW,
&unisig_print_msg, 0, "dump UNI messages");
/*
* Set a Cause IE based on information in an ATM attribute block
@ -204,13 +208,11 @@ unisig_send_msg(usp, msg)
if (usp->us_state != UNISIG_ACTIVE)
return(ENETDOWN);
#ifdef DIAGNOSTIC
/*
* Print the message we're sending.
*/
if (unisig_print_msg)
usp_print_msg(msg, UNISIG_MSG_OUT);
#endif
/*
* Convert message to network order
@ -228,13 +230,11 @@ unisig_send_msg(usp, msg)
return(EIO);
}
#ifdef DIAGNOSTIC
/*
* Print the converted message
*/
if (unisig_print_msg > 1)
unisig_print_mbuf(usf.usf_m_base);
#endif
/*
* Send the message
@ -860,13 +860,11 @@ unisig_rcv_msg(usp, m)
goto done;
}
#ifdef DIAGNOSTIC
/*
* Debug--print some information about the message
*/
if (unisig_print_msg)
usp_print_msg(msg, UNISIG_MSG_IN);
#endif
/*
* Get the call reference value

View file

@ -34,12 +34,13 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/syslog.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
#include <net/if.h>
#include <netatm/port.h>
#include <netatm/queue.h>
@ -56,6 +57,11 @@ __FBSDID("$FreeBSD$");
#include <netatm/uni/unisig_var.h>
/*
* net.harp.uni
*/
SYSCTL_NODE(_net_harp, OID_AUTO, uni, CTLFLAG_RW, 0, "UNI");
/*
* Process a UNISIG timeout
*

View file

@ -320,5 +320,10 @@ int unisig_vc_state(struct unisig *,
extern uma_zone_t unisig_vc_zone;
extern uma_zone_t unisig_msg_zone;
extern uma_zone_t unisig_ie_zone;
#ifdef SYSCTL_DECL
SYSCTL_DECL(_net_harp_uni);
#endif
#endif /* _KERNEL */
#endif /* _UNISIG_VAR_H */