From 80366b6d6a52c05bb31793c3014c692d7814edd0 Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Thu, 24 Jul 2003 15:25:17 +0000 Subject: [PATCH] Make the debugging variable that controls dumping of IP over ATM packets accessible as a sysctl. Submitted by: Vincent Jardin MFC after: 2 weeks --- sys/netatm/ipatm/ipatm_input.c | 4 ---- sys/netatm/ipatm/ipatm_load.c | 17 +++++++++++++++-- sys/netatm/ipatm/ipatm_output.c | 3 --- 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 3f2eef6b8f89..d1d52bcede65 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 c67239caca4e..3334518fe45e 100644 --- a/sys/netatm/ipatm/ipatm_load.c +++ b/sys/netatm/ipatm/ipatm_load.c @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #endif #include -#include #include #include #include @@ -46,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -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; @@ -100,6 +100,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 */ diff --git a/sys/netatm/ipatm/ipatm_output.c b/sys/netatm/ipatm/ipatm_output.c index 57ef6b38448b..195d8d15be20 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 f94b6f838c98..fa79a940733f 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 */