From ca4125f7b3e73a061f825e1661363b597663f37d Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Thu, 24 Jul 2003 10:33:01 +0000 Subject: [PATCH] Create a subtree 'harp' of the net sysctl tree. This uses a fixed OID as the other protocol family sub-trees do, that is equal to the protocol family identifier. Make the ATM layer debugging flags available under this tree. Submitted by: Vincent Jardin MFC after: 2 weeks --- sys/netatm/atm_proto.c | 3 +++ sys/netatm/atm_subr.c | 25 ++++++++++++++++++++++--- sys/netatm/atm_var.h | 6 ++++++ 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sys/netatm/atm_proto.c b/sys/netatm/atm_proto.c index da9ef0ff24ed..174852cabe41 100644 --- a/sys/netatm/atm_proto.c +++ b/sys/netatm/atm_proto.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,6 +115,8 @@ struct domain atmdomain = { DOMAIN_SET(atm); +SYSCTL_NODE(_net, PF_ATM, harp, CTLFLAG_RW, 0, "HARP/ATM family"); +SYSCTL_NODE(_net_harp, OID_AUTO, atm, CTLFLAG_RW, 0, "ATM layer"); /* * Protocol request not supported diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c index 0a6b55b55144..aa5a58a83f24 100644 --- a/sys/netatm/atm_subr.c +++ b/sys/netatm/atm_subr.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,15 +65,33 @@ Atm_endpoint *atm_endpoints[ENDPT_MAX+1] = {NULL}; struct stackq_entry *atm_stackq_head = NULL, *atm_stackq_tail; struct atm_sock_stat atm_sock_stat = { { 0 } }; int atm_init = 0; -int atm_debug = 0; -int atm_dev_print = 0; -int atm_print_data = 0; int atm_version = ATM_VERSION; struct timeval atm_debugtime = {0, 0}; struct ifqueue atm_intrq; uma_zone_t atm_attributes_zone; +/* + * net.harp.atm.atm_debug + */ +int atm_debug; +SYSCTL_INT(_net_harp_atm, OID_AUTO, atm_debug, CTLFLAG_RW, + &atm_debug, 0, "HARP ATM layer debugging flag"); + +/* + * net.harp.atm.atm_dev_print + */ +int atm_dev_print; +SYSCTL_INT(_net_harp_atm, OID_AUTO, atm_dev_print, CTLFLAG_RW, + &atm_dev_print, 0, "display ATM CPCS headers"); + +/* + * net.harp.atm.atm_print_data + */ +int atm_print_data; +SYSCTL_INT(_net_harp_atm, OID_AUTO, atm_print_data, CTLFLAG_RW, + &atm_print_data, 0, "display ATM CPCS payloads"); + /* * Local functions */ diff --git a/sys/netatm/atm_var.h b/sys/netatm/atm_var.h index c4c632a5cad1..60852756693f 100644 --- a/sys/netatm/atm_var.h +++ b/sys/netatm/atm_var.h @@ -174,5 +174,11 @@ int atm_stack_enq(int, void (*)(int, void *, intptr_t, intptr_t), void *, Atm_connvc *, intptr_t, intptr_t); void atm_stack_drain(void); void atm_pdu_print(const KBuffer *, const char *); + +#ifdef SYSCTL_DECL +SYSCTL_DECL(_net_harp); +SYSCTL_DECL(_net_harp_atm); +#endif + #endif /* _KERNEL */ #endif /* _NETATM_ATM_VAR_H */