gre: Tunnel encap/decap flags
Type: feature
common funcitons across IP-in-IP and GRE tunnels for encap/decap
functions
Signed-off-by: Neale Ranns <nranns@cisco.com>
Change-Id: I325b66824878d843af167adfe5a7a96b0ab90566
diff --git a/test/vpp_gre_interface.py b/test/vpp_gre_interface.py
index 9a9069a..770292e 100644
--- a/test/vpp_gre_interface.py
+++ b/test/vpp_gre_interface.py
@@ -10,7 +10,7 @@
"""
def __init__(self, test, src_ip, dst_ip, outer_table_id=0,
- type=None, mode=None,
+ type=None, mode=None, flags=0,
session=0):
""" Create VPP GRE interface """
super(VppGreInterface, self).__init__(test)
@@ -18,6 +18,7 @@
self.t_dst = dst_ip
self.t_outer_table = outer_table_id
self.t_session = session
+ self.t_flags = flags
self.t_type = type
if not self.t_type:
self.t_type = (VppEnum.vl_api_gre_tunnel_type_t.
@@ -29,12 +30,16 @@
def add_vpp_config(self):
r = self.test.vapi.gre_tunnel_add_del(
- self.t_src,
- self.t_dst,
- outer_table_id=self.t_outer_table,
- type=self.t_type,
- mode=self.t_mode,
- session_id=self.t_session)
+ is_add=1,
+ tunnel={
+ 'src': self.t_src,
+ 'dst': self.t_dst,
+ 'outer_table_id': self.t_outer_table,
+ 'instance': 0xffffffff,
+ 'type': self.t_type,
+ 'mode': self.t_mode,
+ 'flags': self.t_flags,
+ 'session_id': self.t_session})
self.set_sw_if_index(r.sw_if_index)
self.generate_remote_hosts()
self.test.registry.register(self, self.test.logger)
@@ -42,13 +47,17 @@
def remove_vpp_config(self):
self.unconfig()
- self.test.vapi.gre_tunnel_add_del(self.t_src,
- self.t_dst,
- outer_table_id=self.t_outer_table,
- type=self.t_type,
- mode=self.t_mode,
- session_id=self.t_session,
- is_add=0)
+ self.test.vapi.gre_tunnel_add_del(
+ is_add=0,
+ tunnel={
+ 'src': self.t_src,
+ 'dst': self.t_dst,
+ 'outer_table_id': self.t_outer_table,
+ 'instance': 0xffffffff,
+ 'type': self.t_type,
+ 'mode': self.t_mode,
+ 'flags': self.t_flags,
+ 'session_id': self.t_session})
def object_id(self):
return "gre-%d" % self.sw_if_index