Help-----what the API "getnetconfig" can not be found in Linux - Portable

This is a discussion on Help-----what the API "getnetconfig" can not be found in Linux - Portable ; 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" ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Help-----what the API "getnetconfig" can not be found in Linux

  1. 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



  2. 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:
    > 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?


    Google http://www.cs.biu.ac.il/cgi-bin/man?netconfig+4 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
    http://www.brainbench.com / "He is a rhythmic movement of the
    -----------------------------/ penguins, is Tux." --MegaHAL

+ Reply to Thread