diff options
author | 2015-07-20 22:16:41 +0000 | |
---|---|---|
committer | 2015-07-20 22:16:41 +0000 | |
commit | 1ea7d8660e1958783def71a7f03407824fca737c (patch) | |
tree | 260949679a99b7c316bcec4f6026c55d73295a8f /sys/netmpls | |
parent | No need to recheck for NULL in openssl(1) ecparam. (diff) | |
download | wireguard-openbsd-1ea7d8660e1958783def71a7f03407824fca737c.tar.xz wireguard-openbsd-1ea7d8660e1958783def71a7f03407824fca737c.zip |
Implemented MPLS pseudowire (mpw(4)) to be used with VPLS and VPWS.
ok mpi@, claudio@.
Diffstat (limited to 'sys/netmpls')
-rw-r--r-- | sys/netmpls/mpls.h | 19 | ||||
-rw-r--r-- | sys/netmpls/mpls_input.c | 7 |
2 files changed, 24 insertions, 2 deletions
diff --git a/sys/netmpls/mpls.h b/sys/netmpls/mpls.h index a49e3ada76e..07231e0df47 100644 --- a/sys/netmpls/mpls.h +++ b/sys/netmpls/mpls.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls.h,v 1.32 2015/07/20 21:16:39 rzalamena Exp $ */ +/* $OpenBSD: mpls.h,v 1.33 2015/07/20 22:16:41 rzalamena Exp $ */ /* * Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project. @@ -64,6 +64,9 @@ struct shim_hdr { #define MPLS_BOS_OFFSET 8 #define MPLS_TTL_MASK __MADDR(0x000000ffU) +#define CW_ZERO_MASK __MADDR(0xf0000000U) +#define CW_FRAG_MASK __MADDR(0x00300000U) + #define MPLS_BOS_ISSET(l) (((l) & MPLS_BOS_MASK) == MPLS_BOS_MASK) /* Reserved lavel values (RFC3032) */ @@ -132,6 +135,20 @@ struct rt_mpls { &mpls_mapttl_ip6 \ } +#define IMR_TYPE_NONE 0 +#define IMR_TYPE_ETHERNET 1 +#define IMR_TYPE_ETHERNET_TAGGED 2 + +#define IMR_FLAG_CONTROLWORD 0x1 + +struct ifmpwreq { + uint32_t imr_flags; + uint32_t imr_type; /* pseudowire type */ + struct shim_hdr imr_lshim; /* local label */ + struct shim_hdr imr_rshim; /* remote label */ + struct sockaddr_storage imr_nexthop; +}; + #endif #ifdef _KERNEL diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c index ff87587f8e6..d1aa4ca2922 100644 --- a/sys/netmpls/mpls_input.c +++ b/sys/netmpls/mpls_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls_input.c,v 1.45 2015/07/20 21:16:39 rzalamena Exp $ */ +/* $OpenBSD: mpls_input.c,v 1.46 2015/07/20 22:16:41 rzalamena Exp $ */ /* * Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org> @@ -278,6 +278,11 @@ do_v6: goto done; } #endif + if (ifp->if_type == IFT_MPLSTUNNEL) { + ifp->if_output(ifp, m, rt_key(rt), rt); + goto done; + } + if (!rt->rt_gateway) { m_freem(m); goto done; |