def get_index(self):
ifreq = struct.pack('<STR_LIT>', self.name, <NUM_LIT:0>)<EOL>res = fcntl.ioctl(sockfd, SIOCGIFINDEX, ifreq)<EOL>return struct.unpack("<STR_LIT>", res)[<NUM_LIT:1>]<EOL>
Convert an interface name to an index value.