xref: /illumos-gate/usr/src/uts/common/inet/tcp/tcpddi.c (revision 0f1702c5201310f0529cd5abb77652e5e9b241b6)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5fc80c0dfSnordmark  * Common Development and Distribution License (the "License").
6fc80c0dfSnordmark  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
2217169044Sbrutus  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate /* Copyright (c) 1990 Mentat Inc. */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #include <sys/types.h>
287c478bd9Sstevel@tonic-gate #include <sys/conf.h>
297c478bd9Sstevel@tonic-gate #include <sys/modctl.h>
307c478bd9Sstevel@tonic-gate #include <inet/common.h>
317c478bd9Sstevel@tonic-gate #include <inet/ip.h>
32*0f1702c5SYu Xiangning #include <inet/tcp_impl.h>
33*0f1702c5SYu Xiangning #include <sys/strsubr.h>
34*0f1702c5SYu Xiangning #include <sys/socketvar.h>
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #define	INET_NAME	"tcp"
37fc80c0dfSnordmark #define	INET_MODSTRTAB	dummymodinfo
38fc80c0dfSnordmark #define	INET_DEVSTRTAB	tcpinfov4
3939b361b2SRichard Bean #define	INET_DEVDESC	"TCP STREAMS driver"
4039b361b2SRichard Bean #define	INET_MODDESC	"TCP dummy STREAMS module"
41*0f1702c5SYu Xiangning #define	INET_SOCKDESC	"TCP socket module"
42*0f1702c5SYu Xiangning #define	INET_SOCK_PROTO_CREATE_FUNC	(*tcp_create)
43*0f1702c5SYu Xiangning #define	INET_SOCK_PROTO_FB_FUNC		(*tcp_fallback)
44fc80c0dfSnordmark #define	INET_DEVMINOR	0
45fc80c0dfSnordmark #define	INET_MODMTFLAGS	D_MP
46ff550d0eSmasputra /*
47ff550d0eSmasputra  * Note that unlike UDP, TCP uses synchronous STREAMS only
48ff550d0eSmasputra  * for TCP Fusion (loopback); this is why we don't define
49fc80c0dfSnordmark  * D_SYNCSTR here.
50ff550d0eSmasputra  */
5117169044Sbrutus #define	INET_DEVMTFLAGS	(D_MP|_D_DIRECT|_D_SODIRECT)
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #include "../inetddi.c"
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate int
567c478bd9Sstevel@tonic-gate _init(void)
577c478bd9Sstevel@tonic-gate {
587c478bd9Sstevel@tonic-gate 	/*
59fc80c0dfSnordmark 	 * device initialization happens when the actual code containing
60fc80c0dfSnordmark 	 * module (/kernel/drv/ip) is loaded, and driven from ip_ddi_init()
617c478bd9Sstevel@tonic-gate 	 */
627c478bd9Sstevel@tonic-gate 	return (mod_install(&modlinkage));
637c478bd9Sstevel@tonic-gate }
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate int
667c478bd9Sstevel@tonic-gate _fini(void)
677c478bd9Sstevel@tonic-gate {
687c478bd9Sstevel@tonic-gate 	return (mod_remove(&modlinkage));
697c478bd9Sstevel@tonic-gate }
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate int
727c478bd9Sstevel@tonic-gate _info(struct modinfo *modinfop)
737c478bd9Sstevel@tonic-gate {
747c478bd9Sstevel@tonic-gate 	return (mod_info(&modlinkage, modinfop));
757c478bd9Sstevel@tonic-gate }
76