summaryrefslogtreecommitdiff
path: root/lib/net.h
diff options
context:
space:
mode:
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; }