Access to sysctl on FreeBSD?
Skye
spoier at gmail.com
Tue May 20 15:56:17 EDT 2008
Great, thanks for the help (I'm fairly new to Python, didn't know
about ctypes)
from ctypes import *
libc = CDLL("libc.so.7")
size = c_uint(0)
libc.sysctlbyname("net.inet.ip.stats", None, byref(size), None, 0)
buf = c_char_p(" " * size.value)
libc.sysctlbyname("net.inet.ip.stats", buf, byref(size), None, 0)
So now that I've got the data, can you point me towards docs
explaining how to layout struct ipstat?
Thanks,
Skye
More information about the Python-list
mailing list