(self, indent=3, lvl="", label_lvl="")
Prints a hierarchical view of the packet. "indent" gives the size of indentation for each layer.
Prints a hierarchical view of the packet. "indent" gives the size of indentation for each layer.
Prints a hierarchical view of the packet . indent gives the size of indentation for each layer .
def show(self, indent=3, lvl="", label_lvl=""):
        """Prints a hierarchical view of the packet. "indent" gives the size of indentation for each layer."""
        ct = conf.color_theme
        print "%s%s %s %s" % (label_lvl,
                              ct.punct("###["),
                              ct.layer_name(self.name),
                              ct.punct("]###"))
        for f in self.fields_desc:
            if isinstance(f, ConditionalField) and not f._evalcond(self):
                continue
            if isinstance(f, Emph) or f in conf.emph:
                ncol = ct.emph_field_name
                vcol = ct.emph_field_value
            else:
                ncol = ct.field_name
                vcol = ct.field_value
            fvalue = self.getfieldval(f.name)
            if isinstance(fvalue, Packet) or (f.islist and f.holds_packets and type(fvalue) is list):
                print "%s  \\%-10s\\" % (label_lvl+lvl, ncol(f.name))
                fvalue_gen = SetGen(fvalue,_iterpacket=0)
                for fvalue in fvalue_gen:
                    fvalue.show(indent=indent, label_lvl=label_lvl+lvl+"   |")
            else:
                print "%s  %-10s%s %s" % (label_lvl+lvl,
                                          ncol(f.name),
                                          ct.punct("="),
                                          vcol(f.i2repr(self,fvalue)))
        self.payload.show(indent=indent, lvl=lvl+(" "*indent*self.show_indent), label_lvl=label_lvl)
def show ( self , indent = 3 , lvl = "" , label_lvl = "" ) : ct = conf . color_theme print "%s%s %s %s" % ( label_lvl , ct . punct ( "###[" ) , ct . layer_name ( self . name ) , ct . punct ( "]###" ) ) for f in self . fields_desc : if isinstance ( f , ConditionalField ) and not f . _evalcond ( self ) : continue if isinstance ( f , Emph ) or f in conf . emph : ncol = ct . emph_field_name vcol = ct . emph_field_value else : ncol = ct . field_name vcol = ct . field_value fvalue = self . getfieldval ( f . name ) if isinstance ( fvalue , Packet ) or ( f . islist and f . holds_packets and type ( fvalue ) is list ) : print "%s  \\%-10s\\" % ( label_lvl + lvl , ncol ( f . name ) ) fvalue_gen = SetGen ( fvalue , _iterpacket = 0 ) for fvalue in fvalue_gen : fvalue . show ( indent = indent , label_lvl = label_lvl + lvl + "   |" ) else : print "%s  %-10s%s %s" % ( label_lvl + lvl , ncol ( f . name ) , ct . punct ( "=" ) , vcol ( f . i2repr ( self , fvalue ) ) ) self . payload . show ( indent = indent , lvl = lvl + ( " " * indent * self . show_indent ) , label_lvl = label_lvl )