def is_up(self):
<EOL>ifreq = struct.pack('<STR_LIT>', self.name, <NUM_LIT:0>)<EOL>flags = struct.unpack('<STR_LIT>', fcntl.ioctl(sockfd, SIOCGIFFLAGS, ifreq))[<NUM_LIT:1>]<EOL>if flags & IFF_UP:<EOL><INDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>
Return True if the interface is up, False otherwise.