10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 55240Snordmark * Common Development and Distribution License (the "License"). 65240Snordmark * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*6668Smarkfen * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 270Sstevel@tonic-gate 280Sstevel@tonic-gate #include <sys/types.h> 290Sstevel@tonic-gate #include <sys/conf.h> 300Sstevel@tonic-gate #include <sys/errno.h> 310Sstevel@tonic-gate #include <sys/modctl.h> 320Sstevel@tonic-gate #include <inet/common.h> 330Sstevel@tonic-gate #include <inet/ipsec_impl.h> 340Sstevel@tonic-gate 350Sstevel@tonic-gate #define INET_NAME "spdsock" 365240Snordmark #define INET_DEVSTRTAB spdsockinfo 37*6668Smarkfen #define INET_DEVDESC "PF_POLICY socket STREAMS driver" 380Sstevel@tonic-gate #define INET_DEVMINOR 0 390Sstevel@tonic-gate #define INET_DEVMTFLAGS (D_MP | D_MTQPAIR) 400Sstevel@tonic-gate 410Sstevel@tonic-gate #include "../inetddi.c" 420Sstevel@tonic-gate 430Sstevel@tonic-gate int _init(void)440Sstevel@tonic-gate_init(void) 450Sstevel@tonic-gate { 460Sstevel@tonic-gate int error; 470Sstevel@tonic-gate 480Sstevel@tonic-gate if (!spdsock_ddi_init()) 490Sstevel@tonic-gate return (ENOMEM); 500Sstevel@tonic-gate error = mod_install(&modlinkage); 510Sstevel@tonic-gate if (error != 0) 520Sstevel@tonic-gate spdsock_ddi_destroy(); 530Sstevel@tonic-gate 540Sstevel@tonic-gate return (error); 550Sstevel@tonic-gate } 560Sstevel@tonic-gate 570Sstevel@tonic-gate int _fini(void)580Sstevel@tonic-gate_fini(void) 590Sstevel@tonic-gate { 600Sstevel@tonic-gate int error; 610Sstevel@tonic-gate 620Sstevel@tonic-gate error = mod_remove(&modlinkage); 630Sstevel@tonic-gate if (error != 0) 640Sstevel@tonic-gate return (error); 650Sstevel@tonic-gate 660Sstevel@tonic-gate spdsock_ddi_destroy(); 670Sstevel@tonic-gate return (0); 680Sstevel@tonic-gate } 690Sstevel@tonic-gate 700Sstevel@tonic-gate int _info(struct modinfo * modinfop)710Sstevel@tonic-gate_info(struct modinfo *modinfop) 720Sstevel@tonic-gate { 730Sstevel@tonic-gate return (mod_info(&modlinkage, modinfop)); 740Sstevel@tonic-gate } 75