public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier <aderumier@odiso.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH pve-network 2/3] controllers: frr: add parsing of "interfaces" section
Date: Wed, 13 Sep 2023 13:38:43 +0200	[thread overview]
Message-ID: <20230913113845.1066417-5-aderumier@odiso.com> (raw)
In-Reply-To: <20230913113845.1066417-1-aderumier@odiso.com>

---
 src/PVE/Network/SDN/Controllers/EvpnPlugin.pm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
index fd4b801..f1dd20f 100644
--- a/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
+++ b/src/PVE/Network/SDN/Controllers/EvpnPlugin.pm
@@ -384,6 +384,20 @@ sub generate_frr_ip_protocol {
    foreach my $rule (sort @$ips) {
 	push @{$final_config}, $rule;
    }
+
+}
+
+sub generate_frr_interfaces {
+   my ($final_config, $interfaces) = @_;
+
+   foreach my $k (sort keys %$interfaces) {
+	my $iface = $interfaces->{$k};
+	push @{$final_config}, "!";
+	push @{$final_config}, "interface $k";
+	foreach my $rule (sort @$iface) {
+	    push @{$final_config}, " $rule";
+	}
+   }
 }
 
 sub generate_frr_routemap {
@@ -445,6 +459,7 @@ sub generate_controller_rawconfig {
     }
 
     generate_frr_vrf($final_config, $config->{frr}->{vrf});
+    generate_frr_interfaces($final_config, $config->{frr_interfaces});
     generate_frr_recurse($final_config, $config->{frr}, undef, 0);
     generate_frr_list($final_config, $config->{frr_access_list}, "access-list");
     generate_frr_list($final_config, $config->{frr_prefix_list}, "ip prefix-list");
@@ -481,6 +496,9 @@ sub parse_merge_frr_local_config {
 	} elsif ($line =~ m/^vrf (.+)$/) {
 	    $section = \$config->{'frr'}->{'vrf'}->{$1};
 	    next;
+	} elsif ($line =~ m/^interface (.+)$/) {
+	    $section = \$config->{'frr_interfaces'}->{$1};
+	    next;
 	} elsif ($line =~ m/address-family (.+)$/) {
 	    $section = \$config->{'frr'}->{'router'}->{$router}->{'address-family'}->{$1};
 	    next;
-- 
2.39.2




  parent reply	other threads:[~2023-09-13 11:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 11:38 [pve-devel] [PATCH-SERIES pve-network/pve-manager/pve-docs] sdn: add isis controller Alexandre Derumier
2023-09-13 11:38 ` [pve-devel] [PATCH pve-network 1/3] controller: evpn: fix find_bgp_controller Alexandre Derumier
2023-09-13 11:38 ` [pve-devel] [PATCH pve-docs 1/2] sdn: add notes about bgp controller Alexandre Derumier
2023-09-13 11:38 ` [pve-devel] [PATCH pve-manager 1/1] sdn: controllers: add isis controller Alexandre Derumier
2023-09-13 11:38 ` Alexandre Derumier [this message]
2023-09-13 11:38 ` [pve-devel] [PATCH pve-docs 2/2] sdn: add isis controller documentation Alexandre Derumier
2023-09-13 11:38 ` [pve-devel] [PATCH pve-network 3/3] controllers: add isis router plugin Alexandre Derumier
2023-10-25 11:22 ` [pve-devel] applied-series: [PATCH-SERIES pve-network/pve-manager/pve-docs] sdn: add isis controller Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230913113845.1066417-5-aderumier@odiso.com \
    --to=aderumier@odiso.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal