+ def ipsec_select_backend(self, protocol, index):
+ return self.api(self.papi.ipsec_select_backend,
+ {'protocol': protocol, 'index': index})
+
+ def ipsec_backend_dump(self):
+ return self.api(self.papi.ipsec_backend_dump, {})
+
+ def punt_socket_register(self, reg, pathname,
+ header_version=1):
+ """ Register punt socket """
+ return self.api(self.papi.punt_socket_register,
+ {'header_version': header_version,
+ 'punt': reg,
+ 'pathname': pathname})
+
+ def punt_socket_deregister(self, reg):
+ """ Unregister punt socket """
+ return self.api(self.papi.punt_socket_deregister,
+ {'punt': reg})
+
+ def gbp_endpoint_add(self, sw_if_index, ips, mac, sclass, flags,
+ tun_src, tun_dst):
+ """ GBP endpoint Add """
+ return self.api(self.papi.gbp_endpoint_add,
+ {'endpoint': {
+ 'sw_if_index': sw_if_index,
+ 'ips': ips,
+ 'n_ips': len(ips),
+ 'mac': mac,
+ 'sclass': sclass,
+ 'flags': flags,
+ 'tun': {
+ 'src': tun_src,
+ 'dst': tun_dst,
+ }}})
+
+ def gbp_endpoint_del(self, handle):
+ """ GBP endpoint Del """
+ return self.api(self.papi.gbp_endpoint_del,
+ {'handle': handle})
+
+ def gbp_endpoint_dump(self):
+ """ GBP endpoint Dump """
+ return self.api(self.papi.gbp_endpoint_dump, {})
+
+ def gbp_endpoint_group_add(self, vnid, sclass, bd,
+ rd, uplink_sw_if_index,
+ retention):
+ """ GBP endpoint group Add """
+ return self.api(self.papi.gbp_endpoint_group_add,
+ {'epg':
+ {
+ 'uplink_sw_if_index': uplink_sw_if_index,
+ 'bd_id': bd,
+ 'rd_id': rd,
+ 'vnid': vnid,
+ 'sclass': sclass,
+ 'retention': retention
+ }})
+
+ def gbp_endpoint_group_del(self, sclass):
+ """ GBP endpoint group Del """
+ return self.api(self.papi.gbp_endpoint_group_del,
+ {'sclass': sclass})
+
+ def gbp_bridge_domain_add(self, bd_id, rd_id, flags,
+ bvi_sw_if_index,
+ uu_fwd_sw_if_index,
+ bm_flood_sw_if_index):
+ """ GBP bridge-domain Add """
+ return self.api(self.papi.gbp_bridge_domain_add,
+ {'bd':
+ {
+ 'flags': flags,
+ 'bvi_sw_if_index': bvi_sw_if_index,
+ 'uu_fwd_sw_if_index': uu_fwd_sw_if_index,
+ 'bm_flood_sw_if_index': bm_flood_sw_if_index,
+ 'bd_id': bd_id,
+ 'rd_id': rd_id
+ }})
+
+ def gbp_bridge_domain_del(self, bd_id):
+ """ GBP bridge-domain Del """
+ return self.api(self.papi.gbp_bridge_domain_del,
+ {'bd_id': bd_id})
+
+ def gbp_route_domain_add(self, rd_id,
+ scope,
+ ip4_table_id,
+ ip6_table_id,
+ ip4_uu_sw_if_index,
+ ip6_uu_sw_if_index):
+ """ GBP route-domain Add """
+ return self.api(self.papi.gbp_route_domain_add,
+ {'rd':
+ {
+ 'scope': scope,
+ 'ip4_table_id': ip4_table_id,
+ 'ip6_table_id': ip6_table_id,
+ 'ip4_uu_sw_if_index': ip4_uu_sw_if_index,
+ 'ip6_uu_sw_if_index': ip6_uu_sw_if_index,
+ 'rd_id': rd_id
+ }})
+
+ def gbp_route_domain_del(self, rd_id):
+ """ GBP route-domain Del """
+ return self.api(self.papi.gbp_route_domain_del,
+ {'rd_id': rd_id})
+
+ def gbp_recirc_add_del(self, is_add, sw_if_index, sclass, is_ext):
+ """ GBP recirc Add/Del """
+ return self.api(self.papi.gbp_recirc_add_del,
+ {'is_add': is_add,
+ 'recirc': {
+ 'is_ext': is_ext,
+ 'sw_if_index': sw_if_index,
+ 'sclass': sclass}})
+
+ def gbp_recirc_dump(self):
+ """ GBP recirc Dump """
+ return self.api(self.papi.gbp_recirc_dump, {})
+
+ def gbp_ext_itf_add_del(self, is_add, sw_if_index, bd_id, rd_id, flags):
+ """ GBP recirc Add/Del """
+ return self.api(self.papi.gbp_ext_itf_add_del,
+ {'is_add': is_add,
+ 'ext_itf': {
+ 'sw_if_index': sw_if_index,
+ 'bd_id': bd_id,
+ 'rd_id': rd_id,
+ 'flags': flags}})
+
+ def gbp_ext_itf_dump(self):
+ """ GBP recirc Dump """
+ return self.api(self.papi.gbp_ext_itf_dump, {})
+
+ def gbp_subnet_add_del(self, is_add, rd_id,
+ prefix, type,
+ sw_if_index=0xffffffff,
+ sclass=0xffff):
+ """ GBP Subnet Add/Del """
+ return self.api(self.papi.gbp_subnet_add_del,
+ {'is_add': is_add,
+ 'subnet': {
+ 'type': type,
+ 'sw_if_index': sw_if_index,
+ 'sclass': sclass,
+ 'prefix': prefix,
+ 'rd_id': rd_id}})
+
+ def gbp_subnet_dump(self):
+ """ GBP Subnet Dump """
+ return self.api(self.papi.gbp_subnet_dump, {})
+
+ def gbp_contract_dump(self):
+ """ GBP contract Dump """
+ return self.api(self.papi.gbp_contract_dump, {})
+
+ def gbp_vxlan_tunnel_add(self, vni, bd_rd_id, mode, src):
+ """ GBP VXLAN tunnel add """
+ return self.api(self.papi.gbp_vxlan_tunnel_add,
+ {
+ 'tunnel': {
+ 'vni': vni,
+ 'mode': mode,
+ 'bd_rd_id': bd_rd_id,
+ 'src': src
+ }
+ })
+
+ def gbp_vxlan_tunnel_del(self, vni):
+ """ GBP VXLAN tunnel del """
+ return self.api(self.papi.gbp_vxlan_tunnel_del,
+ {
+ 'vni': vni,
+ })
+
+ def gbp_vxlan_tunnel_dump(self):
+ """ GBP VXLAN tunnel add/del """
+ return self.api(self.papi.gbp_vxlan_tunnel_dump, {})
+
+ def igmp_enable_disable(self, sw_if_index, enable, host):
+ """ Enable/disable IGMP on a given interface """
+ return self.api(self.papi.igmp_enable_disable,
+ {'enable': enable,
+ 'mode': host,
+ 'sw_if_index': sw_if_index})
+
+ def igmp_proxy_device_add_del(self, vrf_id, sw_if_index, add):
+ """ Add/del IGMP proxy device """
+ return self.api(self.papi.igmp_proxy_device_add_del,
+ {'vrf_id': vrf_id, 'sw_if_index': sw_if_index,
+ 'add': add})
+
+ def igmp_proxy_device_add_del_interface(self, vrf_id, sw_if_index, add):
+ """ Add/del interface to/from IGMP proxy device """
+ return self.api(self.papi.igmp_proxy_device_add_del_interface,
+ {'vrf_id': vrf_id, 'sw_if_index': sw_if_index,
+ 'add': add})
+
+ def igmp_listen(self, filter, sw_if_index, saddrs, gaddr):
+ """ Listen for new (S,G) on specified interface
+
+ :param enable: add/del
+ :param sw_if_index: interface sw index
+ :param saddr: source ip4 addr
+ :param gaddr: group ip4 addr
+ """
+ return self.api(self.papi.igmp_listen,
+ {
+ 'group':
+ {
+ 'filter': filter,
+ 'sw_if_index': sw_if_index,
+ 'n_srcs': len(saddrs),
+ 'saddrs': saddrs,
+ 'gaddr': gaddr
+ }
+ })
+
+ def igmp_clear_interface(self, sw_if_index):
+ """ Remove all (S,G)s from specified interface
+ doesn't send IGMP report!
+ """