Rumpify vlan(4)

This commit is contained in:
ozaki-r 2016-11-26 03:17:58 +00:00
parent 83cbb4a834
commit 6adeabf576
10 changed files with 86 additions and 10 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.790 2016/11/01 14:04:48 christos Exp $
# $NetBSD: shl.mi,v 1.791 2016/11/26 03:17:58 ozaki-r Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@ -742,6 +742,9 @@
./usr/lib/librumpnet_virtif.so base-rump-shlib rump
./usr/lib/librumpnet_virtif.so.0 base-rump-shlib rump
./usr/lib/librumpnet_virtif.so.0.0 base-rump-shlib rump
./usr/lib/librumpnet_vlan.so base-rump-shlib rump
./usr/lib/librumpnet_vlan.so.0 base-rump-shlib rump
./usr/lib/librumpnet_vlan.so.0.0 base-rump-shlib rump
./usr/lib/librumpuser.so base-rump-shlib compatfile,rump
./usr/lib/librumpuser.so.0 base-rump-shlib compatfile,rump
./usr/lib/librumpuser.so.0.1 base-rump-shlib compatfile,rump

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.2074 2016/11/22 03:52:01 kamil Exp $
# $NetBSD: mi,v 1.2075 2016/11/26 03:17:58 ozaki-r Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
./etc/mtree/set.comp comp-sys-root
@ -3571,6 +3571,8 @@
./usr/lib/librumpnet_tun_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_virtif.a comp-c-lib rump
./usr/lib/librumpnet_virtif_p.a comp-c-proflib rump,profile
./usr/lib/librumpnet_vlan.a comp-c-lib rump
./usr/lib/librumpnet_vlan_p.a comp-c-proflib rump,profile
./usr/lib/librumpuser.a comp-c-lib compatfile,rump
./usr/lib/librumpuser_p.a comp-c-proflib compatfile,rump,profile
./usr/lib/librumpvfs.a comp-c-lib compatfile,rump

View File

@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.297 2016/11/01 14:04:48 christos Exp $
# $NetBSD: shl.mi,v 1.298 2016/11/26 03:17:58 ozaki-r Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@ -233,6 +233,7 @@
./usr/lib/librumpnet_tap_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_tun_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_virtif_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpnet_vlan_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpuser_pic.a comp-c-piclib compatfile,picinstall,rump
./usr/lib/librumpvfs_aio_pic.a comp-c-piclib picinstall,rump
./usr/lib/librumpvfs_fifofs_pic.a comp-c-piclib picinstall,rump

View File

@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.179 2016/11/18 22:50:19 kamil Exp $
# $NetBSD: mi,v 1.180 2016/11/26 03:17:58 ozaki-r Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile
@ -225,6 +225,7 @@
./usr/lib/librumpnet_tap_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_tun_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_virtif_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpnet_vlan_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpuser_g.a comp-c-debuglib debuglib,compatfile,rump
./usr/lib/librumpvfs_aio_g.a comp-c-debuglib debuglib,rump
./usr/lib/librumpvfs_fifofs_g.a comp-c-debuglib debuglib,rump

View File

@ -1,3 +1,3 @@
/* $NetBSD: vlan.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* $NetBSD: vlan.h,v 1.2 2016/11/26 03:17:58 ozaki-r Exp $ */
/* dummy */
#define NVLAN 1

View File

@ -1,4 +1,4 @@
/* $NetBSD: net_stub.c,v 1.23 2016/05/12 02:24:17 ozaki-r Exp $ */
/* $NetBSD: net_stub.c,v 1.24 2016/11/26 03:17:58 ozaki-r Exp $ */
/*
* Copyright (c) 2008 Antti Kantee. All Rights Reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.23 2016/05/12 02:24:17 ozaki-r Exp $");
__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.24 2016/11/26 03:17:58 ozaki-r Exp $");
#include <sys/mutex.h>
#include <sys/param.h>
@ -67,6 +67,10 @@ __weak_alias(ieee8023ad_marker_input,rumpnet_stub);
__weak_alias(pppoe_input,rumpnet_stub);
__weak_alias(pppoedisc_input,rumpnet_stub);
/* vlan */
__weak_alias(vlan_input,rumpnet_stub);
__weak_alias(vlan_ifdetach,rumpnet_stub);
struct ifnet_head ifnet_list;
struct pslist_head ifnet_pslist;
struct psref_class *ifnet_psref_class;

View File

@ -1,10 +1,10 @@
# $NetBSD: Makefile.rumpnetcomp,v 1.15 2016/09/05 02:25:38 ozaki-r Exp $
# $NetBSD: Makefile.rumpnetcomp,v 1.16 2016/11/26 03:17:58 ozaki-r Exp $
#
.include <bsd.own.mk>
RUMPNETCOMP= agr bridge net net80211 netbt netinet netinet6
RUMPNETCOMP+= gif netmpls npf local pppoe shmif tap tun
RUMPNETCOMP+= gif netmpls npf local pppoe shmif tap tun vlan
.if ${MKSLJIT} != "no" || make(rumpdescribe)
RUMPNETCOMP+= bpfjit

View File

@ -0,0 +1,15 @@
# $NetBSD $
#
.PATH: ${.CURDIR}/../../../../net
LIB= rumpnet_vlan
COMMENT=IEEE 802.1q encapsulation
IOCONF= VLAN.ioconf
SRCS= if_vlan.c
SRCS+= vlan_component.c
.include <bsd.lib.mk>
.include <bsd.klinks.mk>

View File

@ -0,0 +1,7 @@
# $NetBSD $
ioconf vlan
include "conf/files"
pseudo-device vlan

View File

@ -0,0 +1,43 @@
/* $NetBSD: vlan_component.c,v 1.1 2016/11/26 03:17:58 ozaki-r Exp $ */
/*
* Copyright (c) 2009 Antti Kantee. All Rights Reserved.
* Copyright (c) 2016 Internet Initiative Japan 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: vlan_component.c,v 1.1 2016/11/26 03:17:58 ozaki-r Exp $");
#include <sys/param.h>
#include <rump-sys/kern.h>
int vlanattach(int);
RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
{
vlanattach(0);
}