--- /dev/null Fri Apr 4 13:31:05 2008 +++ new/src/sun_nws/idm/hdrs/idm_so.h Fri Apr 4 13:31:05 2008 @@ -0,0 +1,134 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at src/sun_nws/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at src/sun_nws/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _IDM_SO_H +#define _IDM_SO_H + +#pragma ident "@(#)idm_so.h 1.1 08/03/26 SMI" + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* sockets-specific portion of idm_svc_t */ +typedef struct idm_so_svc_s { + struct sonode *is_so; + kthread_t *is_thread; + kt_did_t is_thread_did; + boolean_t is_thread_running; +} idm_so_svc_t; + +/* sockets-specific portion of idm_conn_t */ +typedef struct idm_so_conn_s { + struct sonode *ic_so; + kthread_t *ic_rx_thread; + kt_did_t ic_rx_thread_did; + boolean_t ic_rx_thread_running; +} idm_so_conn_t; + +/* Socket functions */ +idm_status_t idm_so_tgt_svc_create(idm_svc_req_t *sr, struct idm_svc_s *is); + +void idm_so_tgt_svc_destroy(struct idm_svc_s *is); + +idm_status_t idm_so_tgt_svc_online(struct idm_svc_s *is); + +void idm_so_tgt_svc_offline(struct idm_svc_s *is); + +idm_status_t idm_so_tgt_conn_connect(struct idm_conn_s *ic); + +idm_status_t idm_so_ini_conn_create(idm_conn_req_t *cr, struct idm_conn_s *ic); + +void idm_so_ini_conn_destroy(struct idm_conn_s *ic); + +idm_status_t idm_so_ini_conn_connect(struct idm_conn_s *ic); + +void idm_so_ini_conn_disconnect(struct idm_conn_s *ic); + +idm_status_t idm_so_notice_key_values(struct idm_conn_s *it, + nvlist_t *request_nvl, nvlist_t *response_nvl, nvlist_t *negotiated_nvl); + +idm_status_t idm_so_conn_is_capable(idm_conn_req_t *ic, + idm_transport_caps_t *caps); + +struct sonode * +idm_socreate(int domain, int type, int protocol); + +void idm_soshutdown(struct sonode *so); + +void idm_sodestroy(struct sonode *so); + +int idm_sosend(struct sonode *so, void *msg, size_t len); + +int idm_sorecv(struct sonode *so, void *msg, size_t len); + +int idm_sosendto(struct sonode *so, void *buff, size_t len, + struct sockaddr *name, socklen_t namelen); + +int idm_iov_sosend(struct sonode *so, iovec_t *iop, int iovlen, + size_t total_len); + +int idm_iov_sorecv(struct sonode *so, iovec_t *iop, int iovlen, + size_t total_len); + +void idm_so_tx(struct idm_conn_s *ic, struct idm_pdu_s *pdu); + +void idm_so_rx_dataout(struct idm_conn_s *ic, struct idm_pdu_s *pdu); + +void idm_so_rx_datain(struct idm_conn_s *ic, struct idm_pdu_s *pdu); + +void idm_so_rx_rtt(struct idm_conn_s *ic, struct idm_pdu_s *pdu); + +idm_status_t idm_so_buf_tx_to_ini(idm_task_t *idt, idm_buf_t *idb); + +idm_status_t idm_so_buf_rx_from_ini(idm_task_t *idt, idm_buf_t *idb); + +idm_status_t idm_so_buf_setup(idm_buf_t *idb); + +void idm_so_buf_teardown(idm_buf_t *idb); + +size_t idm_sopoll(struct sonode *so, clock_t timeout); + +void idm_sorx_thread(void *arg); + + +int idm_sotx_pdu_constructor(void *pdu_void, void *arg, int flags); + +void idm_sotx_pdu_destructor(void *pdu_void, void *arg); + +int idm_sorx_pdu_constructor(void *pdu_void, void *arg, int flags); + +void idm_sorx_pdu_destructor(void *pdu_void, void *arg); + +void idm_so_svc_port_watcher(void *arg); + + +#ifdef __cplusplus +} +#endif + +#endif /* _IDM_SO_H */