Merge commit '508de9f313d4260d23954085ed866e727901964c'
[unleashed/lotheac.git] / include / inet / sctp_itf.h
blobd3e22194a476d5ee291e4200c452717fc64612fa
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _INET_SCTP_ITF_H
27 #define _INET_SCTP_ITF_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 #include <netinet/sctp.h>
36 * Kernel SCTP programming interface. Note that this interface
37 * is private to Sun and can be changed without notice.
40 #ifdef _KERNEL
43 * The version number of the SCTP kernel interface. Use it with
44 * sctp_itf_ver() to verify if the kernel supports the correct
45 * version of the interface.
47 * NOTE: do not assume backward compatibility of the interface.
48 * If the return value of sctp_itf_ver() is different from what
49 * is expected, do not call any of the routines.
51 #define SCTP_ITF_VER 2
54 * This struct holds various flow control limits the caller of
55 * sctp_create() should observe when interacting with SCTP.
57 typedef struct sctp_sockbuf_limits_s {
58 int sbl_rxbuf;
59 int sbl_rxlowat;
60 int sbl_txbuf;
61 int sbl_txlowat;
62 } sctp_sockbuf_limits_t;
65 * Parameter to SCTP_UC_SWAP setsockopt
67 struct sock_upcalls_s;
68 struct sctp_uc_swap {
69 void *sus_handle;
70 struct sock_upcalls_s *sus_upcalls;
73 struct sctp_s;
76 * The list of routines the SCTP kernel module provides.
78 extern mblk_t *sctp_alloc_hdr(const char *name, int namelen,
79 const char *control, int controllen, int flags);
80 extern int sctp_bind(struct sctp_s *conn, struct sockaddr *addr,
81 socklen_t addrlen);
82 extern int sctp_bindx(struct sctp_s *conn, const void *addrs, int addrcnt,
83 int flags);
84 extern void sctp_close(struct sctp_s *conn);
85 extern int sctp_connect(struct sctp_s *conn, const struct sockaddr *dst,
86 socklen_t addrlen, cred_t *cr, pid_t pid);
87 extern struct sctp_s *sctp_create(void *newhandle, struct sctp_s *parent,
88 int family, int type, int flags, struct sock_upcalls_s *su,
89 sctp_sockbuf_limits_t *sbl, cred_t *cr);
90 extern int sctp_disconnect(struct sctp_s *conn);
91 extern int sctp_get_opt(struct sctp_s *conn, int level, int opt, void *opts,
92 socklen_t *optlen);
93 extern int sctp_getpeername(struct sctp_s *conn, struct sockaddr *addr,
94 socklen_t *addrlen);
95 extern int sctp_getsockname(struct sctp_s *conn, struct sockaddr *addr,
96 socklen_t *addrlen);
97 extern int sctp_itf_ver(int);
98 extern int sctp_listen(struct sctp_s *conn);
99 extern void sctp_recvd(struct sctp_s *conn, int len);
100 extern int sctp_sendmsg(struct sctp_s *conn, mblk_t *mp, int flags);
101 extern int sctp_set_opt(struct sctp_s *conn, int level, int opt,
102 const void *opts, socklen_t optlen);
104 /* Flags for sctp_create(), sctp_alloc_hdr() */
105 #define SCTP_CAN_BLOCK 0x01
107 /* Flags for upcall su_recv() */
108 #define SCTP_NOTIFICATION 0x01 /* message is a notification */
109 #define SCTP_PARTIAL_DATA 0x02 /* not a full message */
111 /* Use by sockfs to do sctp_peeloff(). */
112 #define SCTP_UC_SWAP 255
114 #endif /* _KERNEL */
116 #ifdef __cplusplus
118 #endif
120 #endif /* _INET_SCTP_ITF_H */