(self)
return c
Returns a string representing the command you have to type to obtain the same packet
Returns a string representing the command you have to type to obtain the same packet
Returns a string representing the command you have to type to obtain the same packet
def command(self):
        """Returns a string representing the command you have to type to obtain the same packet"""
        f = []
        for fn,fv in self.fields.items():
            fld = self.get_field(fn)
            if isinstance(fv, Packet):
                fv = fv.command()
            elif fld.islist and fld.holds_packets and type(fv) is list:
                fv = "[%s]" % ",".join( map(Packet.command, fv))
            else:
                fv = repr(fv)
            f.append("%s=%s" % (fn, fv))
        c = "%s(%s)" % (self.__class__.__name__, ", ".join(f))
        pc = self.payload.command()
        if pc:
            c += "/"+pc
        return c
def command ( self ) : f = [ ] for fn , fv in self . fields . items ( ) : fld = self . get_field ( fn ) if isinstance ( fv , Packet ) : fv = fv . command ( ) elif fld . islist and fld . holds_packets and type ( fv ) is list : fv = "[%s]" % "," . join ( map ( Packet . command , fv ) ) else : fv = repr ( fv ) f . append ( "%s=%s" % ( fn , fv ) ) c = "%s(%s)" % ( self . __class__ . __name__ , ", " . join ( f ) ) pc = self . payload . command ( ) if pc : c += "/" + pc return c