diff options
author | harti <harti@FreeBSD.org> | 2003-07-25 06:39:46 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-07-25 06:39:46 +0000 |
commit | 820cd379cebe8246b5360b81e1e1442f4422bca7 (patch) | |
tree | d157554a928b4d6772cdbeda44b3bf5fece42000 /sys/netatm | |
parent | efb0411b26a07d0aa9382a43000505ce6cfabb78 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/netatm/uni/uniarp.c | 9 | ||||
-rw-r--r-- | sys/netatm/uni/uniarp_input.c | 2 | ||||
-rw-r--r-- | sys/netatm/uni/unisig_msg.c | 20 | ||||
-rw-r--r-- | sys/netatm/uni/unisig_proto.c | 8 | ||||
-rw-r--r-- | sys/netatm/uni/unisig_var.h | 5 |
5 files changed, 29 insertions, 15 deletions
diff --git a/sys/netatm/uni/uniarp.c b/sys/netatm/uni/uniarp.c index 843bc4a..721e4a9 100644 --- a/sys/netatm/uni/uniarp.c +++ b/sys/netatm/uni/uniarp.c @@ -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, diff --git a/sys/netatm/uni/uniarp_input.c b/sys/netatm/uni/uniarp_input.c index b729c63..b2cef44 100644 --- a/sys/netatm/uni/uniarp_input.c +++ b/sys/netatm/uni/uniarp_input.c @@ -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 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 diff --git a/sys/netatm/uni/unisig_proto.c b/sys/netatm/uni/unisig_proto.c index 09cebd2..e5e8b93 100644 --- a/sys/netatm/uni/unisig_proto.c +++ b/sys/netatm/uni/unisig_proto.c @@ -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> @@ -57,6 +58,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 * * Called when a previously scheduled protocol instance control block diff --git a/sys/netatm/uni/unisig_var.h b/sys/netatm/uni/unisig_var.h index edcae8a..77e5048 100644 --- a/sys/netatm/uni/unisig_var.h +++ b/sys/netatm/uni/unisig_var.h @@ -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 */ |