Logo Search packages:      
Sourcecode: scapy version File versions  Download package

def scapy::PcapWriter::write (   self,
  pkt 
)

accepts a either a single packet or a list of packets
to be written to the dumpfile

Definition at line 8067 of file scapy.py.

08067                         :
        """accepts a either a single packet or a list of packets
        to be written to the dumpfile
        """
        
        if self.header_done == 0:
            if self.linktype == None:
                if isinstance(pkt,Packet):
                    print "x",pkt.__class__
                    linktype = LLNumTypes.get(pkt.__class__,1)
                else:
                    print "xx",pkt[0].__class__
                    linktype = LLNumTypes.get(pkt[0].__class__,1)

            print linktype
            self.f.write(struct.pack("IHHIIII", 0xa1b2c3d4L,
                                     2, 4, 0, 0, MTU, linktype))
            self.header_done = 1

        print "yo"
        for p in pkt:
            self.write_packet(p)

    def write_packet(self, packet):


Generated by  Doxygen 1.6.0   Back to index