xref: /illumos-gate/usr/src/uts/common/inet/sctp_ip.h (revision 45916cd2)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*45916cd2Sjpk  * Common Development and Distribution License (the "License").
6*45916cd2Sjpk  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*45916cd2Sjpk  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef _INET_SCTP_IP_H
277c478bd9Sstevel@tonic-gate #define	_INET_SCTP_IP_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef __cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #define	SCTP_COMMON_HDR_LENGTH	12	/* SCTP common header length */
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /* SCTP routines for IP to call. */
387c478bd9Sstevel@tonic-gate extern void ip_fanout_sctp(mblk_t *, ill_t *, ipha_t *, uint32_t,
397c478bd9Sstevel@tonic-gate     uint_t, boolean_t, boolean_t, uint_t, zoneid_t);
407c478bd9Sstevel@tonic-gate extern void sctp_ddi_init(void);
417c478bd9Sstevel@tonic-gate extern void sctp_ddi_destroy(void);
427c478bd9Sstevel@tonic-gate extern conn_t *sctp_find_conn(in6_addr_t *, in6_addr_t *, uint32_t, uint_t,
437c478bd9Sstevel@tonic-gate     zoneid_t);
44*45916cd2Sjpk extern conn_t *sctp_fanout(in6_addr_t *, in6_addr_t *, uint32_t, uint_t,
45*45916cd2Sjpk     zoneid_t, mblk_t *);
46*45916cd2Sjpk 
477c478bd9Sstevel@tonic-gate extern void sctp_input(conn_t *, ipha_t *, mblk_t *, mblk_t *, ill_t *,
487c478bd9Sstevel@tonic-gate     boolean_t, boolean_t);
497c478bd9Sstevel@tonic-gate extern void sctp_wput(queue_t *, mblk_t *);
507c478bd9Sstevel@tonic-gate extern void sctp_ootb_input(mblk_t *, ill_t *, uint_t, zoneid_t, boolean_t);
517c478bd9Sstevel@tonic-gate extern void sctp_hash_init(void);
527c478bd9Sstevel@tonic-gate extern void sctp_hash_destroy(void);
537c478bd9Sstevel@tonic-gate extern uint32_t sctp_cksum(mblk_t *, int);
547c478bd9Sstevel@tonic-gate extern mblk_t *sctp_snmp_get_mib2(queue_t *, mblk_t *);
557c478bd9Sstevel@tonic-gate extern void sctp_free(conn_t *);
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate #define	SCTP_STASH_IPINFO(mp, ire)			\
587c478bd9Sstevel@tonic-gate {							\
597c478bd9Sstevel@tonic-gate 	unsigned char *stp;				\
607c478bd9Sstevel@tonic-gate 	stp = DB_BASE((mp));				\
617c478bd9Sstevel@tonic-gate 	ASSERT(stp + sizeof (ire_t *) < (mp)->b_rptr);	\
627c478bd9Sstevel@tonic-gate 	*(ire_t **)stp  = (ire);			\
637c478bd9Sstevel@tonic-gate }
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate #define	SCTP_EXTRACT_IPINFO(mp, ire)			\
667c478bd9Sstevel@tonic-gate {							\
677c478bd9Sstevel@tonic-gate 	unsigned char *stp;				\
687c478bd9Sstevel@tonic-gate 	stp = (mp)->b_datap->db_base;			\
697c478bd9Sstevel@tonic-gate 	(ire) = *(ire_t **)stp;				\
707c478bd9Sstevel@tonic-gate }
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate /*
737c478bd9Sstevel@tonic-gate  * SCTP maintains a list of ILLs/IPIFs, these functions are provided by
747c478bd9Sstevel@tonic-gate  * SCTP to keep its interface list up to date.
757c478bd9Sstevel@tonic-gate  */
767c478bd9Sstevel@tonic-gate extern void sctp_update_ill(ill_t *, int);
777c478bd9Sstevel@tonic-gate extern void sctp_update_ipif(ipif_t *, int);
787c478bd9Sstevel@tonic-gate extern void sctp_move_ipif(ipif_t *, ill_t *, ill_t *);
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate #define	SCTP_ILL_INSERT		1
817c478bd9Sstevel@tonic-gate #define	SCTP_ILL_REMOVE		2
827c478bd9Sstevel@tonic-gate #define	SCTP_IPIF_INSERT	3
837c478bd9Sstevel@tonic-gate #define	SCTP_IPIF_REMOVE	4
847c478bd9Sstevel@tonic-gate #define	SCTP_IPIF_UP		5
857c478bd9Sstevel@tonic-gate #define	SCTP_IPIF_DOWN		6
867c478bd9Sstevel@tonic-gate #define	SCTP_IPIF_UPDATE	7
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate /* IP routines for SCTP to call. */
897c478bd9Sstevel@tonic-gate extern void ip_fanout_sctp_raw(mblk_t *, ill_t *, ipha_t *, boolean_t,
907c478bd9Sstevel@tonic-gate     uint32_t, boolean_t, uint_t, boolean_t, uint_t, zoneid_t);
917c478bd9Sstevel@tonic-gate extern void sctp_ire_cache_flush(ipif_t *);
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate /* SNMP fixed size info */
947c478bd9Sstevel@tonic-gate extern mib2_sctp_t sctp_mib;
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate /*
977c478bd9Sstevel@tonic-gate  * Private (and possibly temporary) ioctls.  It is a large number
987c478bd9Sstevel@tonic-gate  * to avoid conflict with other ioctls, which are normally smaller
997c478bd9Sstevel@tonic-gate  * than 2^16.
1007c478bd9Sstevel@tonic-gate  */
1017c478bd9Sstevel@tonic-gate #define	SCTP_IOC_DEFAULT_Q	(('S' << 16) | 1024)
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate #ifdef __cplusplus
1047c478bd9Sstevel@tonic-gate }
1057c478bd9Sstevel@tonic-gate #endif
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate #endif /* _INET_SCTP_IP_H */
108