MCPcopy Create free account
hub / github.com/FDio/vpp / VppGreInterface

Class VppGreInterface

test/vpp_gre_interface.py:5–109  ·  view source on GitHub ↗

VPP GRE interface

Source from the content-addressed store, hash-verified

3
4
5class VppGreInterface(VppInterface):
6 """
7 VPP GRE interface
8 """
9
10 def __init__(
11 self,
12 test,
13 src_ip,
14 dst_ip,
15 outer_table_id=0,
16 type=None,
17 mode=None,
18 flags=0,
19 session=0,
20 gre_key=0,
21 ):
22 """Create VPP GRE interface"""
23 super(VppGreInterface, self).__init__(test)
24 self.t_src = src_ip
25 self.t_dst = dst_ip
26 self.t_outer_table = outer_table_id
27 self.t_session = session
28 self.t_gre_key = gre_key # Added GRE key field
29 self.t_flags = flags
30 self.t_type = type
31 if not self.t_type:
32 self.t_type = VppEnum.vl_api_gre_tunnel_type_t.GRE_API_TUNNEL_TYPE_L3
33 self.t_mode = mode
34 if not self.t_mode:
35 self.t_mode = VppEnum.vl_api_tunnel_mode_t.TUNNEL_API_MODE_P2P
36 self.vpp_sw_if_index = 0xFFFFFFFF
37
38 def add_vpp_config(self):
39 r = self.test.vapi.gre_tunnel_add_del_v2(
40 is_add=1,
41 tunnel={
42 "src": self.t_src,
43 "dst": self.t_dst,
44 "outer_table_id": self.t_outer_table,
45 "instance": 0xFFFFFFFF,
46 "type": self.t_type,
47 "mode": self.t_mode,
48 "flags": self.t_flags,
49 "session_id": self.t_session,
50 "key": self.t_gre_key,
51 },
52 )
53
54 self.set_sw_if_index(r.sw_if_index)
55 self.vpp_sw_if_index = r.sw_if_index
56 self.generate_remote_hosts()
57 self.test.registry.register(self, self.test.logger)
58 return self
59
60 def remove_vpp_config(self):
61 self.unconfig()
62

Callers 15

test_gre_input_nodeMethod · 0.90
test_greMethod · 0.90
test_gre_with_keyMethod · 0.90
test_gre6Method · 0.90
test_gre_vrfMethod · 0.90
test_gre_l2Method · 0.90
test_gre_loopMethod · 0.90
test_mgreMethod · 0.90
test_mgre6Method · 0.90
test_fif4Method · 0.90
test_fif6Method · 0.90
setUpMethod · 0.90

Calls

no outgoing calls

Tested by 15

test_gre_input_nodeMethod · 0.72
test_greMethod · 0.72
test_gre_with_keyMethod · 0.72
test_gre6Method · 0.72
test_gre_vrfMethod · 0.72
test_gre_l2Method · 0.72
test_gre_loopMethod · 0.72
test_mgreMethod · 0.72
test_mgre6Method · 0.72
test_fif4Method · 0.72
test_fif6Method · 0.72
setUpMethod · 0.72