我的包:IPOptions在scapy3.0.0和python3.5抛出错误
a=IP(src="30.1.1.2",dst="20.1.1.2",options=IPOption('\x83\x07\x04\x00\x00\x00\x00\x00'),)
我收到错误:
a=bytes(IP(src="30.1.1.2",dst="20.1.1.2",options=IPOption('\x83\x07\x04\x00\x00\x00\x00\x00'),))
Traceback (most recent call last):
File "/usr/lib/python3.4/code.py", line 90, in runcode exec(code, self.locals)
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/scapy/base_classes.py", line 197, in call
cls = cls.dispatch_hook(*args, **kargs)
File "/usr/local/lib/python3.4/dist-packages/scapy/layers/inet.py", line 161, in dispatch_hook
opt = pkt[0] & 0x1f
TypeError: unsupported operand type(s) for &: 'str' and 'int' –
错误>>> a = bytes(IP(src =“30.1.1.2”,dst =“20.1.1.2”,options = IPOption('\ x83 \ x07 \ x04 \ x00 \ x00 \ x00 \ x00 \ x00'))) Traceback (最新最后调用): 文件 “/usr/lib/python3.4/code.py”,行90,在runcode EXEC(代码self.locals) 文件 “”,1号线,在 文件“/usr/local/lib/python3.4/dist-packages/scapy/base_classes.py”,第197行,在__call__中 cls = cls.dispatch_hook(* args,** kargs) 文件“/ usr/local /lib/python3.4/dist-packages/scapy/layers/inet.py“,第161行,在dispatch_hook中 opt = pkt [0]&0x1f TypeError:不支持的操作数类型为&:'str'和'int' –
Muralidhar