74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * CDDL HEADER START
74e20cfe817b82802b16fac8690dadcda76f54f5nh *
74e20cfe817b82802b16fac8690dadcda76f54f5nh * The contents of this file are subject to the terms of the
74e20cfe817b82802b16fac8690dadcda76f54f5nh * Common Development and Distribution License (the "License").
74e20cfe817b82802b16fac8690dadcda76f54f5nh * You may not use this file except in compliance with the License.
74e20cfe817b82802b16fac8690dadcda76f54f5nh *
74e20cfe817b82802b16fac8690dadcda76f54f5nh * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
74e20cfe817b82802b16fac8690dadcda76f54f5nh * or http://www.opensolaris.org/os/licensing.
74e20cfe817b82802b16fac8690dadcda76f54f5nh * See the License for the specific language governing permissions
74e20cfe817b82802b16fac8690dadcda76f54f5nh * and limitations under the License.
74e20cfe817b82802b16fac8690dadcda76f54f5nh *
74e20cfe817b82802b16fac8690dadcda76f54f5nh * When distributing Covered Code, include this CDDL HEADER in each
74e20cfe817b82802b16fac8690dadcda76f54f5nh * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
74e20cfe817b82802b16fac8690dadcda76f54f5nh * If applicable, add the following below this CDDL HEADER, with the
74e20cfe817b82802b16fac8690dadcda76f54f5nh * fields enclosed by brackets "[]" replaced with your own identifying
74e20cfe817b82802b16fac8690dadcda76f54f5nh * information: Portions Copyright [yyyy] [name of copyright owner]
74e20cfe817b82802b16fac8690dadcda76f54f5nh *
74e20cfe817b82802b16fac8690dadcda76f54f5nh * CDDL HEADER END
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
74e20cfe817b82802b16fac8690dadcda76f54f5nh * Use is subject to license terms.
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#ifndef _INET_SDP_ITF_H
74e20cfe817b82802b16fac8690dadcda76f54f5nh#define _INET_SDP_ITF_H
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#pragma ident "%Z%%M% %I% %E% SMI"
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#ifdef __cplusplus
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern "C" {
74e20cfe817b82802b16fac8690dadcda76f54f5nh#endif
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * Kernel SDP programming interface. Note that this interface
74e20cfe817b82802b16fac8690dadcda76f54f5nh * is private to Sun and can be changed without notice.
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#ifdef _KERNEL
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * The version number of the SDP kernel interface. Use it with
74e20cfe817b82802b16fac8690dadcda76f54f5nh * sdp_itf_ver() to verify if the kernel supports the correct
74e20cfe817b82802b16fac8690dadcda76f54f5nh * version of the interface.
74e20cfe817b82802b16fac8690dadcda76f54f5nh *
74e20cfe817b82802b16fac8690dadcda76f54f5nh * NOTE: do not assume backward compatibility of the interface.
74e20cfe817b82802b16fac8690dadcda76f54f5nh * If the return value of sdp_itf_ver() is different from what
74e20cfe817b82802b16fac8690dadcda76f54f5nh * is expected, do not call any of the routines.
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nh#define SDP_ITF_VER 1
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * This struct holds all the upcalls the SDP kernel module will
74e20cfe817b82802b16fac8690dadcda76f54f5nh * invoke for different events. When calling sdp_create() to create
74e20cfe817b82802b16fac8690dadcda76f54f5nh * a SDP handle, the caller must provide this information.
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nhtypedef struct sdp_upcalls_s {
74e20cfe817b82802b16fac8690dadcda76f54f5nh void * (*su_newconn)(void *parenthandle, void *connind);
74e20cfe817b82802b16fac8690dadcda76f54f5nh void (*su_connected)(void *handle);
74e20cfe817b82802b16fac8690dadcda76f54f5nh void (*su_disconnected)(void *handle, int error);
74e20cfe817b82802b16fac8690dadcda76f54f5nh void (*su_connfailed)(void *handle, int error);
74e20cfe817b82802b16fac8690dadcda76f54f5nh int (*su_recv)(void *handle, mblk_t *mp, int flags);
74e20cfe817b82802b16fac8690dadcda76f54f5nh void (*su_xmitted)(void *handle, int writeable);
74e20cfe817b82802b16fac8690dadcda76f54f5nh void (*su_urgdata)(void *handle);
74e20cfe817b82802b16fac8690dadcda76f54f5nh void (*su_ordrel)(void *handle);
74e20cfe817b82802b16fac8690dadcda76f54f5nh} sdp_upcalls_t;
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * This struct holds various flow control limits the caller of
74e20cfe817b82802b16fac8690dadcda76f54f5nh * sdp_create() should observe when interacting with SDP.
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nhtypedef struct sdp_sockbuf_limits_s {
74e20cfe817b82802b16fac8690dadcda76f54f5nh int sbl_rxbuf;
74e20cfe817b82802b16fac8690dadcda76f54f5nh int sbl_rxlowat;
74e20cfe817b82802b16fac8690dadcda76f54f5nh int sbl_txbuf;
74e20cfe817b82802b16fac8690dadcda76f54f5nh int sbl_txlowat;
74e20cfe817b82802b16fac8690dadcda76f54f5nh} sdp_sockbuf_limits_t;
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nhstruct sdp_conn_struct_t;
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh/*
74e20cfe817b82802b16fac8690dadcda76f54f5nh * The list of routines the SDP kernel module provides.
74e20cfe817b82802b16fac8690dadcda76f54f5nh */
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_bind(struct sdp_conn_struct_t *conn, struct sockaddr *addr,
74e20cfe817b82802b16fac8690dadcda76f54f5nh socklen_t addrlen);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern void sdp_close(struct sdp_conn_struct_t *conn);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_connect(struct sdp_conn_struct_t *conn,
74e20cfe817b82802b16fac8690dadcda76f54f5nh const struct sockaddr *dst, socklen_t addrlen);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern struct sdp_conn_struct_t *sdp_create(void *newhandle,
74e20cfe817b82802b16fac8690dadcda76f54f5nh struct sdp_conn_struct_t *parent, int family, int flags,
74e20cfe817b82802b16fac8690dadcda76f54f5nh const sdp_upcalls_t *su, sdp_sockbuf_limits_t *sbl, cred_t *cr,
74e20cfe817b82802b16fac8690dadcda76f54f5nh int *error);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_disconnect(struct sdp_conn_struct_t *conn, int flags);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_shutdown(struct sdp_conn_struct_t *conn, int flag);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_polldata(struct sdp_conn_struct_t *conn, int flag);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_get_opt(struct sdp_conn_struct_t *conn, int level, int opt,
74e20cfe817b82802b16fac8690dadcda76f54f5nh void *opts, socklen_t *optlen);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_getpeername(struct sdp_conn_struct_t *conn,
74e20cfe817b82802b16fac8690dadcda76f54f5nh struct sockaddr *addr, socklen_t *addrlen);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_getsockname(struct sdp_conn_struct_t *conn,
74e20cfe817b82802b16fac8690dadcda76f54f5nh struct sockaddr *addr, socklen_t *addrlen);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_itf_ver(int);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_listen(struct sdp_conn_struct_t *conn, int backlog);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_send(struct sdp_conn_struct_t *conn, struct msghdr *msg,
74e20cfe817b82802b16fac8690dadcda76f54f5nh size_t size, int flags, struct uio *uiop);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_recv(struct sdp_conn_struct_t *conn, struct msghdr *msg,
74e20cfe817b82802b16fac8690dadcda76f54f5nh size_t size, int flags, struct uio *uiop);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_set_opt(struct sdp_conn_struct_t *conn, int level, int opt,
74e20cfe817b82802b16fac8690dadcda76f54f5nh const void *opts, socklen_t optlen);
74e20cfe817b82802b16fac8690dadcda76f54f5nhextern int sdp_ioctl(struct sdp_conn_struct_t *conn, int cmd, int32_t *value,
74e20cfe817b82802b16fac8690dadcda76f54f5nh struct cred *cr);
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh/* Flags for sdp_create() */
74e20cfe817b82802b16fac8690dadcda76f54f5nh#define SDP_CAN_BLOCK 0x01
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#define SDP_READ 0x01
74e20cfe817b82802b16fac8690dadcda76f54f5nh#define SDP_XMIT 0x02
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#endif /* _KERNEL */
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#define SDP_NODELAY 0x01
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#ifdef __cplusplus
74e20cfe817b82802b16fac8690dadcda76f54f5nh}
74e20cfe817b82802b16fac8690dadcda76f54f5nh#endif
74e20cfe817b82802b16fac8690dadcda76f54f5nh
74e20cfe817b82802b16fac8690dadcda76f54f5nh#endif /* _INET_SDP_ITF_H */