def get_if(iff, cmd):
 sck = socket.socket()
 ifreq = ioctl(sck, cmd, struct.pack('16s16x', iff))
 sck.close()
 return ifreq

def get_if ( iff , cmd ) : sck = socket . socket ( ) ifreq = ioctl ( sck , cmd , struct . pack ( '16s16x' , iff ) ) sck . close ( ) return ifreq
ease siocgif* ioctl calls .