Solaris: Programmatic interface to ifconfig?

你说的曾经没有我的故事 提交于 2019-12-01 09:34:21

I have an implementation here, IPv4-only based on SIOCGIFCONF ioctl()'s and IP family agnostic version using SIOCGLIFCONF:

http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/getifaddrs.c

Tested on SPARC/Solaris 10 and x86/OpenSolaris 2008.11 & 2009.06, LGPL 2.1 license.

getifaddrs() was recently integrated into the source code for future OpenSolaris & Solaris releases, but that doesn't help your code run on current releases:

Until then you'll need to use the SIOCGLIFCONF ioctls, which you should find lots of examples of in open source code, including the link you posted.

ShiDoiSi

Real men use ioctl ;)

Take a look at if(7P).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!