diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2008-05-06 13:33:51 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2008-05-06 13:33:51 +0000 |
commit | 4053d3d1e9e579c9002ffd6dc9fd649f1dd60d3a (patch) | |
tree | 467fb47f55f5ae6098d737c4db185dc7e2958f43 /sys/netmpls | |
parent | 4d9f0eb769fe12a4faf5c55b2ce36a8165ba83fe (diff) |
bring in the mpe interface - for ``MPLS Provider Edge'' - this is a work
in progress and some bits need to be cleaned up but will be in-tree for
convenience.
ok claudio@, norby@
Diffstat (limited to 'sys/netmpls')
-rw-r--r-- | sys/netmpls/mpls.h | 15 | ||||
-rw-r--r-- | sys/netmpls/mpls_input.c | 4 |
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/netmpls/mpls.h b/sys/netmpls/mpls.h index d721027cedb..98a52763021 100644 --- a/sys/netmpls/mpls.h +++ b/sys/netmpls/mpls.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls.h,v 1.4 2008/04/30 07:39:48 norby Exp $ */ +/* $OpenBSD: mpls.h,v 1.5 2008/05/06 13:33:50 pyr Exp $ */ /* * Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project. @@ -44,6 +44,8 @@ /* * Structure of a SHIM header. */ +#define MPLS_LABEL_MAX ((1 << 20) - 1) + struct shim_hdr { u_int32_t shim_label; /* 20 bit label, 4 bit exp & BoS, 8 bit TTL */ }; @@ -137,6 +139,16 @@ struct sockaddr_mpls { #endif #ifdef _KERNEL + +struct mpe_softc { + struct ifnet sc_if; /* the interface */ + int sc_unit; + struct shim_hdr sc_shim; + LIST_ENTRY(mpe_softc) sc_list; +}; + +#define MPE_HDRLEN sizeof(struct shim_hdr) + extern int mpls_raw_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *); @@ -152,5 +164,6 @@ struct mbuf *mpls_shim_swap(struct mbuf *, struct sockaddr_mpls *); struct mbuf *mpls_shim_push(struct mbuf *, struct sockaddr_mpls *); int mpls_sysctl(int *, u_int, void *, size_t *, void *, size_t); +void mpls_input(struct mbuf *); #endif /* _KERNEL */ diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c index bf0ec69fbd5..9081b2f6339 100644 --- a/sys/netmpls/mpls_input.c +++ b/sys/netmpls/mpls_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls_input.c,v 1.9 2008/05/06 08:04:04 norby Exp $ */ +/* $OpenBSD: mpls_input.c,v 1.10 2008/05/06 13:33:50 pyr Exp $ */ /* * Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org> @@ -30,8 +30,6 @@ struct ifqueue mplsintrq; int mplsqmaxlen = IFQ_MAXLEN; extern int mpls_inkloop; -void mpls_input(struct mbuf *); - #ifdef MPLS_DEBUG #define MPLS_LABEL_GET(l) ((ntohl((l) & MPLS_LABEL_MASK)) >> MPLS_LABEL_OFFSET) #define MPLS_TTL_GET(l) (ntohl((l) & MPLS_TTL_MASK)) |