Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump Add librumpnet_netmpls that provides MPLS features ...
details: https://anonhg.NetBSD.org/src/rev/356c7c8379fb
branches: trunk
changeset: 788709:356c7c8379fb
user: kefren <kefren%NetBSD.org@localhost>
date: Thu Jul 18 15:59:27 2013 +0000
description:
Add librumpnet_netmpls that provides MPLS features into rump kernels
ok'ed pooka@
diffstat:
sys/rump/librump/rumpnet/netisr.c | 14 +++++-
sys/rump/net/Makefile.rumpnetcomp | 5 +-
sys/rump/net/lib/libnet/Makefile | 3 +-
sys/rump/net/lib/libnet/opt/opt_mpls.h | 4 +-
sys/rump/net/lib/libnetmpls/Makefile | 14 +++++++
sys/rump/net/lib/libnetmpls/Makefile.inc | 6 +++
sys/rump/net/lib/libnetmpls/component.c | 59 +++++++++++++++++++++++++++++++
sys/rump/net/lib/libnetmpls/shlib_version | 4 ++
8 files changed, 101 insertions(+), 8 deletions(-)
diffs (197 lines):
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/librump/rumpnet/netisr.c
--- a/sys/rump/librump/rumpnet/netisr.c Thu Jul 18 15:39:08 2013 +0000
+++ b/sys/rump/librump/rumpnet/netisr.c Thu Jul 18 15:59:27 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netisr.c,v 1.5 2010/12/30 16:19:39 pooka Exp $ */
+/* $NetBSD: netisr.c,v 1.6 2013/07/18 15:59:27 kefren Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netisr.c,v 1.5 2010/12/30 16:19:39 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netisr.c,v 1.6 2013/07/18 15:59:27 kefren Exp $");
#include <sys/param.h>
#include <sys/intr.h>
@@ -36,6 +36,7 @@
#include <netinet/if_inarp.h>
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
+#include <netmpls/mpls_var.h>
#include <net/netisr.h>
#include <rump/rumpuser.h>
@@ -63,11 +64,12 @@
__weak_alias(ipintr,__netisr_stub);
__weak_alias(arpintr,__netisr_stub);
__weak_alias(ip6intr,__netisr_stub);
+__weak_alias(mplsintr,__netisr_stub);
void
rump_netisr_init(void)
{
- void *iphand, *arphand, *ip6hand, *sym;
+ void *iphand, *arphand, *ip6hand, *mplshand, *sym;
iphand = ipintr;
if ((sym = rumpuser_dl_globalsym("rumpns_ipintr")) != NULL)
@@ -80,6 +82,10 @@
ip6hand = ip6intr;
if ((sym = rumpuser_dl_globalsym("rumpns_ip6intr")) != NULL)
ip6hand = sym;
+
+ mplshand = mplsintr;
+ if ((sym = rumpuser_dl_globalsym("rumpns_mplsintr")) != NULL)
+ mplshand = sym;
netisrs[NETISR_IP] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
(void (*)(void *))iphand, NULL);
@@ -87,4 +93,6 @@
(void (*)(void *))arphand, NULL);
netisrs[NETISR_IPV6] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
(void (*)(void *))ip6hand, NULL);
+ netisrs[NETISR_MPLS] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
+ (void (*)(void *))mplshand, NULL);
}
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/Makefile.rumpnetcomp
--- a/sys/rump/net/Makefile.rumpnetcomp Thu Jul 18 15:39:08 2013 +0000
+++ b/sys/rump/net/Makefile.rumpnetcomp Thu Jul 18 15:59:27 2013 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile.rumpnetcomp,v 1.5 2012/08/15 17:56:58 rmind Exp $
+# $NetBSD: Makefile.rumpnetcomp,v 1.6 2013/07/18 15:59:27 kefren Exp $
#
-RUMPNETCOMP= agr bridge net net80211 netbt netinet npf local shmif virtif
+RUMPNETCOMP= agr bridge net net80211 netbt netinet netmpls npf
+RUMPNETCOMP+= local shmif virtif
RUMPNETSOCKIN= sockin
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/lib/libnet/Makefile
--- a/sys/rump/net/lib/libnet/Makefile Thu Jul 18 15:39:08 2013 +0000
+++ b/sys/rump/net/lib/libnet/Makefile Thu Jul 18 15:59:27 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2013/06/01 10:54:24 pooka Exp $
+# $NetBSD: Makefile,v 1.18 2013/07/18 15:59:28 kefren Exp $
#
.PATH: ${.CURDIR}/../../../../net ${.CURDIR}/../../../../compat/common
@@ -15,6 +15,7 @@
CPPFLAGS+= -DCOMPAT_OIFREQ -DCOMPAT_OIFDATA
.include "${.CURDIR}/../libnetinet/Makefile.inc"
+.include "${.CURDIR}/../libnetmpls/Makefile.inc"
.include <bsd.lib.mk>
.include <bsd.klinks.mk>
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/lib/libnet/opt/opt_mpls.h
--- a/sys/rump/net/lib/libnet/opt/opt_mpls.h Thu Jul 18 15:39:08 2013 +0000
+++ b/sys/rump/net/lib/libnet/opt/opt_mpls.h Thu Jul 18 15:59:27 2013 +0000
@@ -1,3 +1,3 @@
-/* $NetBSD: opt_mpls.h,v 1.1 2010/06/26 14:24:28 kefren Exp $ */
+/* $NetBSD: opt_mpls.h,v 1.2 2013/07/18 15:59:28 kefren Exp $ */
-/* XXX: dummy */
+#define MPLS 1
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/lib/libnetmpls/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/net/lib/libnetmpls/Makefile Thu Jul 18 15:59:27 2013 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2013/07/18 15:59:28 kefren Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../net ${.CURDIR}/../../../../netmpls
+
+LIB= rumpnet_netmpls
+
+SRCS= mpls_ttl.c if_mpls.c
+SRCS+= component.c
+
+CPPFLAGS+= -I${.CURDIR}/../libnet/opt
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/lib/libnetmpls/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/net/lib/libnetmpls/Makefile.inc Thu Jul 18 15:59:27 2013 +0000
@@ -0,0 +1,6 @@
+# $NetBSD: Makefile.inc,v 1.1 2013/07/18 15:59:28 kefren Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../netmpls
+
+SRCS+= mpls_proto.c
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/lib/libnetmpls/component.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/net/lib/libnetmpls/component.c Thu Jul 18 15:59:27 2013 +0000
@@ -0,0 +1,59 @@
+/* $NetBSD: component.c,v 1.1 2013/07/18 15:59:28 kefren Exp $ */
+
+/*
+ * Copyright (c) 2009 Antti Kantee. All Rights Reserved.
+ *
+ * Development of this software was supported by The Nokia Foundation
+ *
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: component.c,v 1.1 2013/07/18 15:59:28 kefren Exp $");
+
+#include <sys/param.h>
+#include <sys/domain.h>
+#include <sys/protosw.h>
+
+#include <net/if.h>
+#include <net/route.h>
+
+#include "rump_private.h"
+#include "rump_net_private.h"
+
+void ifmplsattach(int);
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET)
+{
+ extern struct domain mplsdomain;
+
+ DOMAINADD(mplsdomain);
+}
+
+RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
+{
+
+ ifmplsattach(0);
+}
diff -r 847e366a5db8 -r 356c7c8379fb sys/rump/net/lib/libnetmpls/shlib_version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/net/lib/libnetmpls/shlib_version Thu Jul 18 15:59:27 2013 +0000
@@ -0,0 +1,4 @@
+# $NetBSD: shlib_version,v 1.1 2013/07/18 15:59:28 kefren Exp $
+#
+major=0
+minor=0
Home |
Main Index |
Thread Index |
Old Index