summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2019-01-30 01:01:01 +0000
committerdlg <dlg@openbsd.org>2019-01-30 01:01:01 +0000
commit5b52201cb98728f5af3dc2dca1ac7690f0764433 (patch)
treef579b238586718f9787f6f8849c70db90c728990
parentdont store the unit when creating the interface, it's never used (diff)
downloadwireguard-openbsd-5b52201cb98728f5af3dc2dca1ac7690f0764433.tar.xz
wireguard-openbsd-5b52201cb98728f5af3dc2dca1ac7690f0764433.zip
add some macros to help turn labels into shims and back again.
-rw-r--r--sys/netmpls/mpls.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/netmpls/mpls.h b/sys/netmpls/mpls.h
index 80116558739..55c53a6d1d9 100644
--- a/sys/netmpls/mpls.h
+++ b/sys/netmpls/mpls.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpls.h,v 1.41 2019/01/27 05:13:04 dlg Exp $ */
+/* $OpenBSD: mpls.h,v 1.42 2019/01/30 01:01:01 dlg Exp $ */
/*
* Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project.
@@ -153,6 +153,9 @@ struct ifmpwreq {
#ifdef _KERNEL
+#define MPLS_LABEL2SHIM(_l) (htonl((_l) << MPLS_LABEL_OFFSET))
+#define MPLS_SHIM2LABEL(_s) (ntohl((_s)) >> MPLS_LABEL_OFFSET)
+
extern struct domain mplsdomain;
extern int mpls_defttl;