ouyang kai wrote:
>
> Part 1.1 Type: Plain Text (text/plain)
> Encoding: quoted-printable
| Hi guys,
| In the "TCP/IP Illustrated, Volume2: The Implementation" book,
| there give 'ioctl' and 'sysctl' in the kernel routine.
| ioctl -> sooioctl->(interface)ifioctl.....
| sysctl-> net_sysctl -> pr_sysctl -> ip_sysctl....
| Now, I can find the corresponding code about 'ioctl' routine.
| But, I could not find any code about 'sysctl', why?
| how the FreeBSD realize the corresponding functions?
| Thank you!
The book is not applicable to the sysctl implementation.
Pick a sysctl by the terminal name, search for the name in the
source code, and then expand the macros.
Once again, we are talking about linker sets. This is a little
more complex, though, since you have to take the "boot environment"
into account, as well (the boot environment is the basis for a
preinitialized sysctl space contents, seperate from the code you
see in the kernel itself for the declarations of specific sysctl
OIDs that are added to the ones exported before the kernel is even
really started.
Research:
TUNABLE_INT_DECL
TUNABLE_INT_FETCH
SYSCTL_DECL
SYSCTL_NODE
SYSCTL_INT
SYSCTL_STRUCT
SYSCTL_PROC
Start with:
cd /usr/src/sys/netinet
grep SYSCTL *
And looking at: /usr/src/sys/sys/sysctl.h
See also:
SI_SUB_TUNABLES = 0x0700000, /* establish tunable values */
in /usr/src/sys/sys/kernel.h.
-- Terry
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message