idm_so.h revision a6d42e7d71324c5193c3b94d57d96ba2925d52e1
3853N/A/*
3853N/A * CDDL HEADER START
3853N/A *
3853N/A * The contents of this file are subject to the terms of the
3853N/A * Common Development and Distribution License (the "License").
3853N/A * You may not use this file except in compliance with the License.
3853N/A *
3853N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3853N/A * or http://www.opensolaris.org/os/licensing.
3853N/A * See the License for the specific language governing permissions
3853N/A * and limitations under the License.
3853N/A *
3853N/A * When distributing Covered Code, include this CDDL HEADER in each
3853N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3853N/A * If applicable, add the following below this CDDL HEADER, with the
3853N/A * fields enclosed by brackets "[]" replaced with your own identifying
3853N/A * information: Portions Copyright [yyyy] [name of copyright owner]
3853N/A *
3853N/A * CDDL HEADER END
3853N/A */
3853N/A/*
3853N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3853N/A * Use is subject to license terms.
3853N/A */
5027N/A
3853N/A#ifndef _IDM_SO_H
3853N/A#define _IDM_SO_H
3853N/A
3853N/A#ifdef __cplusplus
4500N/Aextern "C" {
3853N/A#endif
3853N/A
3853N/A#include <sys/idm/idm_transport.h>
3853N/A
3853N/A/*
3853N/A * Define TCP window size (send and receive buffer sizes)
3853N/A */
3853N/A
3853N/A#define IDM_RCVBUF_SIZE (256 * 1024)
3853N/A#define IDM_SNDBUF_SIZE (256 * 1024)
3853N/A
3853N/A/* sockets-specific portion of idm_svc_t */
3853N/Atypedef struct idm_so_svc_s {
3853N/A struct sonode *is_so;
3853N/A kthread_t *is_thread;
3853N/A kt_did_t is_thread_did;
3853N/A boolean_t is_thread_running;
4294N/A} idm_so_svc_t;
4294N/A
3853N/A/* sockets-specific portion of idm_conn_t */
3853N/Atypedef struct idm_so_conn_s {
3853N/A struct sonode *ic_so;
3853N/A
3853N/A kthread_t *ic_tx_thread;
3853N/A kt_did_t ic_tx_thread_did;
3853N/A boolean_t ic_tx_thread_running;
3853N/A kmutex_t ic_tx_mutex;
3853N/A kcondvar_t ic_tx_cv;
3853N/A list_t ic_tx_list; /* List of PDUs for transmit */
3853N/A
3853N/A kthread_t *ic_rx_thread;
4500N/A kt_did_t ic_rx_thread_did;
3853N/A boolean_t ic_rx_thread_running;
3853N/A} idm_so_conn_t;
3853N/A
3853N/Avoid idm_so_init(idm_transport_t *it);
3853N/Avoid idm_so_fini();
3853N/A
3853N/A/* Socket functions */
3853N/A
3853N/Astruct sonode *
3853N/Aidm_socreate(int domain, int type, int protocol);
4136N/A
3853N/Avoid idm_soshutdown(struct sonode *so);
3853N/A
3853N/Avoid idm_sodestroy(struct sonode *so);
3853N/A
3853N/Aint idm_get_ipaddr(idm_addr_list_t **);
3853N/A
3853N/Aint idm_sorecv(struct sonode *so, void *msg, size_t len);
3853N/A
3853N/Aint idm_sosendto(struct sonode *so, void *buff, size_t len,
3853N/A struct sockaddr *name, socklen_t namelen);
3853N/A
3853N/Aint idm_iov_sosend(struct sonode *so, iovec_t *iop, int iovlen,
5085N/A size_t total_len);
3853N/A
3853N/Aint idm_iov_sorecv(struct sonode *so, iovec_t *iop, int iovlen,
3853N/A size_t total_len);
3853N/A
3853N/Avoid idm_sotx_thread(void *arg);
3853N/Avoid idm_sorx_thread(void *arg);
4500N/A
3884N/A
3884N/Aint idm_sotx_pdu_constructor(void *hdl, void *arg, int flags);
4500N/A
4500N/Avoid idm_sotx_pdu_destructor(void *pdu_void, void *arg);
3853N/A
3853N/Aint idm_sorx_pdu_constructor(void *hdl, void *arg, int flags);
3853N/A
4500N/Avoid idm_sorx_pdu_destructor(void *pdu_void, void *arg);
4500N/A
3853N/Avoid idm_so_svc_port_watcher(void *arg);
3853N/A
3853N/A
3853N/A#ifdef __cplusplus
3853N/A}
3853N/A#endif
3853N/A
3853N/A#endif /* _IDM_SO_H */
3853N/A