xref: /netbsd-src/sys/rump/net/lib/libnetmpls/netmpls_component.c (revision deb6f0161a9109e7de9b519dc8dfb9478668dcdd)
1 /* $NetBSD: netmpls_component.c,v 1.5 2016/08/07 17:42:18 christos Exp $ */
2 
3 /*
4  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
5  *
6  * Development of this software was supported by The Nokia Foundation
7  *
8  * Copyright (c) 2013 The NetBSD Foundation, Inc.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright
17  *    notice, this list of conditions and the following disclaimer in the
18  *    documentation and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
21  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23  * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32 
33 #include <sys/cdefs.h>
34 __KERNEL_RCSID(0, "$NetBSD: netmpls_component.c,v 1.5 2016/08/07 17:42:18 christos Exp $");
35 
36 #include <sys/param.h>
37 #include <sys/domain.h>
38 #include <sys/protosw.h>
39 
40 #include <net/if.h>
41 #include <net/netisr.h>
42 #include <net/route.h>
43 
44 #include <netmpls/mpls_var.h>
45 
46 #include <rump-sys/kern.h>
47 #include <rump-sys/net.h>
48 
49 #include "ioconf.h"
50 
51 RUMP_COMPONENT(RUMP_COMPONENT_NET)
52 {
53 	extern struct domain mplsdomain;
54 
55 	domain_attach(&mplsdomain);
56 
57 	rump_netisr_register(NETISR_MPLS, mplsintr);
58 }
59 
60 RUMP_COMPONENT(RUMP_COMPONENT_NET_IF)
61 {
62 
63 	mplsattach(0);
64 }
65