xref: /titanic_51/usr/src/uts/common/inet/sctp_ip.h (revision 0f6e7ba6e1c0f032e0e839fdba06b2e0ddb0c0d4)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _INET_SCTP_IP_H
27 #define	_INET_SCTP_IP_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <inet/sctp/sctp_stack.h>
36 
37 #define	SCTP_COMMON_HDR_LENGTH	12	/* SCTP common header length */
38 
39 /* SCTP routines for IP to call. */
40 extern void ip_fanout_sctp(mblk_t *, ill_t *, ipha_t *, uint32_t,
41     uint_t, boolean_t, boolean_t, zoneid_t);
42 extern void sctp_ddi_g_init(void);
43 extern void sctp_ddi_g_destroy(void);
44 extern conn_t *sctp_find_conn(in6_addr_t *, in6_addr_t *, uint32_t,
45     zoneid_t, sctp_stack_t *);
46 extern conn_t *sctp_fanout(in6_addr_t *, in6_addr_t *, uint32_t,
47     zoneid_t, mblk_t *, sctp_stack_t *);
48 
49 extern void sctp_input(conn_t *, ipha_t *, mblk_t *, mblk_t *, ill_t *,
50     boolean_t, boolean_t);
51 extern void sctp_wput(queue_t *, mblk_t *);
52 extern void sctp_ootb_input(mblk_t *, ill_t *, zoneid_t, boolean_t);
53 extern void sctp_hash_init(sctp_stack_t *);
54 extern void sctp_hash_destroy(sctp_stack_t *);
55 extern uint32_t sctp_cksum(mblk_t *, int);
56 extern mblk_t *sctp_snmp_get_mib2(queue_t *, mblk_t *, sctp_stack_t *);
57 extern void sctp_free(conn_t *);
58 
59 #define	SCTP_STASH_IPINFO(mp, ire)			\
60 {							\
61 	unsigned char *stp;				\
62 	stp = DB_BASE((mp));				\
63 	ASSERT(stp + sizeof (ire_t *) < (mp)->b_rptr);	\
64 	*(ire_t **)stp  = (ire);			\
65 }
66 
67 #define	SCTP_EXTRACT_IPINFO(mp, ire)			\
68 {							\
69 	unsigned char *stp;				\
70 	stp = (mp)->b_datap->db_base;			\
71 	(ire) = *(ire_t **)stp;				\
72 }
73 
74 /*
75  * SCTP maintains a list of ILLs/IPIFs, these functions are provided by
76  * SCTP to keep its interface list up to date.
77  */
78 extern void sctp_update_ill(ill_t *, int);
79 extern void sctp_update_ipif(ipif_t *, int);
80 extern void sctp_move_ipif(ipif_t *, ill_t *, ill_t *);
81 extern void sctp_update_ipif_addr(ipif_t *, in6_addr_t);
82 
83 #define	SCTP_ILL_INSERT		1
84 #define	SCTP_ILL_REMOVE		2
85 #define	SCTP_IPIF_INSERT	3
86 #define	SCTP_IPIF_REMOVE	4
87 #define	SCTP_IPIF_UP		5
88 #define	SCTP_IPIF_DOWN		6
89 #define	SCTP_IPIF_UPDATE	7
90 
91 /* IP routines for SCTP to call. */
92 extern void ip_fanout_sctp_raw(mblk_t *, ill_t *, ipha_t *, boolean_t,
93     uint32_t, boolean_t, uint_t, boolean_t, zoneid_t);
94 extern void sctp_ire_cache_flush(ipif_t *);
95 
96 /*
97  * Private (and possibly temporary) ioctls.  It is a large number
98  * to avoid conflict with other ioctls, which are normally smaller
99  * than 2^16.
100  */
101 #define	SCTP_IOC_DEFAULT_Q	(('S' << 16) | 1024)
102 
103 #ifdef __cplusplus
104 }
105 #endif
106 
107 #endif /* _INET_SCTP_IP_H */
108