Access to sysctl on FreeBSD?

"Martin v. Löwis" martin at v.loewis.de
Tue May 20 14:48:15 EDT 2008


> How do I access the sysctl(3) call from Python on BSD?
> 
> Specifically I want to retrieve:
> 
> $ sysctl -d net.inet.ip.stats
> net.inet.ip.stats: IP statistics (struct ipstat, netinet/ip_var.h)
> 
> So I'll need some way of getting to struct ipstat from Python as well

At the moment, only through ctypes - if you need to use sysctl(3),
and you'll have to manufacture the layout of struct ipstat yourself.

Regards,
Martin



More information about the Python-list mailing list