How to use the dpkt.Packet.unpack function in dpkt

To help you get started, we’ve selected a few dpkt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WPO-Foundation / webpagetest / www / mobile / dpkt-1.7 / dpkt / netflow.py View on Github external
def unpack(self, buf):
        dpkt.Packet.unpack(self, buf)
        buf = self.data
        l = []
        while buf:
            flow = self.NetflowRecord(buf)
            l.append(flow)
            buf = buf[len(flow):]
        self.data = l
github DataSoft / Honeyd / dpkt / dpkt / icmp6.py View on Github external
def unpack(self, buf):
        Packet.unpack(self, buf)
        try:
            self.data = self._typesw[self.type](self.data)
            setattr(self, self.data.__class__.__name__.lower(), self.data)
        except:
            self.data = buf
github cisco-system-traffic-generator / trex-core / scripts / external_libs / dpkt-1.8.6.2 / dpkt / vrrp.py View on Github external
def unpack(self, buf):
        dpkt.Packet.unpack(self, buf)
        l = []
        off = 0
        for off in range(0, 4 * self.count, 4):
            l.append(self.data[off:off + 4])
        self.addrs = l
        self.auth = self.data[off + 4:]
        self.data = ''
github Who8MyLunch / Ping_Sweep / ping_sweep / dpkt / icmp.py View on Github external
def unpack(self, buf):
            dpkt.Packet.unpack(self, buf)
            self.data = self.ip = ip.IP(self.data)
    class Unreach(Quote):
github Who8MyLunch / Ping_Sweep / ping_sweep / dpkt / radiotap.py View on Github external
def unpack(self, buf):
        dpkt.Packet.unpack(self, buf)
        self.data = buf[self.length:]
        
        self.fields = []
        buf = buf[self.__hdr_len__:]

        # decode each field into self. (eg. self.tsft) as well as append it self.fields list
        field_decoder = [
            ('tsft', self.tsft_present, self.TSFT),
            ('flags', self.flags_present, self.Flags),
            ('rate', self.rate_present, self.Rate),
            ('channel', self.channel_present, self.Channel),
            ('fhss', self.fhss_present, self.FHSS),
            ('ant_sig', self.ant_sig_present, self.AntennaSignal),
            ('ant_noise', self.ant_noise_present, self.AntennaNoise),
            ('lock_qual', self.lock_qual_present, self.LockQuality),
            ('tx_attn', self.tx_attn_present, self.TxAttenuation),
github DataSoft / Honeyd / dpkt / dpkt / rpc.py View on Github external
def unpack(self, buf):
            Packet.unpack(self, buf)
            self.cred = RPC.Auth(self.data)
            self.verf = RPC.Auth(self.data[len(self.cred):])
            self.data = self.data[len(self.cred) + len(self.verf):]
github Who8MyLunch / Ping_Sweep / ping_sweep / dpkt / ssl.py View on Github external
def unpack(self, buf):
        dpkt.Packet.unpack(self, buf)
        if self.len & 0x8000:
            n = self.len = self.len & 0x7FFF
            self.msg, self.data = self.data[:n], self.data[n:]
        else:
            n = self.len = self.len & 0x3FFF
            padlen = ord(self.data[0])
            self.msg = self.data[1:1+n]
            self.pad = self.data[1+n:1+n+padlen]
            self.data = self.data[1+n+padlen:]
github DataSoft / Honeyd / dpkt / dpkt / vrrp.py View on Github external
def unpack(self, buf):
        Packet.unpack(self, buf)
        l = []
        for off in range(0, 4 * self.count, 4):
            l.append(self.data[off:off+4])
        self.addrs = l
        self.auth = self.data[off+4:]
        self.data = ''
github kbandla / dpkt / dpkt / cdp.py View on Github external
def unpack(self, buf):
        dpkt.Packet.unpack(self, buf)
        buf = self.data
        l = []
        while buf:
            tlv = self.TLV(buf)
            l.append(tlv)
            buf = buf[len(tlv):]
        self.data = l