(self)
Not ready yet. Should give the necessary C code that interfaces with libnet to recreate the packet
Not ready yet. Should give the necessary C code that interfaces with libnet to recreate the packet
Not ready yet . Should give the necessary C code that interfaces with libnet to recreate the packet
def libnet(self):
        """Not ready yet. Should give the necessary C code that interfaces with libnet to recreate the packet"""
        print "libnet_build_%s(" % self.__class__.name.lower()
        det = self.__class__(str(self))
        for f in self.fields_desc:
            val = det.getfieldval(f.name)
            if val is None:
                val = 0
            elif type(val) is int:
                val = str(val)
            else:
                val = '"%s"' % str(val)
            print "\t%s, \t\t/* %s */" % (val,f.name)
        print ");"
def libnet ( self ) : print "libnet_build_%s(" % self . __class__ . name . lower ( ) det = self . __class__ ( str ( self ) ) for f in self . fields_desc : val = det . getfieldval ( f . name ) if val is None : val = 0 elif type ( val ) is int : val = str ( val ) else : val = '"%s"' % str ( val ) print "\t%s, \t\t/* %s */" % ( val , f . name ) print ");"