Getting local IP address...

Grant Edwards ge at nowhere.none
Thu Jul 20 11:05:05 EDT 2000


In article <39768C32.EFB576B0 at pehr.net>, pehr anderson wrote:

>I would be *very* interested in a module that made it easy to access
>low-level interface information.
>
>There are a few goodies python excludes, for better or worse, in 
>the name of cross-platform portability:
>
>1. localhost IP addresses, 

Since a machine may have 0..N IP addresses [most of my machines
have 3], specifying which one you want turns out to be harder
than one would think.  You could just return the whole list,
and let the user sort through them.

>2. MAC addresses for ethernet interfaces,

I don't know how portable the ioctl() calls are between *n*x
systems. (I don't have the faintest idea how it works under
Win32 or MacOS.)

>3. listing available PPP addresses with an interface to connect /
>disconnect.

>4. raw_sockets support. I haven't delved deeply enough to know why this 
>   is excludeded but for embedded development it is *really* handy.

It's really handy for a lot of things.  Talking to proprietary
Ethernet devices for instance.  I've added PF_PACKET support to
my copy of 1.6a2 under Linux.  It was the one thing that was
requiring me to run C programs via system(). Now I can have a
"pure" Python solution.

-- 
Grant Edwards                   grante             Yow!  Does someone from
                                  at               PEORIA have a SHORTER
                               visi.com            ATTENTION span than me?



More information about the Python-list mailing list