### Example Output of ifaddr Source: https://pythonhosted.org/ifaddr/_sources/index.txt Demonstrates the typical output format when listing IP addresses for various network adapters, including IPv4 and IPv6 addresses. ```none IPs of network adapter H5321 gw Mobile Broadband Driver IP ('fe80::9:ebdf:30ab:39a3', 0L, 17L)/64 IP 169.254.57.163/16 IPs of network adapter Intel(R) Centrino(R) Advanced-N 6205 IP ('fe80::481f:3c9d:c3f6:93f8', 0L, 12L)/64 IP 192.168.0.51/24 IPs of network adapter Intel(R) 82579LM Gigabit Network Connection IP ('fe80::85cd:e07e:4f7a:6aa6', 0L, 11L)/64 IP 192.168.0.53/24 IPs of network adapter Software Loopback Interface 1 IP ('::1', 0L, 0L)/128 IP 127.0.0.1/8 ``` -------------------------------- ### Example Output of IP Enumeration Source: https://pythonhosted.org/ifaddr/index.html This shows a typical output format when enumerating network adapter IPs using the ifaddr library, including IPv4 and IPv6 addresses with their respective network prefixes. ```text IPs of network adapter H5321 gw Mobile Broadband Driver IP ('fe80::9:ebdf:30ab:39a3', 0L, 17L)/64 IP 169.254.57.163/16 IPs of network adapter Intel(R) Centrino(R) Advanced-N 6205 IP ('fe80::481f:3c9d:c3f6:93f8', 0L, 12L)/64 IP 192.168.0.51/24 IPs of network adapter Intel(R) 82579LM Gigabit Network Connection IP ('fe80::85cd:e07e:4f7a:6aa6', 0L, 11L)/64 IP 192.168.0.53/24 IPs of network adapter Software Loopback Interface 1 IP ('::1', 0L, 0L)/128 IP 127.0.0.1/8 ``` -------------------------------- ### Get All Network Adapter IPs Source: https://pythonhosted.org/ifaddr/_sources/index.txt Iterates through all network adapters and prints their associated IP addresses and network prefixes. Useful for discovering local network configuration. ```python import ifaddr adapters = ifaddr.get_adapters() for adapter in adapters: print "IPs of network adapter " + adapter.nice_name for ip in adapter.ips: print " %s/%s" % (ip.ip, ip.network_prefix) ``` -------------------------------- ### Get Network Adapters and IPs Source: https://pythonhosted.org/ifaddr/index.html This snippet demonstrates how to retrieve all network adapters and their associated IP addresses (both IPv4 and IPv6) using the ifaddr library. It iterates through each adapter and prints its name and IP addresses with their network prefixes. ```python import ifaddr adapters = ifaddr.get_adapters() for adapter in adapters: print "IPs of network adapter " + adapter.nice_name for ip in adapter.ips: print " %s/%s" % (ip.ip, ip.network_prefix) ``` -------------------------------- ### ifaddr.get_adapters() Source: https://pythonhosted.org/ifaddr/genindex.html Retrieves a list of network adapters available on the system. ```APIDOC ## Function: ifaddr.get_adapters() ### Description This function returns a list of all network adapters configured on the system. Each adapter object contains information about the network interface. ### Parameters None ### Returns - A list of `Adapter` objects. ``` -------------------------------- ### ifaddr.Adapter Class Source: https://pythonhosted.org/ifaddr/_sources/index.txt Represents a network adapter. It contains information about the adapter's name and its associated IP addresses. ```APIDOC ## ifaddr.Adapter ### Description Represents a network adapter. ### Members - **name** (string): The name of the network adapter. - **ips** (list): A list of IP addresses associated with the adapter. - **nice_name** (string): A human-readable name for the network adapter. ``` -------------------------------- ### ifaddr.Adapter Class Source: https://pythonhosted.org/ifaddr/index.html Represents a network interface device controller (NIC). An adapter can have multiple IP addresses associated with it. ```APIDOC ## class ifaddr.Adapter(name, nice_name, ips) ### Description Represents a network interface device controller (NIC), such as a network card. An adapter can have multiple IPs. On Linux aliasing (multiple IPs per physical NIC) is implemented by creating ‘virtual’ adapters, each represented by an instance of this class. Each of those ‘virtual’ adapters can have both a IPv4 and an IPv6 IP address. ### Attributes - **ips** (List[ifaddr.IP]) - List of `ifaddr.IP` instances in the order they were reported by the system. - **name** (str) - Unique name that identifies the adapter in the system. On Linux this is of the form of eth0 or eth0:1, on Windows it is a UUID in string representation, such as {846EE342-7039-11DE-9D20-806E6F6E6963}. - **nice_name** (str) - Human readable name of the adpater. On Linux this is currently the same as `name`. On Windows this is the name of the device. ``` -------------------------------- ### ifaddr.IP Class Source: https://pythonhosted.org/ifaddr/_sources/index.txt Represents an IP address associated with a network adapter. It includes the IP address itself and its network prefix. ```APIDOC ## ifaddr.IP ### Description Represents an IP address. ### Members - **ip** (string): The IP address. - **network_prefix** (integer): The network prefix length. - **nice_name** (string): A human-readable representation of the IP address and its prefix. ``` -------------------------------- ### ifaddr.IP Class Source: https://pythonhosted.org/ifaddr/index.html Represents an IP address associated with a network adapter. ```APIDOC ## class ifaddr.IP(ip, network_prefix, nice_name) ### Description Represents an IP address of an adapter. ### Attributes - **ip** (str or tuple) - IP address. For IPv4 addresses this is a string in “xxx.xxx.xxx.xxx” format. For IPv6 addresses this is a three-tuple (ip, flowinfo, scope_id), where ip is a string in the usual collon separated hex format. - **network_prefix** (int) - Number of bits of the IP that represent the network. For a 255.255.255.0 netmask, this number would be 24. - **nice_name** (str) - Human readable name for this IP. On Linux is this currently the same as the adapter name. On Windows this is the name of the network connection as configured in the system control panel. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.