Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2001 05:38:17 -0800
From:      Julian Elischer <julian@elischer.org>
To:        s2209866@cse.unsw.edu.au
Cc:        FreeBSD <freebsd-questions@freeBSD.org>, freebsd-net@freeBSD.ORG
Subject:   Re: What do I have to change to add a sysctl ?
Message-ID:  <3AC1E949.C9410FE@elischer.org>
References:  <NDBBJCEECLLLJHEBJOGDMEOIEMAA.s2209866@cse.unsw.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Daniel Wong wrote:
> 
> Hi All,
> 
> I want to add a sysctl to the net.inet.ip what do I have to change ??

That depends upon what you are doing...

if you have your own module, you can add line of the form:

#include <sys/sysctl.h>

myinteger = 0;
SYSCTL_INT(_net_inet_ip, IPCTL_FORWARDING, Mycutename, CTLFLAG_RW,
    &myinterger, 0, "Description of my cute new feature");

There are many alternative variations depending upon whether 
you want some code to be run when you set a new value, or 
whether you want to set a string, an integer or a char (etc.).

If you just want to instrument existing code,
then add the above lines into existing files :-)



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

-- 
      __--_|\  Julian Elischer
     /       \ julian@elischer.org
    (   OZ    ) World tour 2000-2001
---> X_.---._/  
            v

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




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