makes the fragment tests work on FreeBSD. From Ilya Bakulin.
exit(2)
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Packet too big':
mtu=a.payload.payload.mtu
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
a.payload.frag == 0 and a.payload.flags == 0 and \
icmptypes[a.payload.payload.type] == 'echo-reply':
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
print "no reply"
exit(0)
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
print "no reply"
exit(0)
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
print "no reply"
exit(0)
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
print "no reply"
exit(0)
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+dstaddr+" and dst "+SRC_OUT6+" and icmp6")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
a.payload.frag == 0 and a.payload.flags == 0 and \
icmptypes[a.payload.payload.type] == 'echo-reply':
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
a.payload.frag == 0 and a.payload.flags == 0 and \
icmptypes[a.payload.payload.type] == 'echo-reply':
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
a.payload.frag == 0 and a.payload.flags == 0 and \
icmptypes[a.payload.payload.type] == 'echo-reply':
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip and src "+dstaddr+" and dst "+SRC_OUT+" and icmp")
a=ans[0]
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
a.payload.frag == 0 and a.payload.flags == 0 and \
icmptypes[a.payload.payload.type] == 'echo-reply':
echocksum=IPv6(str(p.payload)).payload.cksum
print "echocksum=%#04x" % (echocksum)
a=srp1(p, iface=SRC_IF, timeout=2)
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Packet too big':
outercksum=a.payload.payload.cksum
payload="a" * 1452
a=srp1(Ether(src=SRC_MAC, dst=PF_MAC)/IPv6(src=SRC_OUT6, dst=dstaddr)/
ICMPv6EchoRequest(id=pid, data=payload), iface=SRC_IF, timeout=2)
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Packet too big':
mtu=a.payload.payload.mtu
echocksum=IP(str(p.payload)).payload.chksum
print "echocksum=%#04x" % (echocksum)
a=srp1(p, iface=SRC_IF, timeout=2)
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
icmptypes[a.payload.payload.type] == 'dest-unreach' and \
icmpcodes[a.payload.payload.type][a.payload.payload.code] == \
udpcksum=IPv6(str(p.payload)).payload.chksum
print "udpcksum=%#04x" % (udpcksum)
a=srp1(p, iface=SRC_IF, timeout=2)
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Packet too big':
outercksum=a.payload.payload.cksum
udpcksum=IP(str(p.payload)).payload.chksum
print "udpcksum=%#04x" % (udpcksum)
a=srp1(p, iface=SRC_IF, timeout=2)
-if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv4 and \
+if a and a.type == ETH_P_IP and \
a.payload.proto == 1 and \
icmptypes[a.payload.payload.type] == 'dest-unreach' and \
icmpcodes[a.payload.payload.type][a.payload.payload.code] == \
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and proto ipv6-frag")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'Fragment Header' and \
a.payload.payload.offset == 0 and \
ipv6nh[a.payload.payload.nh] == 'ICMPv6' and \
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=90, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and udp")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'UDP' and \
a.payload.payload.sport == 7:
port=a.payload.payload.dport
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and udp")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'UDP' and \
a.payload.payload.sport == 7:
port=a.payload.payload.dport
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and udp")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'UDP' and \
a.payload.payload.sport == 7:
port=a.payload.payload.dport
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
id=a.payload.payload.id
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Neighbor Advertisement':
tgt=a.payload.payload.tgt
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+lla(DST_MAC)+" and dst ff02::1 and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Neighbor Advertisement':
tgt=a.payload.payload.tgt
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and src "+DST_IN6+" and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Neighbor Advertisement':
tgt=a.payload.payload.tgt
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Parameter problem':
pprob=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Parameter problem':
pprob=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
reply=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
reply=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
reply=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Parameter problem':
pprob=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Echo Reply':
reply=a.payload.payload
ans=sniff(iface=SRC_IF, timeout=3, filter=
"ip6 and dst "+SRC_OUT6+" and icmp6")
for a in ans:
- if a and a.type == scapy.layers.dot11.ETHER_TYPES.IPv6 and \
+ if a and a.type == ETH_P_IPV6 and \
ipv6nh[a.payload.nh] == 'ICMPv6' and \
icmp6types[a.payload.payload.type] == 'Parameter problem':
pprob=a.payload.payload