#ifndef _INET_SCTP_ITF_H
#define _INET_SCTP_ITF_H
#ifdef __cplusplus
extern "C" {
#endif
#include <netinet/sctp.h>
#ifdef _KERNEL
#define SCTP_ITF_VER 2
typedef struct sctp_sockbuf_limits_s {
int sbl_rxbuf;
int sbl_rxlowat;
int sbl_txbuf;
int sbl_txlowat;
} sctp_sockbuf_limits_t;
struct sock_upcalls_s;
struct sctp_uc_swap {
void *sus_handle;
struct sock_upcalls_s *sus_upcalls;
};
struct sctp_s;
extern mblk_t *sctp_alloc_hdr(const char *name, int namelen,
const char *control, int controllen, int flags);
extern int sctp_bind(struct sctp_s *conn, struct sockaddr *addr,
socklen_t addrlen);
extern int sctp_bindx(struct sctp_s *conn, const void *addrs, int addrcnt,
int flags);
extern void sctp_close(struct sctp_s *conn);
extern int sctp_connect(struct sctp_s *conn, const struct sockaddr *dst,
socklen_t addrlen, cred_t *cr, pid_t pid);
extern struct sctp_s *sctp_create(void *newhandle, struct sctp_s *parent,
int family, int type, int flags, struct sock_upcalls_s *su,
sctp_sockbuf_limits_t *sbl, cred_t *cr);
extern int sctp_disconnect(struct sctp_s *conn);
extern int sctp_get_opt(struct sctp_s *conn, int level, int opt, void *opts,
socklen_t *optlen);
extern int sctp_getpeername(struct sctp_s *conn, struct sockaddr *addr,
socklen_t *addrlen);
extern int sctp_getsockname(struct sctp_s *conn, struct sockaddr *addr,
socklen_t *addrlen);
extern int sctp_itf_ver(int);
extern int sctp_listen(struct sctp_s *conn);
extern void sctp_recvd(struct sctp_s *conn, int len);
extern int sctp_sendmsg(struct sctp_s *conn, mblk_t *mp, int flags);
extern int sctp_set_opt(struct sctp_s *conn, int level, int opt,
const void *opts, socklen_t optlen);
#define SCTP_CAN_BLOCK 0x01
#define SCTP_NOTIFICATION 0x01
#define SCTP_PARTIAL_DATA 0x02
#define SCTP_UC_SWAP 255
typedef uintptr_t cl_sctp_handle_t;
typedef struct cl_sctp_info_s {
ushort_t cl_sctpi_version;
ushort_t cl_sctpi_family;
ushort_t cl_sctpi_ipversion;
int32_t cl_sctpi_state;
in_port_t cl_sctpi_lport;
in_port_t cl_sctpi_fport;
uint_t cl_sctpi_nladdr;
uchar_t *cl_sctpi_laddrp;
uint_t cl_sctpi_nfaddr;
uchar_t *cl_sctpi_faddrp;
cl_sctp_handle_t cl_sctpi_handle;
} cl_sctp_info_t;
#define CL_SCTPI_V1 1
#define SCTP_CL_LADDR 1
#define SCTP_CL_PADDR 2
extern int cl_sctp_cookie_paddr(sctp_chunk_hdr_t *, in6_addr_t *);
extern int cl_sctp_walk_list(int (*callback)(cl_sctp_info_t *, void *), void *,
boolean_t);
#endif
#ifdef __cplusplus
}
#endif
#endif