Unleashed v1.4
[unleashed.git] / kernel / net / ip / keysockddi.c
blobb009e74e86178e38b69a8009c051b98e1c73bfcd
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
28 #include <sys/types.h>
29 #include <sys/conf.h>
30 #include <sys/errno.h>
31 #include <sys/modctl.h>
32 #include <inet/common.h>
33 #include <inet/ipsec_impl.h>
35 #define INET_NAME "keysock"
36 #define INET_MODSTRTAB keysockinfo
37 #define INET_DEVSTRTAB keysockinfo
38 #define INET_MODDESC "PF_KEY socket STREAMS module"
39 #define INET_DEVDESC "PF_KEY socket STREAMS driver"
40 #define INET_DEVMINOR 0
41 #define INET_DEVMTFLAGS (D_MP|D_MTPERMOD|D_MTPUTSHARED)
42 #define INET_MODMTFLAGS INET_DEVMTFLAGS
44 #include "../inetddi.c"
47 struct modlinkage *keysock_modlp = NULL;
49 int
50 _init(void)
52 int error;
54 if (!keysock_ddi_init())
55 return (ENOMEM);
56 error = mod_install(&modlinkage);
57 if (error != 0)
58 keysock_ddi_destroy();
59 else
60 keysock_modlp = &modlinkage;
62 return (error);
65 int
66 _fini(void)
68 int error;
70 error = mod_remove(&modlinkage);
71 if (error != 0)
72 return (error);
74 keysock_ddi_destroy();
75 keysock_modlp = NULL;
76 return (0);
79 int
80 _info(struct modinfo *modinfop)
82 return (mod_info(&modlinkage, modinfop));