(self, cls)
return self.payload.haslayer(cls)
true if self has a layer that is an instance of cls. Superseded by "cls in self" syntax.
true if self has a layer that is an instance of cls. Superseded by "cls in self" syntax.
true if self has a layer that is an instance of cls . Superseded by cls in self syntax .
def haslayer(self, cls):
        """true if self has a layer that is an instance of cls. Superseded by "cls in self" syntax."""
        if self.__class__ == cls or self.__class__.__name__ == cls:
            return 1
        for f in self.packetfields:
            fvalue_gen = self.getfieldval(f.name)
            if fvalue_gen is None:
                continue
            if not f.islist:
                fvalue_gen = SetGen(fvalue_gen,_iterpacket=0)
            for fvalue in fvalue_gen:
                if isinstance(fvalue, Packet):
                    ret = fvalue.haslayer(cls)
                    if ret:
                        return ret
        return self.payload.haslayer(cls)
def haslayer ( self , cls ) : if self . __class__ == cls or self . __class__ . __name__ == cls : return 1 for f in self . packetfields : fvalue_gen = self . getfieldval ( f . name ) if fvalue_gen is None : continue if not f . islist : fvalue_gen = SetGen ( fvalue_gen , _iterpacket = 0 ) for fvalue in fvalue_gen : if isinstance ( fvalue , Packet ) : ret = fvalue . haslayer ( cls ) if ret : return ret return self . payload . haslayer ( cls )