summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2022-09-15 01:38:18 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-10-04 13:01:21 +0200
commit333ddd4f981b90d5d3dff166b6abf9bf40bede9f (patch)
treecfe873631d254b9198d7040a7f922f65d158f15d /sysdep/unix
parente55696a4f88b63c622bb3a0360f9114d01253e53 (diff)
MPLS subsystem
The MPLS subsystem manages MPLS labels and handles their allocation to MPLS-aware routing protocols. These labels are then attached to IP or VPN routes representing label switched paths -- LSPs. There was already a preliminary MPLS support consisting of MPLS label net_addr, MPLS routing tables with static MPLS routes, remote labels in next hops, and kernel protocol support. This patch adds the MPLS domain as a basic structure representing local label space with dynamic label allocator and configurable label ranges. To represent LSPs, allocated local labels can be attached as route attributes to IP or VPN routes with local labels as attributes. There are several steps for handling LSP routes in routing protocols -- deciding to which forwarding equivalence class (FEC) the LSP route belongs, allocating labels for new FECs, announcing MPLS routes for new FECs, attaching labels to LSP routes. The FEC map structure implements basic code for managing FECs in routing protocols, therefore existing protocols can be made MPLS-aware by adding FEC map and delegating most work related to local label management to it.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.Y9
-rw-r--r--sysdep/unix/main.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/sysdep/unix/krt.Y b/sysdep/unix/krt.Y
index 95b54d65..5af6a4c8 100644
--- a/sysdep/unix/krt.Y
+++ b/sysdep/unix/krt.Y
@@ -33,6 +33,7 @@ CF_KEYWORDS(KERNEL, PERSIST, SCAN, TIME, LEARN, DEVICE, ROUTES, GRACEFUL, RESTAR
CF_KEYWORDS(INTERFACE, PREFERRED)
%type <i> kern_mp_limit
+%type <cc> kern_channel
CF_GRAMMAR
@@ -53,9 +54,15 @@ kern_mp_limit:
| LIMIT expr { $$ = $2; if (($2 <= 0) || ($2 > 255)) cf_error("Merge paths limit must be in range 1-255"); }
;
+
+kern_channel:
+ proto_channel
+ | mpls_channel
+ ;
+
kern_item:
proto_item
- | proto_channel { this_proto->net_type = $1->net_type; }
+ | kern_channel { this_proto->net_type = $1->net_type; }
| PERSIST bool { THIS_KRT->persist = $2; }
| SCAN TIME expr {
/* Scan time of 0 means scan on startup only */
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c
index 23cadb14..0d7788bb 100644
--- a/sysdep/unix/main.c
+++ b/sysdep/unix/main.c
@@ -33,6 +33,7 @@
#include "nest/route.h"
#include "nest/protocol.h"
#include "nest/iface.h"
+#include "nest/mpls.h"
#include "nest/cli.h"
#include "nest/locks.h"
#include "conf/conf.h"
@@ -895,6 +896,7 @@ main(int argc, char **argv)
io_init();
rt_init();
if_init();
+ mpls_init();
// roa_init();
config_init();