diff --git a/Makefile b/Makefile index fc0e26e..6b95d59 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=0.0.7 +VERSION=0.0.8 VPPCFG:=vppcfg PYTHON?=python3 PIP?=pip diff --git a/debian/changelog b/debian/changelog index 73b01d4..874a8f6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vppcfg (0.0.8) unstable; urgency=low + + Feature release: + * Support af-packet interfaces + + -- Pim van Pelt Sat, 03 May 2025 14:45:37 +0000 vppcfg (0.0.7) unstable; urgency=low Feature release: diff --git a/setup.py b/setup.py index 7bec92a..f474f67 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup setup( name="vppcfg", - version="0.0.7", + version="0.0.8", install_requires=[ "requests", 'importlib-metadata; python_version >= "3.8"', diff --git a/vppcfg/schema.yaml b/vppcfg/schema.yaml index c905d4e..cf46d3b 100644 --- a/vppcfg/schema.yaml +++ b/vppcfg/schema.yaml @@ -57,7 +57,7 @@ interface: l2xc: str(required=False) state: enum('up', 'down', required=False) mpls: bool(required=False) - device-type: enum('dpdk', required=False) + device-type: enum('dpdk', 'af-packet', required=False) sflow: bool(required=False) --- sub-interface: diff --git a/vppcfg/vpp/dumper.py b/vppcfg/vpp/dumper.py index c08832a..fdd7889 100644 --- a/vppcfg/vpp/dumper.py +++ b/vppcfg/vpp/dumper.py @@ -123,6 +123,7 @@ class Dumper(VPPApi): "bond", "VXLAN", "dpdk", + "af-packet", "virtio", "pg", ]: @@ -155,7 +156,7 @@ class Dumper(VPPApi): i["state"] = "down" if ( - iface.interface_dev_type == "dpdk" + iface.interface_dev_type in ["dpdk", "af-packet"] and iface.sub_number_of_tags == 0 ): i["mac"] = str(iface.l2_address) @@ -193,6 +194,10 @@ class Dumper(VPPApi): config["interfaces"][sup_iface.interface_name]["sub-interfaces"][ iface.sub_id ] = i + if iface.interface_dev_type in ["dpdk", "af-packet"]: + config["interfaces"][iface.interface_name][ + "device-type" + ] = iface.interface_dev_type for idx, iface in self.cache["vxlan_tunnels"].items(): vpp_iface = self.cache["interfaces"][iface.sw_if_index] @@ -304,9 +309,9 @@ class Dumper(VPPApi): acl_rule.srcport_or_icmptype_first ) else: - config_term["icmp-type"] = ( - f"{acl_rule.srcport_or_icmptype_first}-{maxval}" - ) + config_term[ + "icmp-type" + ] = f"{acl_rule.srcport_or_icmptype_first}-{maxval}" maxval = acl_rule.dstport_or_icmpcode_last if maxval > 255: @@ -319,9 +324,9 @@ class Dumper(VPPApi): acl_rule.dstport_or_icmpcode_first ) else: - config_term["icmp-code"] = ( - f"{acl_rule.dstport_or_icmpcode_first}-{maxval}" - ) + config_term[ + "icmp-code" + ] = f"{acl_rule.dstport_or_icmpcode_first}-{maxval}" elif acl_rule.proto in [6, 17]: if acl_rule.proto == 6: config_term["protocol"] = "tcp" @@ -335,9 +340,9 @@ class Dumper(VPPApi): acl_rule.srcport_or_icmptype_first ) else: - config_term["source-port"] = ( - f"{acl_rule.srcport_or_icmptype_first}-{acl_rule.srcport_or_icmptype_last}" - ) + config_term[ + "source-port" + ] = f"{acl_rule.srcport_or_icmptype_first}-{acl_rule.srcport_or_icmptype_last}" if ( acl_rule.dstport_or_icmpcode_first == acl_rule.dstport_or_icmpcode_last @@ -346,9 +351,9 @@ class Dumper(VPPApi): acl_rule.dstport_or_icmpcode_first ) else: - config_term["destination-port"] = ( - f"{acl_rule.dstport_or_icmpcode_first}-{acl_rule.dstport_or_icmpcode_last}" - ) + config_term[ + "destination-port" + ] = f"{acl_rule.dstport_or_icmpcode_first}-{acl_rule.dstport_or_icmpcode_last}" else: config_term["protocol"] = int(acl_rule.proto)