def all_indexes():
mapping = dict()<EOL>sk = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)<EOL>for if_name in os.listdir('<STR_LIT>'):<EOL><INDENT>info = struct.unpack('<STR_LIT>', fcntl.ioctl(sk.fileno(), <NUM_LIT>, struct.pack('<STR_LIT>', if_name.encode('<STR_LIT:ascii>'), <NUM_LIT:0>)))<EOL>mapping[int(info[<NUM_LIT:1>])] = if_name<EOL><DEDENT>sk.close()<EOL>return mapping<EOL>
Return dictionary of network interface names (values) and their indexes (keys).