+ if isinstance(other, self.__class__):
+ return (self.glen == other.glen and
+ self.saddr == other.gaddr and
+ self.saddr == other.saddr)
+ elif (hasattr(other, "grp_address_length") and
+ hasattr(other, "grp_address") and
+ hasattr(other, "src_address")):
+ # vl_api_mprefix_t
+ if 4 == self.version:
+ return (self.glen == other.grp_address_length and
+ self.gaddr == str(other.grp_address.ip4) and
+ self.saddr == str(other.src_address.ip4))
+ else:
+ return (self.glen == other.grp_address_length and
+ self.gaddr == str(other.grp_address.ip6) and
+ self.saddr == str(other.src_address.ip6))
+ return NotImplemented
+
+
+class VppIpPuntPolicer(VppObject):
+ def __init__(self, test, policer_index, is_ip6=False):
+ self._test = test
+ self._policer_index = policer_index
+ self._is_ip6 = is_ip6
+
+ def add_vpp_config(self):
+ self._test.vapi.ip_punt_police(policer_index=self._policer_index,
+ is_ip6=self._is_ip6, is_add=True)
+
+ def remove_vpp_config(self):
+ self._test.vapi.ip_punt_police(policer_index=self._policer_index,
+ is_ip6=self._is_ip6, is_add=False)
+
+ def query_vpp_config(self):
+ NotImplemented
+
+
+class VppIpPuntRedirect(VppObject):
+ def __init__(self, test, rx_index, tx_index, nh_addr):
+ self._test = test
+ self._rx_index = rx_index
+ self._tx_index = tx_index
+ self._nh_addr = ip_address(nh_addr)