aboutsummaryrefslogtreecommitdiffstats
path: root/test/vpp_ip_route.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/vpp_ip_route.py')
-rw-r--r--test/vpp_ip_route.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/vpp_ip_route.py b/test/vpp_ip_route.py
index ca0ae1ad47d..39b2b1ae1e8 100644
--- a/test/vpp_ip_route.py
+++ b/test/vpp_ip_route.py
@@ -168,6 +168,19 @@ class VppRoutePath(object):
'ttl': 255})
return lstack
+ def encode(self):
+ return {'next_hop': self.nh_addr,
+ 'weight': 1,
+ 'afi': 0,
+ 'preference': 0,
+ 'table_id': self.nh_table_id,
+ 'next_hop_id': self.next_hop_id,
+ 'sw_if_index': self.nh_itf,
+ 'afi': self.proto,
+ 'is_udp_encap': self.is_udp_encap,
+ 'n_labels': len(self.nh_labels),
+ 'label_stack': self.encode_labels()}
+
class VppMRoutePath(VppRoutePath):