summaryrefslogtreecommitdiffstats
path: root/sys/netatm/uni/unisig_msg.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-07-25 06:39:46 +0000
committerharti <harti@FreeBSD.org>2003-07-25 06:39:46 +0000
commit820cd379cebe8246b5360b81e1e1442f4422bca7 (patch)
treed157554a928b4d6772cdbeda44b3bf5fece42000 /sys/netatm/uni/unisig_msg.c
parentefb0411b26a07d0aa9382a43000505ce6cfabb78 (diff)
downloadFreeBSD-src-820cd379cebe8246b5360b81e1e1442f4422bca7.zip
FreeBSD-src-820cd379cebe8246b5360b81e1e1442f4422bca7.tar.gz
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
Diffstat (limited to 'sys/netatm/uni/unisig_msg.c')
-rw-r--r--sys/netatm/uni/unisig_msg.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/netatm/uni/unisig_msg.c b/sys/netatm/uni/unisig_msg.c
index edc2d39..08b7934 100644
--- a/sys/netatm/uni/unisig_msg.c
+++ b/sys/netatm/uni/unisig_msg.c
@@ -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
OpenPOWER on IntegriCloud