diff options
author | harti <harti@FreeBSD.org> | 2003-07-24 15:25:17 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-07-24 15:25:17 +0000 |
commit | 66450ad78cf74feb9369964ae439f8df537c4de7 (patch) | |
tree | 825d2d5c6b1a57f0c1717aed524978376f8f19b0 | |
parent | de6c6f2703549901121c8497439c951df5169ed2 (diff) | |
download | FreeBSD-src-66450ad78cf74feb9369964ae439f8df537c4de7.zip FreeBSD-src-66450ad78cf74feb9369964ae439f8df537c4de7.tar.gz |
Make the debugging variable that controls dumping of IP over ATM packets
accessible as a sysctl.
Submitted by: Vincent Jardin <vjardin@wanadoo.fr>
MFC after: 2 weeks
-rw-r--r-- | sys/netatm/ipatm/ipatm_input.c | 4 | ||||
-rw-r--r-- | sys/netatm/ipatm/ipatm_load.c | 17 | ||||
-rw-r--r-- | sys/netatm/ipatm/ipatm_output.c | 3 | ||||
-rw-r--r-- | sys/netatm/ipatm/ipatm_var.h | 5 |
4 files changed, 19 insertions, 10 deletions
diff --git a/sys/netatm/ipatm/ipatm_input.c b/sys/netatm/ipatm/ipatm_input.c index 3f2eef6..d1d52bc 100644 --- a/sys/netatm/ipatm/ipatm_input.c +++ b/sys/netatm/ipatm/ipatm_input.c @@ -72,11 +72,9 @@ ipatm_cpcs_data(tok, m) { struct ipvcc *ivp = tok; -#ifdef DIAGNOSTIC if (ipatm_print) { atm_pdu_print(m, "ipatm_input"); } -#endif /* * Handle input packet @@ -120,11 +118,9 @@ ipatm_ipinput(inp, m) KBuffer *m; { -#ifdef DIAGNOSTIC if (ipatm_print) { atm_pdu_print(m, "ipatm_ipinput"); } -#endif #ifdef DIAGNOSTIC if (!KB_ISPKT(m)) { diff --git a/sys/netatm/ipatm/ipatm_load.c b/sys/netatm/ipatm/ipatm_load.c index c67239c..3334518 100644 --- a/sys/netatm/ipatm/ipatm_load.c +++ b/sys/netatm/ipatm/ipatm_load.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #endif #include <sys/param.h> -#include <sys/types.h> #include <sys/systm.h> #include <sys/errno.h> #include <sys/time.h> @@ -46,6 +45,8 @@ __FBSDID("$FreeBSD$"); #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> @@ -70,7 +71,6 @@ __FBSDID("$FreeBSD$"); */ int ipatm_vccnt = 0; int ipatm_vcidle = IPATM_VCIDLE; -int ipatm_print = 0; u_long last_map_ipdst = 0; struct ipvcc* last_map_ipvcc = NULL; @@ -101,6 +101,19 @@ Atm_endpoint ipatm_endpt = { uma_zone_t ipatm_vc_zone; /* + * net.harp.ip + */ +SYSCTL_NODE(_net_harp, OID_AUTO, ip, CTLFLAG_RW, 0, "IPv4 over ATM"); + +/* + * net.harp.ip.ipatm_print + */ +int ipatm_print = 0; +SYSCTL_INT(_net_harp_ip, OID_AUTO, ipatm_print, CTLFLAG_RW, + &ipatm_print, 0, "dump IPv4-over-ATM packets"); + + +/* * Local functions */ static int ipatm_start(void); diff --git a/sys/netatm/ipatm/ipatm_output.c b/sys/netatm/ipatm/ipatm_output.c index 57ef6b3..195d8d1 100644 --- a/sys/netatm/ipatm/ipatm_output.c +++ b/sys/netatm/ipatm/ipatm_output.c @@ -85,11 +85,9 @@ ipatm_ifoutput(ifp, m, dst) struct ipvcc *ivp; int err = 0; -#ifdef DIAGNOSTIC if (ipatm_print) { atm_pdu_print(m, "ipatm_ifoutput"); } -#endif /* * See if we've already got an appropriate VCC @@ -217,4 +215,3 @@ ipatm_ifoutput(ifp, m, dst) done: return (err); } - diff --git a/sys/netatm/ipatm/ipatm_var.h b/sys/netatm/ipatm/ipatm_var.h index f94b6f8..fa79a94 100644 --- a/sys/netatm/ipatm/ipatm_var.h +++ b/sys/netatm/ipatm/ipatm_var.h @@ -201,7 +201,6 @@ extern u_long last_map_ipdst; extern struct ipvcc *last_map_ipvcc; extern struct ip_nif *ipatm_nif_head; extern uma_zone_t ipatm_vc_zone; -extern uma_zone_t ipatm_nif_zone; extern struct ipatm_stat ipatm_stat; extern struct atm_time ipatm_itimer; extern Atm_endpoint ipatm_endpt; @@ -209,6 +208,10 @@ extern Atm_attributes ipatm_aal5llc; extern Atm_attributes ipatm_aal5null; extern Atm_attributes ipatm_aal4null; +#ifdef SYSCTL_DECL +SYSCTL_DECL(_net_harp_ip); +#endif + #endif /* _KERNEL */ #endif /* _IPATM_IPATM_VAR_H */ |