Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Oct 2002 11:31:09 +0200
From:      "Ido Barnea" <ido@cwnt.com>
To:        "soheil hassas yeganeh" <soheil_h_y@hotmail.com>, <freebsd-net@FreeBSD.ORG>
Subject:   RE: Var. s accessible by sysctl
Message-ID:  <C7DF4400240AFB4095D98C7C6EC2A34A083373@bart.cwnt.com>

index | next in thread | raw e-mail

Do something like this:
static int	my_variable = 0;
SYSCTL_INT(_net_inet_ip, OID_AUTO, my_sysctl_name, CTLFLAG_RW,
    &my_variable, 0, "Description of my variable");

Now you can access my_variable in kernel code, and configure it using:
sysctl -w net.inet.ip.my_sysctl_name = new_value

look in sys/netinet/ip_input.c for more details
> -----Original Message-----
> From: soheil hassas yeganeh [mailto:soheil_h_y@hotmail.com]
> Sent: Monday, October 07, 2002 11:04 AM
> To: freebsd-net@FreeBSD.ORG
> Subject: Var. s accessible by sysctl
> 
> 
> 
> 
> Hi list
> How can i create a variable in kernel source codes ( for 
> network layer - ip) 
> that i can access it by sysctl command like other variables.
> Thanx
> S.h.y
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-net" in the body of the message
> 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message



help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C7DF4400240AFB4095D98C7C6EC2A34A083373>