from framework import VppTestCase, VppTestRunner
from vpp_sub_interface import L2_VTR_OP, VppDot1QSubint
from vpp_gre_interface import VppGreInterface
-from vpp_nhrp import VppNhrp
+from vpp_teib import VppTeib
from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath, VppIpTable, FibPathProto
from util import ppp, ppc
self.pg_start()
# no tunnel created, gre-input not registered
err = self.statistics.get_counter(
- '/err/ip4-input/unknown ip protocol')[0]
+ '/err/ip4-local/unknown ip protocol')[0]
self.assertEqual(err, 1)
err_count = err
self.pg_start()
# tunnel created, gre-input registered
err = self.statistics.get_counter(
- '/err/ip4-input/unknown ip protocol')[0]
+ '/err/ip4-local/unknown ip protocol')[0]
# expect no new errors
self.assertEqual(err, err_count)
self.assertEqual(rx_ip.src, tunnel_src)
self.assertEqual(rx_ip.dst, tunnel_dst)
self.assertEqual(rx_ip.tos, tos)
+ self.assertEqual(rx_ip.len, len(rx_ip))
rx_gre = rx[GRE]
rx_ip = rx_gre[IP]
self.assertEqual(rx_ip.tc, tc)
rx_gre = GRE(scapy.compat.raw(rx_ip[IPv6].payload))
+
+ self.assertEqual(rx_ip.plen, len(rx_gre))
+
rx_ip = rx_gre[IPv6]
self.assertEqual(rx_ip.src, tx_ip.src)
self.assertEqual(rx_ip.dst, tunnel_dst)
rx_gre = GRE(scapy.compat.raw(rx_ip[IPv6].payload))
+
+ self.assertEqual(rx_ip.plen, len(rx_gre))
+
tx_ip = tx[IP]
rx_ip = rx_gre[IP]
self.assertEqual(rx_ip.src, tunnel_src)
self.assertEqual(rx_ip.dst, tunnel_dst)
+ self.assertEqual(rx_ip.len, len(rx_ip))
rx_gre = GRE(scapy.compat.raw(rx_ip[IP].payload))
rx_ip = rx_gre[IPv6]
self.assertEqual(rx_ip.src, tunnel_src)
self.assertEqual(rx_ip.dst, tunnel_dst)
+ self.assertEqual(rx_ip.len, len(rx_ip))
rx_gre = rx[GRE]
rx_l2 = rx_gre[Ether]
route_via_tun.add_vpp_config()
#
- # Add a NHRP entry resolves the peer
+ # Add a TEIB entry resolves the peer
#
- nhrp = VppNhrp(self, gre_if,
+ teib = VppTeib(self, gre_if,
gre_if._remote_hosts[ii].ip4,
itf._remote_hosts[ii].ip4)
- nhrp.add_vpp_config()
+ teib.add_vpp_config()
#
# Send a packet stream that is routed into the tunnel
self.verify_decapped_4o4(self.pg0, rx, tx_i)
#
- # delete and re-add the NHRP
+ # delete and re-add the TEIB
#
- nhrp.remove_vpp_config()
+ teib.remove_vpp_config()
self.send_and_assert_no_replies(self.pg0, tx_e)
self.send_and_assert_no_replies(self.pg0, tx_i)
- nhrp.add_vpp_config()
+ teib.add_vpp_config()
rx = self.send_and_expect(self.pg0, tx_e, itf)
self.verify_tunneled_4o4(self.pg0, rx, tx_e,
itf.local_ip4,
route_addr = "4::%d" % ii
#
- # Add a NHRP entry resolves the peer
+ # Add a TEIB entry resolves the peer
#
- nhrp = VppNhrp(self, gre_if,
+ teib = VppTeib(self, gre_if,
gre_if._remote_hosts[ii].ip6,
itf._remote_hosts[ii].ip6)
- nhrp.add_vpp_config()
+ teib.add_vpp_config()
#
# route traffic via the peer
self.verify_decapped_6o6(self.pg0, rx, tx_i)
#
- # delete and re-add the NHRP
+ # delete and re-add the TEIB
#
- nhrp.remove_vpp_config()
+ teib.remove_vpp_config()
self.send_and_assert_no_replies(self.pg0, tx_e)
- nhrp.add_vpp_config()
+ teib.add_vpp_config()
rx = self.send_and_expect(self.pg0, tx_e, itf)
self.verify_tunneled_6o6(self.pg0, rx, tx_e,
itf.local_ip6,