aboutsummaryrefslogtreecommitdiffstats
path: root/resources/traffic_scripts/lisp
diff options
context:
space:
mode:
authorNidhy <nidhyanandhan.a@hcl.com>2019-08-31 12:53:12 +0000
committerPeter Mikus <pmikus@cisco.com>2019-09-19 13:38:58 +0000
commitaafa2efa63b891e85ff13255691aae4909bc503c (patch)
tree9ea9e6d57a25148009a84661fff7a0e30907c529 /resources/traffic_scripts/lisp
parenta295b175cd410e63829a71eb4565f4bc0f6965a4 (diff)
LISP: 3-node (func) to 2-node (dev) converstion
Change-Id: I0fbe4d9ef1b30a1ac1382ea43b5b52aeb8a7d39f Signed-off-by: Nidhy <nidhyanandhan.a@hcl.com>
Diffstat (limited to 'resources/traffic_scripts/lisp')
-rwxr-xr-xresources/traffic_scripts/lisp/lisp_check.py18
-rwxr-xr-xresources/traffic_scripts/lisp/lispgpe_check.py18
2 files changed, 28 insertions, 8 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:
diff --git a/resources/traffic_scripts/lisp/lispgpe_check.py b/resources/traffic_scripts/lisp/lispgpe_check.py
index 7979b6ced9..d4de8635d7 100755
--- a/resources/traffic_scripts/lisp/lispgpe_check.py
+++ b/resources/traffic_scripts/lisp/lispgpe_check.py
@@ -96,7 +96,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')
@@ -108,6 +109,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)
@@ -146,9 +148,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, IPv6):
+ 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(LispGPEHeader).underlayer
if not lisp: