diff options
Diffstat (limited to 'resources/traffic_scripts/lisp/lisp_check.py')
-rwxr-xr-x | resources/traffic_scripts/lisp/lisp_check.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/resources/traffic_scripts/lisp/lisp_check.py b/resources/traffic_scripts/lisp/lisp_check.py index 5e1a835b74..9937de8077 100755 --- a/resources/traffic_scripts/lisp/lisp_check.py +++ b/resources/traffic_scripts/lisp/lisp_check.py @@ -72,7 +72,8 @@ def main(): args = TrafficScriptArg( ['tg_src_mac', 'tg_dst_mac', 'src_ip', 'dst_ip', 'dut_if1_mac', - 'dut_if2_mac', 'src_rloc', 'dst_rloc']) + 'dut_if2_mac', 'src_rloc', 'dst_rloc'], + ['ot_mode']) tx_src_mac = args.get_arg('tg_src_mac') tx_dst_mac = args.get_arg('dut_if1_mac') @@ -84,6 +85,7 @@ def main(): dst_rloc = args.get_arg("dst_rloc") tx_if = args.get_arg('tx_if') rx_if = args.get_arg('rx_if') + ot_mode = args.get_arg('ot_mode') rxq = RxQueue(rx_if) txq = TxQueue(tx_if) @@ -124,9 +126,17 @@ def main(): ip = ether.payload - if not isinstance(ip, ip_format): - raise RuntimeError( - "Not an IP packet received {0}".format(ip.__repr__())) + if ot_mode == '6to4': + if not isinstance(ip, IP): + raise RuntimeError( + "Not an IP packet received {0}".format(ip.__repr__())) + elif ot_mode == '4to6': + if not isinstance(ip, IP6): + raise RuntimeError( + "Not an IP packet received {0}".format(ip.__repr__())) + elif not isinstance(ip, ip_format): + raise RuntimeError( + "Not an IP packet received {0}".format(ip.__repr__())) lisp = ether.getlayer(lisp_layer) if not lisp: |