parameters: ()
return_statement: return None
docstring: Get the hardware address on Unix by running arp.
docstring_summary: Get the hardware address on Unix by running arp.
docstring_tokens: Get the hardware address on Unix by running arp .
function: def _arp_getnode():
      """Get the hardware address on Unix by running arp."""
      import os, socket
      try:
          ip_addr = socket.gethostbyname(socket.gethostname())
      except OSError:
          return None
  
      # Try getting the MAC addr from arp based on our IP address (Solaris).
      mac = _find_mac('arp', '-an', [os.fsencode(ip_addr)], lambda i: -1)
      if mac:
          return mac
  
      # This works on OpenBSD
      mac = _find_mac('arp', '-an', [os.fsencode(ip_addr)], lambda i: i+1)
      if mac:
          return mac
  
      # This works on Linux, FreeBSD and NetBSD
      mac = _find_mac('arp', '-an', [os.fsencode('(%s)' % ip_addr)],
                      lambda i: i+2)
      # Return None instead of 0.
      if mac:
          return mac
      return None
function_tokens: def _arp_getnode ( ) : import os , socket try : ip_addr = socket . gethostbyname ( socket . gethostname ( ) ) except OSError : return None # Try getting the MAC addr from arp based on our IP address (Solaris). mac = _find_mac ( 'arp' , '-an' , [ os . fsencode ( ip_addr ) ] , lambda i : - 1 ) if mac : return mac # This works on OpenBSD mac = _find_mac ( 'arp' , '-an' , [ os . fsencode ( ip_addr ) ] , lambda i : i + 1 ) if mac : return mac # This works on Linux, FreeBSD and NetBSD mac = _find_mac ( 'arp' , '-an' , [ os . fsencode ( '(%s)' % ip_addr ) ] , lambda i : i + 2 ) # Return None instead of 0. if mac : return mac return None