npf_component.c revision 1.1.4.2 1 1.1.4.2 rmind /* $NetBSD: npf_component.c,v 1.1.4.2 2014/05/18 17:46:20 rmind Exp $ */
2 1.1.4.2 rmind
3 1.1.4.2 rmind /*
4 1.1.4.2 rmind * Public Domain.
5 1.1.4.2 rmind */
6 1.1.4.2 rmind
7 1.1.4.2 rmind #include <sys/cdefs.h>
8 1.1.4.2 rmind __KERNEL_RCSID(0, "$NetBSD: npf_component.c,v 1.1.4.2 2014/05/18 17:46:20 rmind Exp $");
9 1.1.4.2 rmind
10 1.1.4.2 rmind #include <sys/param.h>
11 1.1.4.2 rmind #include <sys/conf.h>
12 1.1.4.2 rmind #include <sys/device.h>
13 1.1.4.2 rmind #include <sys/stat.h>
14 1.1.4.2 rmind
15 1.1.4.2 rmind #include "rump_private.h"
16 1.1.4.2 rmind #include "rump_vfs_private.h"
17 1.1.4.2 rmind
18 1.1.4.2 rmind extern const struct cdevsw npf_cdevsw;
19 1.1.4.2 rmind
20 1.1.4.2 rmind RUMP_COMPONENT(RUMP_COMPONENT_NET)
21 1.1.4.2 rmind {
22 1.1.4.2 rmind devmajor_t bmajor = NODEVMAJOR, cmajor = NODEVMAJOR;
23 1.1.4.2 rmind int error;
24 1.1.4.2 rmind
25 1.1.4.2 rmind error = devsw_attach("npf", NULL, &bmajor, &npf_cdevsw, &cmajor);
26 1.1.4.2 rmind if (error) {
27 1.1.4.2 rmind panic("npf attach failed: %d", error);
28 1.1.4.2 rmind }
29 1.1.4.2 rmind
30 1.1.4.2 rmind error = rump_vfs_makeonedevnode(S_IFCHR, "/dev/npf", cmajor, 0);
31 1.1.4.2 rmind if (error) {
32 1.1.4.2 rmind panic("npf device node creation failed: %d", error);
33 1.1.4.2 rmind }
34 1.1.4.2 rmind devsw_detach(NULL, &npf_cdevsw);
35 1.1.4.2 rmind }
36