bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

thinking about siocgifconf and friends


From: Marcus Brinkmann
Subject: thinking about siocgifconf and friends
Date: Sat, 13 Jan 2001 02:04:36 +0100
User-agent: Mutt/1.1.4i

Hi,

I think I want to solely use if_nameindex, and wrap it up in libinetutils
for systems which don't have it.

Systems which have SIOCGIFNUM, SIOCGIFCONF and SIOCGIFINDEX are ideal.
Systems which don't have SIOCGIFNUM are taken care of by doubling the buffer
and retrying the SIOCGIFCONF call until there is no truncation.
Systems which don't have SIOCGIFINDEX will get either get a dummy index number
assigned by libinetutils wrapper, but applications should not display this
to the user if their life span is short. It is only guaranteed to be
constant for the time the task runs, of course.

(For example, a program showing a menu with all interfaces and let the user
pick can make use of the index number. A program like ifconfig should not
accept something like ifconfig --interface-by-index 3, because the user can
not make any assumptions for the numbering, even if he run ifconfig before
and it reported "3" for this interface).

There will be the need of some flag for the applications to tell them if
case 1/2 or 3 applies.

If I am missing something that makes the above approach unfeasible, please
let me know.

BTW, something we really, really need is some inetutils.h header file of
some sort with prototypes et al. I'd think that Jeff can cook up the autoconf
magic here that is necessary to make this work correctly.

Thanks,
Marcus


-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org address@hidden
Marcus Brinkmann              GNU    http://www.gnu.org    address@hidden
address@hidden
http://www.marcus-brinkmann.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]