constant description ni_nofqdn ni_numerichost ni_namereqd don' use fully qualified name for local hosts returns the address in numeric form requires host name returns an error if address has no dns entry the returned port is returned as string containing port number specifies that the service being looked up is datagram service (udpinstead of tcp (the defaultni_numericserv ni_dgram the main purpose of this function is to get additional information about an address here' an examplegetnameinfo(( ', ), ('fang python org''http'getnameinfo(( ', ),ni_numericserv('fang python org',' 'getprotobyname(protocolnametranslates an internet protocol name (such as 'icmp'to protocol number (such as the value of ipproto_icmpthat can be passed to the third argument of the socket(function raises socket error if the protocol name isn' recognized normallythis is only used with raw sockets getservbyname(servicename [protocolname]translates an internet service name and protocol name to port number for that service for examplegetservbyname('ftp''tcp'returns the protocol nameif suppliedshould be 'tcpor 'udpraises socket error if servicename doesn' match any known service getservbyport(port [protocolname]this is the opposite of getservbyname(given numeric port numberportthis function returns string giving the service nameif any for examplegetservbyport( 'tcp'returns 'ftpthe protocol nameif suppliedshould be 'tcpor 'udpraises socket error if no service name is available for port has_ipv boolean constant that is true if ipv support is available htonl(xconverts -bit integers from host to network byte order (big-endianhtons(xconverts -bit integers from host to network byte order (big-endianinet_aton(ip_stringconverts an ipv address provided as string (for example 'to -bit packed binary format for use as the raw-encoding of the address the returned lib fl ff