def getFlags(self, ifname):
        """ Get the flags for an interface
        """
        ifreq = (ifname + '\0'*32)[:32]
        try:
            result = self._fcntl(self.SIOCGIFFLAGS, ifreq)
        except __HOLE__:
            return 0

        # extract the interface's flags from the return value
        flags, = struct.unpack('H', result[16:18])

        # return "UP" bit
        return flags
dataset/ETHPy150Open kdart/pycopia/aid/pycopia/ifconfig.py/IfConfig.getFlags