socksctp.h revision 419dcee755f59d2dd3409402a75a01822737c1dd
/*
* 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 usr/src/OPENSOLARIS.LICENSE
* 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 usr/src/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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SOCKSCTP_H_
#define _SOCKSCTP_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* SCTP socket structure.
*
* The opaque pointer passed in upcalls is either a pointer to sctp_sonode,
* or sctp_soassoc. The identification is done through the first element
* in data structure (if it cannot be identified by upcall which gets called).
*/
struct sctp_sonode {
int ss_type; /* sonode or soassoc */
};
/*
* Association for 1-N sockets.
*/
struct sctp_soassoc {
int ssa_type;
struct sctp_sonode *ssa_sonode;
int ssa_error; /* same as so_error */
int ssa_wroff;
int ssa_rcv_queued; /* queued rx bytes/# of conn */
};
/* 1-N socket association cache defined in socksctp.c */
/*
* Association array element.
*
* Association data structures for 1-N socket are stored in
* an array in similar manner to file descriptor array.
* Each association is identified by its association ID, which also
* is used as an index to this array (again, like file descriptor number).
*/
struct sctp_sa_id {
struct sctp_soassoc *ssi_assoc;
};
extern sonodeops_t sosctp_sonodeops;
extern sonodeops_t sosctp_seq_sonodeops;
extern sock_upcalls_t sosctp_sock_upcalls;
extern sock_upcalls_t sosctp_assoc_upcalls;
int, int, int, int *, cred_t *);
int kmflags);
int incr);
int type);
struct sctp_soassoc **ssa);
int kmflags);
struct sctp_soassoc **ssap);
struct sctp_soassoc *ssa);
/*
* Data structure types.
*/
#define SOSCTP_SOCKET 0x1
#define SOSCTP_ASSOC 0x2
#define SSA_REFHOLD(ssa) \
{ \
++(ssa)->ssa_refcnt; \
}
{ \
(void *)(ssa), \
if (--(ssa)->ssa_refcnt == 0) { \
} \
}
#ifdef __cplusplus
}
#endif
#endif /* _SOCKSCTP_H_ */