Is there a portable way to retrieve the local host subnet mask?

Discussion in 'Python' started by Pierre Rouleau, Dec 10, 2003.

  1. Hi all,

    socket.gethostbyname_ex(socket.gethostname()) will return the list of IP
    addresses on a the local host. I did not find any function that can be
    used to get the subnet mask and default gateway.

    Under Win32, the Win32 IP helper API provides a GetIpAddrTable()
    function that returns information that contain the subnet mask, but
    that's Win32 level, and is not portable. Is there something available
    in the Python library for that purpose?


    Thanks



    Pierre
     
    Pierre Rouleau, Dec 10, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vijesh
    Replies:
    0
    Views:
    565
    Vijesh
    Nov 27, 2004
  2. Glenn M

    Get Requesting Clients Subnet Mask

    Glenn M, Oct 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    540
    John Saunders
    Oct 12, 2004
  3. Francis Moreau

    Portable way to mask the LSB

    Francis Moreau, May 29, 2010, in forum: C Programming
    Replies:
    7
    Views:
    986
    Keith Thompson
    May 31, 2010
  4. yagru_alvarez
    Replies:
    7
    Views:
    1,029
    Michael Doubez
    Jun 6, 2011
  5. David Corticchiato

    Get the subnet mask

    David Corticchiato, Dec 19, 2006, in forum: Ruby
    Replies:
    3
    Views:
    356
    Shiwei Zhang
    Jan 12, 2007
  6. Marcin Tyman

    Conversion mask in hex to bit mask

    Marcin Tyman, May 6, 2008, in forum: Ruby
    Replies:
    4
    Views:
    1,202
    Robert Klemme
    May 6, 2008
  7. kielhd
    Replies:
    3
    Views:
    476
    John W. Krahn
    Nov 9, 2003
  8. 187
    Replies:
    2
    Views:
    856
    Bart Lateur
    Jul 29, 2004
Loading...