def adapters():
 ans = []
 smap = {1: u'up', 2: u'down', 3: u'testing', 4: u'unknown', 5: u'dormant', 6: u'not-present', 7: u'lower-layer-down'}
 with _get_adapters() as p_adapters_list:
  adapter = p_adapters_list
  while adapter:
   adapter = adapter.contents
   if (not adapter):
    break
   ans.append(Adapter(name=adapter.AdapterName.decode(), if_index=adapter.Union1.Struct1.IfIndex, if_index6=adapter.Ipv6IfIndex, friendly_name=adapter.FriendlyName, status=smap.get(adapter.OperStatus, u'unknown'), transmit_speed=adapter.TransmitLinkSpeed, receive_speed=adapter.ReceiveLinkSpeed))
   adapter = ctypes.cast(adapter.Next, ctypes.POINTER(IP_ADAPTER_ADDRESSES))
 return ans

def adapters ( ) : ans = [ ] smap = { 1 : u'up' , 2 : u'down' , 3 : u'testing' , 4 : u'unknown' , 5 : u'dormant' , 6 : u'not-present' , 7 : u'lower-layer-down' } with _get_adapters ( ) as p_adapters_list : adapter = p_adapters_list while adapter : adapter = adapter . contents if ( not adapter ) : break ans . append ( Adapter ( name = adapter . AdapterName . decode ( ) , if_index = adapter . Union1 . Struct1 . IfIndex , if_index6 = adapter . Ipv6IfIndex , friendly_name = adapter . FriendlyName , status = smap . get ( adapter . OperStatus , u'unknown' ) , transmit_speed = adapter . TransmitLinkSpeed , receive_speed = adapter . ReceiveLinkSpeed ) ) adapter = ctypes . cast ( adapter . Next , ctypes . POINTER ( IP_ADAPTER_ADDRESSES ) ) return ans
a list of adapters on this machine .