Home | History | Annotate | Download | only in ip
      1     0    stevel /*
      2     0    stevel  * CDDL HEADER START
      3     0    stevel  *
      4     0    stevel  * The contents of this file are subject to the terms of the
      5  5240  nordmark  * Common Development and Distribution License (the "License").
      6  5240  nordmark  * You may not use this file except in compliance with the License.
      7     0    stevel  *
      8     0    stevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9     0    stevel  * or http://www.opensolaris.org/os/licensing.
     10     0    stevel  * See the License for the specific language governing permissions
     11     0    stevel  * and limitations under the License.
     12     0    stevel  *
     13     0    stevel  * When distributing Covered Code, include this CDDL HEADER in each
     14     0    stevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15     0    stevel  * If applicable, add the following below this CDDL HEADER, with the
     16     0    stevel  * fields enclosed by brackets "[]" replaced with your own identifying
     17     0    stevel  * information: Portions Copyright [yyyy] [name of copyright owner]
     18     0    stevel  *
     19     0    stevel  * CDDL HEADER END
     20     0    stevel  */
     21     0    stevel /*
     22  6668   markfen  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
     23     0    stevel  * Use is subject to license terms.
     24     0    stevel  */
     25     0    stevel 
     26     0    stevel #pragma ident	"%Z%%M%	%I%	%E% SMI"
     27     0    stevel 
     28     0    stevel #include <sys/types.h>
     29     0    stevel #include <sys/conf.h>
     30     0    stevel #include <sys/modctl.h>
     31     0    stevel #include <sys/errno.h>
     32     0    stevel #include <inet/common.h>
     33     0    stevel #include <inet/ip.h>
     34     0    stevel #include <inet/ipsec_impl.h>
     35     0    stevel 
     36     0    stevel #define	INET_NAME	"ipsecah"
     37  5240  nordmark #define	INET_MODSTRTAB	ipsecahinfo
     38  5240  nordmark #define	INET_DEVSTRTAB	ipinfov6
     39  6668   markfen #define	INET_MODDESC	"IPsec AH STREAMS module"
     40  6668   markfen #define	INET_DEVDESC	"IPsec AH STREAMS driver"
     41  5240  nordmark #define	INET_DEVMINOR	0
     42     0    stevel #define	INET_DEVMTFLAGS	IP_DEVMTFLAGS	/* since as a driver we're ip */
     43     0    stevel #define	INET_MODMTFLAGS	(D_MP|D_MTOCEXCL|D_MTOUTPERIM)
     44     0    stevel 
     45     0    stevel #include "../inetddi.c"
     46     0    stevel 
     47     0    stevel int
     48     0    stevel _init(void)
     49     0    stevel {
     50     0    stevel 	int	error;
     51     0    stevel 
     52     0    stevel 	/*
     53     0    stevel 	 * Note: After mod_install succeeds, another thread can enter
     54     0    stevel 	 * therefore all initialization is done before it and any
     55     0    stevel 	 * de-initialization needed done if it fails.
     56     0    stevel 	 */
     57     0    stevel 	if (!ipsecah_ddi_init())
     58     0    stevel 		return (ENOMEM);
     59     0    stevel 
     60     0    stevel 	error = mod_install(&modlinkage);
     61     0    stevel 	if (error != 0)
     62     0    stevel 		ipsecah_ddi_destroy();
     63     0    stevel 
     64     0    stevel 	return (error);
     65     0    stevel }
     66     0    stevel 
     67     0    stevel int
     68     0    stevel _fini(void)
     69     0    stevel {
     70     0    stevel 	int	error;
     71     0    stevel 
     72     0    stevel 	error = mod_remove(&modlinkage);
     73     0    stevel 	if (error != 0)
     74     0    stevel 		return (error);
     75     0    stevel 
     76     0    stevel 	ipsecah_ddi_destroy();
     77     0    stevel 	return (0);
     78     0    stevel }
     79     0    stevel 
     80     0    stevel int
     81     0    stevel _info(struct modinfo *modinfop)
     82     0    stevel {
     83     0    stevel 	return (mod_info(&modlinkage, modinfop));
     84     0    stevel }
     85