示例#1
0
    def parse_payload(self, payload):
        try:
            packet = Packet.parse(payload)
        except:
            print('Unable to parse packet')
            return

        self.print_packet(packet)
示例#2
0
文件: client.py 项目: shakefu/dnstk
    def parse_payload(self, payload):
        try:
            packet = Packet.parse(payload)
        except:
            print('Unable to parse packet')
            return

        self.print_packet(packet)
示例#3
0
 def test_packet(self):
     payload = b'l\x96\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x04test\x03com\x00\x00\x01\x00\x01'
     packet = Packet.parse(payload)
     self.assertEqual(packet.__bytes__(), payload)
示例#4
0
 def test_packet(self):
     payload = b'l\x96\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\x04test\x03com\x00\x00\x01\x00\x01'
     packet = Packet.parse(payload)
     self.assertEqual(packet.__bytes__(), payload)