From 16e946c92c14fb782fafbd532331cfecfb5b65ed Mon Sep 17 00:00:00 2001 From: Pim van Pelt Date: Mon, 16 Jan 2023 19:12:33 +0000 Subject: [PATCH] Copy over the acl.tag into the description when dumping --- vppcfg/foo | 115 +++++++++++++++++++++++++++++++++++++++++++ vppcfg/vpp/dumper.py | 3 +- 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 vppcfg/foo diff --git a/vppcfg/foo b/vppcfg/foo new file mode 100644 index 0000000..6dcc196 --- /dev/null +++ b/vppcfg/foo @@ -0,0 +1,115 @@ +acls: + vppacl0: + description: tag tag0 + terms: + - action: permit + destination: 0.0.0.0/0 + source: 0.0.0.0/0 + vppacl1: + description: tag tag1 + terms: + - action: deny + destination: 0.0.0.0/0 + source: 0.0.0.0/0 + vppacl2: + description: tag tag2 + terms: + - action: permit + destination: 0.0.0.0/0 + icmp-code: 0-255 + icmp-type: 0-255 + protocol: icmp + source: 0.0.0.0/0 + vppacl3: + description: tag tag3 + terms: + - action: permit + destination: 0.0.0.0/0 + destination-port: 80 + protocol: tcp + source: 0.0.0.0/0 + source-port: 1024-65535 + vppacl4: + description: tag tag4 + terms: + - action: permit + destination: 0.0.0.0/0 + destination-port: 80 + protocol: tcp + source: 0.0.0.0/0 + source-port: 1024-65535 + vppacl5: + description: tag tag5 + terms: + - action: permit + destination: 2001:db8::1/128 + destination-port: 80 + protocol: tcp + source: ::/0 + source-port: 1024-65535 + - action: permit + destination: 0.0.0.0/0 + source: 0.0.0.0/0 +bondethernets: + BondEthernet0: + description: '' + interfaces: + - GigabitEthernet3/0/0 + - GigabitEthernet3/0/1 + load-balance: l2 + mac: 02:fe:0f:f0:a7:bb + mode: lacp +bridgedomains: {} +interfaces: + BondEthernet0: + description: '' + lcp: be0 + mtu: 9000 + sub-interfaces: + 100: + description: '' + encapsulation: + dot1q: 100 + exact-match: false + l2xc: BondEthernet0.200 + mtu: 2500 + 200: + description: '' + encapsulation: + dot1q: 200 + exact-match: false + l2xc: BondEthernet0.100 + mtu: 2500 + 500: + description: '' + encapsulation: + dot1ad: 500 + exact-match: false + mtu: 2000 + 501: + description: '' + encapsulation: + dot1ad: 501 + exact-match: false + mtu: 2000 + GigabitEthernet3/0/0: + description: '' + mac: 00:25:90:0c:05:00 + mtu: 9000 + GigabitEthernet3/0/1: + description: '' + mac: 00:25:90:0c:05:00 + mtu: 9000 + HundredGigabitEthernet13/0/0: + description: '' + mac: b4:96:91:b3:b1:10 + mtu: 1500 + HundredGigabitEthernet13/0/1: + description: '' + mac: b4:96:91:b3:b1:11 + mtu: 1500 +loopbacks: {} +prefixlists: {} +taps: {} +vxlan_tunnels: {} + diff --git a/vppcfg/vpp/dumper.py b/vppcfg/vpp/dumper.py index 6c23dba..c3faebf 100644 --- a/vppcfg/vpp/dumper.py +++ b/vppcfg/vpp/dumper.py @@ -251,7 +251,8 @@ class Dumper(VPPApi): for idx, acl in self.cache["acls"].items(): aclname = f"vppacl{acl.acl_index}" - config_acl = {"description": "", "terms": []} + descr = "tag " + acl.tag.replace('"', "").replace("'", "") + config_acl = {"description": descr, "terms": []} terms = 0 for acl_rule in acl.r: terms += 1