C
Chris Snell
Hi,
I need to access the getifaddrs() function, as defined in ifaddrs.h on
FreeBSD/OpenBSD/Mac OS X. I'm trying to read the kernel's traffic
counters for the machine's network interfaces. I ran h2ph on
/usr/include/ifaddrs.h but it did not make the getifaddrs() function
available to me. How can I make this system call from Perl?
Also, getifaddrs provides its data in a struct which contains other
structs. It's a pretty gnarly data structure. Supposing that I can
access this from Perl's syscall, how can I quickly determine the total
size of the idaddrs struct that getifaddrs returns so that I can
allocate space in my scalar for this data?
thanks,
Chris
PS- If anyone knows of a better way to access network interface
statistics (but doesn't involve calling netstat(1)), I'd love to hear
about it.
I need to access the getifaddrs() function, as defined in ifaddrs.h on
FreeBSD/OpenBSD/Mac OS X. I'm trying to read the kernel's traffic
counters for the machine's network interfaces. I ran h2ph on
/usr/include/ifaddrs.h but it did not make the getifaddrs() function
available to me. How can I make this system call from Perl?
Also, getifaddrs provides its data in a struct which contains other
structs. It's a pretty gnarly data structure. Supposing that I can
access this from Perl's syscall, how can I quickly determine the total
size of the idaddrs struct that getifaddrs returns so that I can
allocate space in my scalar for this data?
thanks,
Chris
PS- If anyone knows of a better way to access network interface
statistics (but doesn't involve calling netstat(1)), I'd love to hear
about it.