From 1bebb8d68da1269bcd1d2871d1aab9ef9e3caf6d Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Mon, 16 Jan 2023 17:12:48 +0000 Subject: [PATCH] acl: add dumper for acls A reasonable attempt will be made to shorten the output of terms, but due to the nature of the ACL plugin in VPP, all ACLs will be unrolled into their individual ACEs (called 'terms'). - src/dst-port will only be emitted with UDP/TCP - icmp-typc/code will only be emitted with ICMP/ICMPv6 - icmp-code/type and source/destination-ports ranges will be collapsed where appropriate. - if protocol is 0, only L3 information will be emitted NOTE: a bug in the VPP plugin will allow for ICMP 'sport' and 'dport' upper value to be 16 bits. If an ACE is retrieved from the dataplane regarding an ICMP or ICMPv6 (referring the 16 bit values to icmp type and code), they will be truncated and a warning issued. --- vppcfg/vpp/vppapi.py | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/vppcfg/vpp/vppapi.py b/vppcfg/vpp/vppapi.py index e27a9f7..639c3f1 100644 --- a/vppcfg/vpp/vppapi.py +++ b/vppcfg/vpp/vppapi.py @@ -382,30 +382,6 @@ class VPPApi: f"MPLS state retrieval requires https://gerrit.fd.io/r/c/vpp/+/39022" ) - try: ## TODO(pim): Remove after 23.10 release - self.logger.debug("Retrieving interface MPLS state") - api_response = self.vpp.api.mpls_interface_dump() - for iface in api_response: - self.cache["interface_mpls"][iface.sw_if_index] = True - except AttributeError: - self.logger.warning( - f"MPLS state retrieval requires https://gerrit.fd.io/r/c/vpp/+/39022" - ) - - try: - self.logger.debug("Retrieving ACLs") - api_response = self.vpp.api.acl_dump(acl_index=0xFFFFFFFF) - for acl in api_response: - self.cache["acls"][acl.acl_index] = acl - if acl.tag in self.cache["acl_tags"]: - self.logger.error( - f"Duplicate ACL tag '{acl.tag}' found - cannot safely preoceed, bailing" - ) - return False - self.cache["acl_tags"][acl.tag] = acl.acl_index - except AttributeError as err: - self.logger.warning(f"ACL API not found - missing plugin: {err}") - try: self.logger.debug("Retrieving ACLs") api_response = self.vpp.api.acl_dump(acl_index=0xFFFFFFFF) @@ -419,8 +395,6 @@ class VPPApi: except AttributeError: self.logger.warning(f"ACL API not found - missing plugin: {err}") -======= ->>>>>>> 0cf4473 (Set MPLS for loopback and interface. Allow for --novpp and VPP changes) self.logger.debug("Retrieving bondethernets") api_response = self.vpp.api.sw_bond_interface_dump() for iface in api_response: