xref: /titanic_44/usr/src/uts/common/inet/sctp_ip.h (revision 749f21d359d8fbd020c974a1a5227316221bfc9c)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _INET_SCTP_IP_H
28 #define	_INET_SCTP_IP_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #define	SCTP_COMMON_HDR_LENGTH	12	/* SCTP common header length */
37 
38 /* SCTP routines for IP to call. */
39 extern void ip_fanout_sctp(mblk_t *, ill_t *, ipha_t *, uint32_t,
40     uint_t, boolean_t, boolean_t, uint_t, zoneid_t);
41 extern void sctp_ddi_init(void);
42 extern void sctp_ddi_destroy(void);
43 extern conn_t *sctp_find_conn(in6_addr_t *, in6_addr_t *, uint32_t, uint_t,
44     zoneid_t);
45 extern void sctp_input(conn_t *, ipha_t *, mblk_t *, mblk_t *, ill_t *,
46     boolean_t, boolean_t);
47 extern void sctp_wput(queue_t *, mblk_t *);
48 extern void sctp_ootb_input(mblk_t *, ill_t *, uint_t, zoneid_t, boolean_t);
49 extern void sctp_hash_init(void);
50 extern void sctp_hash_destroy(void);
51 extern uint32_t sctp_cksum(mblk_t *, int);
52 extern mblk_t *sctp_snmp_get_mib2(queue_t *, mblk_t *);
53 extern void sctp_free(conn_t *);
54 
55 #define	SCTP_STASH_IPINFO(mp, ire)			\
56 {							\
57 	unsigned char *stp;				\
58 	stp = DB_BASE((mp));				\
59 	ASSERT(stp + sizeof (ire_t *) < (mp)->b_rptr);	\
60 	*(ire_t **)stp  = (ire);			\
61 }
62 
63 #define	SCTP_EXTRACT_IPINFO(mp, ire)			\
64 {							\
65 	unsigned char *stp;				\
66 	stp = (mp)->b_datap->db_base;			\
67 	(ire) = *(ire_t **)stp;				\
68 }
69 
70 /*
71  * SCTP maintains a list of ILLs/IPIFs, these functions are provided by
72  * SCTP to keep its interface list up to date.
73  */
74 extern void sctp_update_ill(ill_t *, int);
75 extern void sctp_update_ipif(ipif_t *, int);
76 extern void sctp_move_ipif(ipif_t *, ill_t *, ill_t *);
77 
78 #define	SCTP_ILL_INSERT		1
79 #define	SCTP_ILL_REMOVE		2
80 #define	SCTP_IPIF_INSERT	3
81 #define	SCTP_IPIF_REMOVE	4
82 #define	SCTP_IPIF_UP		5
83 #define	SCTP_IPIF_DOWN		6
84 #define	SCTP_IPIF_UPDATE	7
85 
86 /* IP routines for SCTP to call. */
87 extern void ip_fanout_sctp_raw(mblk_t *, ill_t *, ipha_t *, boolean_t,
88     uint32_t, boolean_t, uint_t, boolean_t, uint_t, zoneid_t);
89 extern void sctp_ire_cache_flush(ipif_t *);
90 
91 /* SNMP fixed size info */
92 extern mib2_sctp_t sctp_mib;
93 
94 /*
95  * Private (and possibly temporary) ioctls.  It is a large number
96  * to avoid conflict with other ioctls, which are normally smaller
97  * than 2^16.
98  */
99 #define	SCTP_IOC_DEFAULT_Q	(('S' << 16) | 1024)
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* _INET_SCTP_IP_H */
106