"""
import sys
-import ipaddress
from scapy.all import bind_layers, Packet
from scapy.fields import FlagsField, BitField, XBitField, IntField
from ..PacketVerifier import RxQueue, TxQueue
from ..TrafficScriptArg import TrafficScriptArg
+from ..ValidIp import valid_ipv4, valid_ipv6
class LispGPEHeader(Packet):
"""
-def valid_ipv4(ip):
- try:
- ipaddress.IPv4Address(ip)
- return True
- except (AttributeError, ipaddress.AddressValueError):
- return False
-
-
-def valid_ipv6(ip):
- try:
- ipaddress.IPv6Address(ip)
- return True
- except (AttributeError, ipaddress.AddressValueError):
- return False
-
-
def main():
"""Send IP ICMP packet from one traffic generator interface to the other.
if not isinstance(ip, IPv6):
raise RuntimeError(f"Not an IP packet received {ip!r}")
elif not isinstance(ip, ip_format):
- raise RuntimeError(f"Not an IP packet received {ip!r}")
+ raise RuntimeError(f"Not an IP packet received {ip!r}")
lisp = ether.getlayer(LispGPEHeader).underlayer
if not lisp: