Help-----what the API "getnetconfig" can not be found in Linux
Hi,
We want to port our program running on Solaris5.8 to Linux(redhat).
During this, we found there were not corresponding functions to replace
the API "getnetconfig, setnetconfig, endnetconfig, getnetconfigent,
freenetconfigent".
At the same time, we also found the file "etc/netconfig" does not exist
on Linux.
Does anyone can tell us how to port above functions?
Thanks in advance!
Gavin Yu
Re: Help-----what the API "getnetconfig" can not be found in Linux
On Wed, 7 Sep 2005 15:49:34 +0800, Gavin Yu staggered into the Black Sun
and said:[color=blue]
> We want to port our program running on Solaris5.8 to Linux(redhat).
> During this, we found there were not corresponding functions to
> replace the API "getnetconfig, setnetconfig, endnetconfig,
> getnetconfigent, freenetconfigent".
>
> At the same time, we also found the file "etc/netconfig" does not
> exist on Linux. Does anyone can tell us how to port above functions?[/color]
Google [url]http://www.cs.biu.ac.il/cgi-bin/man?netconfig+4[/url] says this is a
Solaris/SunOS-specific thing. It doesn't exist in the same way on
Linux; there aren't typically any device nodes for your eth0..eth9
devices.[0] You can figure out how many network devices there are and
what their IP (and IPV6, if present) addresses are by popen()ing
/sbin/ifconfig and parsing what you get back. There are ioctls you can
call and files in /proc you can read to get that information, of course,
but running ifconfig is probably faster than rewriting it.
Also, when you're asking for things like this, you typically get better
results when you explain more of the larger picture. Don't say, "What
is the equivalent to Win32MultiMediaCrud() in Linux?", say "I need to
keep audio/video synced to +/- 0.05 seconds in the video player I'm
writing; how could I do that?" What are you using getnetconfig() et al
*for* here, in other words? HTH anyway,
[0] There can be, but that particular kernel option is only rarely
turned on.
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
[url]http://www.brainbench.com[/url] / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL