summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
a4ba3f4)
Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: Ifda8fcb102661e7c585bc5fe3a16113ae629d516
from ipaddress import ip_address
from scapy.contrib.geneve import GENEVE
from scapy.layers.inet import IP, UDP
from ipaddress import ip_address
from scapy.contrib.geneve import GENEVE
from scapy.layers.inet import IP, UDP
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.packet import Raw
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
+ elif rx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
- else:
- # otherwise process the current packet
- break
+ elif tx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
+
+ break
check_ip(
tx_pkt_recv, ip_layer, tx_dst_mac, tx_src_mac, str(dst_ip), str(src_ip)
check_ip(
tx_pkt_recv, ip_layer, tx_dst_mac, tx_src_mac, str(dst_ip), str(src_ip)
from ipaddress import ip_address
from scapy.layers.inet import IP
from ipaddress import ip_address
from scapy.layers.inet import IP
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.ipsec import SecurityAssociation, ESP
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.ipsec import SecurityAssociation, ESP
from scapy.layers.l2 import Ether
from scapy.packet import Raw
if rx_pkt_recv.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
if rx_pkt_recv.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
+ elif rx_pkt_recv.haslayer(ICMPv6MLReport2):
+ # read another packet in the queue if the current one is
+ # ICMPv6MLReport2
+ continue
+ elif rx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
+ elif tx_pkt_recv.haslayer(ICMPv6MLReport2):
+ # read another packet in the queue if the current one is
+ # ICMPv6MLReport2
+ continue
+ elif tx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
from ipaddress import ip_address
from scapy.layers.inet import IP
from ipaddress import ip_address
from scapy.layers.inet import IP
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.ipsec import SecurityAssociation, ESP
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.ipsec import SecurityAssociation, ESP
from scapy.layers.l2 import Ether
from scapy.packet import Raw
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
+ elif rx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
if tx_pkt_recv.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
if tx_pkt_recv.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
- else:
- # otherwise process the current packet
- break
+ elif tx_pkt_recv.haslayer(ICMPv6MLReport2):
+ # read another packet in the queue if the current one is
+ # ICMPv6MLReport2
+ continue
+ elif tx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
+
+ break
check_ipsec(tx_pkt_recv, ip_layer, src_tun, dst_ip, src_ip, sa_in)
check_ipsec(tx_pkt_recv, ip_layer, src_tun, dst_ip, src_ip, sa_in)
from scapy.fields import FlagsField, BitField, IntField
from scapy.layers.inet import ICMP, IP, UDP
from scapy.layers.inet6 import ICMPv6EchoRequest
from scapy.fields import FlagsField, BitField, IntField
from scapy.layers.inet import ICMP, IP, UDP
from scapy.layers.inet6 import ICMPv6EchoRequest
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.packet import Raw
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
+ elif ether.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
import ipaddress
from scapy.layers.inet import IP, TCP, UDP
import ipaddress
from scapy.layers.inet import IP, TCP, UDP
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.packet import Raw
if ether.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
if ether.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
- else:
- # otherwise process the current packet
- break
+ elif ether.haslayer(ICMPv6MLReport2):
+ # read another packet in the queue if the current one is
+ # ICMPv6MLReport2
+ continue
+ elif ether.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
+
+ break
if rx_dst_mac != ether[Ether].dst or rx_src_mac != ether[Ether].src:
raise RuntimeError(f"Matching packet unsuccessful: {ether!r}")
if rx_dst_mac != ether[Ether].dst or rx_src_mac != ether[Ether].src:
raise RuntimeError(f"Matching packet unsuccessful: {ether!r}")
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
- else:
- # otherwise process the current packet
- break
+ elif ether.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
+
+ break
if ether[Ether].dst != tx_src_mac or ether[Ether].src != tx_dst_mac:
raise RuntimeError(f"Matching packet unsuccessful: {ether!r}")
if ether[Ether].dst != tx_src_mac or ether[Ether].src != tx_dst_mac:
raise RuntimeError(f"Matching packet unsuccessful: {ether!r}")
from ipaddress import ip_address
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, TCP
from ipaddress import ip_address
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, TCP
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.packet import Raw
from .TrafficScriptArg import TrafficScriptArg
from scapy.packet import Raw
from .TrafficScriptArg import TrafficScriptArg
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
+ elif pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
from scapy.layers.inet import ICMP, IP
from scapy.layers.inet6 import ICMPv6EchoRequest, ICMPv6EchoReply,\
from scapy.layers.inet import ICMP, IP
from scapy.layers.inet6 import ICMPv6EchoRequest, ICMPv6EchoReply,\
- ICMPv6ND_NS, ICMPv6MLReport2
+ ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.packet import Raw
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
- else:
- # otherwise process the current packet
- break
+ elif icmp_reply.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
+
+ break
if icmp_reply[ip_layer][icmp_resp].type == icmp_type:
if icmp_reply[ip_layer].src == dst_ip and \
if icmp_reply[ip_layer][icmp_resp].type == icmp_type:
if icmp_reply[ip_layer].src == dst_ip and \
from robot.api import logger
from scapy.layers.inet import IP
from robot.api import logger
from scapy.layers.inet import IP
-from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2
+from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.l2 import Ether, Dot1Q
from scapy.packet import Raw
from scapy.layers.l2 import Ether, Dot1Q
from scapy.packet import Raw
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
- else:
- # otherwise process the current packet
- break
+ elif ether.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
+
+ break
if rx_dst_mac == ether[Ether].dst and rx_src_mac == ether[Ether].src:
logger.trace(u"MAC matched")
if rx_dst_mac == ether[Ether].dst and rx_src_mac == ether[Ether].src:
logger.trace(u"MAC matched")
import sys
from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, IPv6ExtHdrSegmentRouting,\
import sys
from scapy.layers.inet6 import IPv6, ICMPv6ND_NS, IPv6ExtHdrSegmentRouting,\
- ipv6nh, ICMPv6MLReport2
+ ipv6nh, ICMPv6MLReport2, ICMPv6ND_RA
from scapy.layers.l2 import Ether
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.packet import Raw
if rx_pkt_recv.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
if rx_pkt_recv.haslayer(ICMPv6ND_NS):
# read another packet in the queue if the current one is ICMPv6ND_NS
continue
+ elif rx_pkt_recv.haslayer(ICMPv6MLReport2):
+ # read another packet in the queue if the current one is
+ # ICMPv6MLReport2
+ continue
+ elif rx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
# read another packet in the queue if the current one is
# ICMPv6MLReport2
continue
+ elif tx_pkt_recv.haslayer(ICMPv6ND_RA):
+ # read another packet in the queue if the current one is
+ # ICMPv6ND_RA
+ continue
# otherwise process the current packet
break
# otherwise process the current packet
break