privex.helpers.net

Network related helper code

Copyright:

    +===================================================+
    |                 © 2020 Privex Inc.                |
    |               https://www.privex.io               |
    +===================================================+
    |                                                   |
    |        Originally Developed by Privex Inc.        |
    |        License: X11 / MIT                         |
    |                                                   |
    |        Core Developer(s):                         |
    |                                                   |
    |          (+)  Chris (@someguy123) [Privex]        |
    |          (+)  Kale (@kryogenic) [Privex]          |
    |                                                   |
    +===================================================+

Copyright 2019     Privex Inc.   ( https://www.privex.io )

Functions

asn_to_name(as_number[, quiet])

Look up an integer Autonomous System Number and return the human readable name of the organization.

check_host(host, port[, version, throw])

Test if the service on port port for host host is working.

check_host_async(host, port[, version, throw])

AsyncIO version of check_host().

get_rdns(host[, throw])

Look up the reverse DNS hostname for host and return it as a string.

get_rdns_async(host[, throw, version, name_port])

AsyncIO version of get_rdns() - get the reverse DNS for a given host (IP address or domain)

get_rdns_multi(*hosts[, throw])

Resolve reverse DNS hostnames for multiple IPs / domains specified as positional arguments.

resolve_ip(addr[, version, v4_convert])

Wrapper for resolve_ips() - passes args to resolve_ips() and returns the first item from the results.

resolve_ip_async(addr[, version, v4_convert])

AsyncIO version of resolve_ip() - resolves the IPv4/v6 address for a given host (addr)

resolve_ips(addr[, version, v4_convert])

With just a single hostname argument, both IPv4 and IPv6 addresses will be returned as strings.

resolve_ips_async(addr[, version, v4_convert])

AsyncIO version of resolve_ips_async() - resolves the IPv4/v6 addresses for a given host (addr)

resolve_ips_multi(*addr[, version, v4_convert])

Resolve IPv4/v6 addresses for multiple hosts specified as positional arguments.

resolve_ips_multi_async(*addr[, version, …])

Async version of resolve_ips_multi().

ip4_to_rdns(ip_obj[, v4_boundary, boundary])

Internal function for getting the rDNS domain for a given v4 address.

ip6_to_rdns(ip_obj[, v6_boundary, boundary])

Internal function for getting the rDNS domain for a given v6 address.

ip_is_v4(ip)

Determines whether an IP address is IPv4 or not

ip_is_v6(ip)

Determines whether an IP address is IPv6 or not

ip_to_rdns(ip[, boundary, v6_boundary, …])

Converts an IPv4 or IPv6 address into an in-addr domain

ping(ip[, timeout])

Sends a ping to a given IPv4 / IPv6 address.