summaryrefslogtreecommitdiff
path: root/lib/net.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-03-04 12:55:50 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2016-12-22 21:38:33 +0100
commitd14f8c3c45f7e33a7e54ebc0d45bdb0295d70301 (patch)
treee7dadc1408d852a36075efc64a9bdb15630efdd4 /lib/net.h
parentf2010f9c65ca69584c34c762fb3e5e957958478e (diff)
Netlink: MPLS routes in kernel
Anyway, Bird is now capable to insert both MPLS routes and MPLS encap routes into kernel. It was (among others) needed to define platform-specific AF_MPLS to 28 as this constant has been assigned in the linux kernel. No support for BSD now, it may be added in the future.
Diffstat (limited to 'lib/net.h')
-rw-r--r--lib/net.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/net.h b/lib/net.h
index 5fc4dab7..7c124fc0 100644
--- a/lib/net.h
+++ b/lib/net.h
@@ -259,6 +259,14 @@ static inline ip_addr net_prefix(const net_addr *a)
}
}
+static inline u32 net_mpls(const net_addr *a)
+{
+ if (a->type == NET_MPLS)
+ return ((net_addr_mpls *) a)->label;
+
+ bug("Can't call net_mpls on non-mpls net_addr");
+}
+
static inline uint net4_pxlen(const net_addr *a)
{ return a->pxlen; }