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

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. Glenn M

    Get Requesting Clients Subnet Mask

    Glenn M, Oct 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    437
    John Saunders
    Oct 12, 2004
  2. yagru_alvarez
    Replies:
    7
    Views:
    642
    Michael Doubez
    Jun 6, 2011
  3. David Corticchiato

    Get the subnet mask

    David Corticchiato, Dec 19, 2006, in forum: Ruby
    Replies:
    3
    Views:
    188
    Shiwei Zhang
    Jan 12, 2007
  4. kielhd
    Replies:
    3
    Views:
    346
    John W. Krahn
    Nov 9, 2003
  5. 187
    Replies:
    2
    Views:
    583
    Bart Lateur
    Jul 29, 2004
Loading...

Share This Page