Module Name: src
Committed By: kefren
Date: Thu Jul 18 15:59:28 UTC 2013
Modified Files:
src/sys/rump/librump/rumpnet: netisr.c
src/sys/rump/net: Makefile.rumpnetcomp
src/sys/rump/net/lib/libnet: Makefile
src/sys/rump/net/lib/libnet/opt: opt_mpls.h
Added Files:
src/sys/rump/net/lib/libnetmpls: Makefile Makefile.inc component.c
shlib_version
Log Message:
Add librumpnet_netmpls that provides MPLS features into rump kernels
ok'ed pooka@
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/librump/rumpnet/netisr.c
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/net/Makefile.rumpnetcomp
cvs rdiff -u -r1.17 -r1.18 src/sys/rump/net/lib/libnet/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/rump/net/lib/libnet/opt/opt_mpls.h
cvs rdiff -u -r0 -r1.1 src/sys/rump/net/lib/libnetmpls/Makefile \
src/sys/rump/net/lib/libnetmpls/Makefile.inc \
src/sys/rump/net/lib/libnetmpls/component.c \
src/sys/rump/net/lib/libnetmpls/shlib_version
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/librump/rumpnet/netisr.c
diff -u src/sys/rump/librump/rumpnet/netisr.c:1.5 src/sys/rump/librump/rumpnet/netisr.c:1.6
--- src/sys/rump/librump/rumpnet/netisr.c:1.5 Thu Dec 30 16:19:39 2010
+++ src/sys/rump/librump/rumpnet/netisr.c Thu Jul 18 15:59:27 2013
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: netisr.c,v 1
#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 @@ __netisr_stub(void)
__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 @@ rump_netisr_init(void)
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 @@ rump_netisr_init(void)
(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);
}
Index: src/sys/rump/net/Makefile.rumpnetcomp
diff -u src/sys/rump/net/Makefile.rumpnetcomp:1.5 src/sys/rump/net/Makefile.rumpnetcomp:1.6
--- src/sys/rump/net/Makefile.rumpnetcomp:1.5 Wed Aug 15 17:56:58 2012
+++ src/sys/rump/net/Makefile.rumpnetcomp Thu Jul 18 15:59:27 2013
@@ -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
Index: src/sys/rump/net/lib/libnet/Makefile
diff -u src/sys/rump/net/lib/libnet/Makefile:1.17 src/sys/rump/net/lib/libnet/Makefile:1.18
--- src/sys/rump/net/lib/libnet/Makefile:1.17 Sat Jun 1 10:54:24 2013
+++ src/sys/rump/net/lib/libnet/Makefile Thu Jul 18 15:59:28 2013
@@ -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+= -I${.CURDIR}/opt -I${.CURDIR}
CPPFLAGS+= -DCOMPAT_OIFREQ -DCOMPAT_OIFDATA
.include "${.CURDIR}/../libnetinet/Makefile.inc"
+.include "${.CURDIR}/../libnetmpls/Makefile.inc"
.include <bsd.lib.mk>
.include <bsd.klinks.mk>
Index: src/sys/rump/net/lib/libnet/opt/opt_mpls.h
diff -u src/sys/rump/net/lib/libnet/opt/opt_mpls.h:1.1 src/sys/rump/net/lib/libnet/opt/opt_mpls.h:1.2
--- src/sys/rump/net/lib/libnet/opt/opt_mpls.h:1.1 Sat Jun 26 14:24:28 2010
+++ src/sys/rump/net/lib/libnet/opt/opt_mpls.h Thu Jul 18 15:59:28 2013
@@ -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
Added files:
Index: src/sys/rump/net/lib/libnetmpls/Makefile
diff -u /dev/null src/sys/rump/net/lib/libnetmpls/Makefile:1.1
--- /dev/null Thu Jul 18 15:59:28 2013
+++ src/sys/rump/net/lib/libnetmpls/Makefile Thu Jul 18 15:59:28 2013
@@ -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>
Index: src/sys/rump/net/lib/libnetmpls/Makefile.inc
diff -u /dev/null src/sys/rump/net/lib/libnetmpls/Makefile.inc:1.1
--- /dev/null Thu Jul 18 15:59:28 2013
+++ src/sys/rump/net/lib/libnetmpls/Makefile.inc Thu Jul 18 15:59:28 2013
@@ -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
Index: src/sys/rump/net/lib/libnetmpls/component.c
diff -u /dev/null src/sys/rump/net/lib/libnetmpls/component.c:1.1
--- /dev/null Thu Jul 18 15:59:28 2013
+++ src/sys/rump/net/lib/libnetmpls/component.c Thu Jul 18 15:59:28 2013
@@ -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);
+}
Index: src/sys/rump/net/lib/libnetmpls/shlib_version
diff -u /dev/null src/sys/rump/net/lib/libnetmpls/shlib_version:1.1
--- /dev/null Thu Jul 18 15:59:28 2013
+++ src/sys/rump/net/lib/libnetmpls/shlib_version Thu Jul 18 15:59:28 2013
@@ -0,0 +1,4 @@
+# $NetBSD: shlib_version,v 1.1 2013/07/18 15:59:28 kefren Exp $
+#
+major=0
+minor=0