xref: /onnv-gate/usr/src/uts/common/sys/tsol/tnet.h (revision 3292:f1a92dc5bc08)
11676Sjpk /*
21676Sjpk  * CDDL HEADER START
31676Sjpk  *
41676Sjpk  * The contents of this file are subject to the terms of the
51676Sjpk  * Common Development and Distribution License (the "License").
61676Sjpk  * You may not use this file except in compliance with the License.
71676Sjpk  *
81676Sjpk  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91676Sjpk  * or http://www.opensolaris.org/os/licensing.
101676Sjpk  * See the License for the specific language governing permissions
111676Sjpk  * and limitations under the License.
121676Sjpk  *
131676Sjpk  * When distributing Covered Code, include this CDDL HEADER in each
141676Sjpk  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151676Sjpk  * If applicable, add the following below this CDDL HEADER, with the
161676Sjpk  * fields enclosed by brackets "[]" replaced with your own identifying
171676Sjpk  * information: Portions Copyright [yyyy] [name of copyright owner]
181676Sjpk  *
191676Sjpk  * CDDL HEADER END
201676Sjpk  */
211676Sjpk /*
221676Sjpk  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
231676Sjpk  * Use is subject to license terms.
241676Sjpk  *
251676Sjpk  * from "tnet.h	7.44	02/10/09 SMI; TSOL 2.x"
261676Sjpk  */
271676Sjpk 
281676Sjpk #ifndef	_SYS_TSOL_TNET_H
291676Sjpk #define	_SYS_TSOL_TNET_H
301676Sjpk 
311676Sjpk #pragma ident	"%Z%%M%	%I%	%E% SMI"
321676Sjpk 
331676Sjpk #include <sys/types.h>
341676Sjpk #include <sys/stream.h>
351676Sjpk #include <sys/tsol/label.h>
361676Sjpk #include <sys/tsol/tndb.h>
371676Sjpk #include <netinet/in.h>
381676Sjpk #include <inet/ip.h>
391676Sjpk #include <net/route.h>
401676Sjpk 
411676Sjpk #ifdef	__cplusplus
421676Sjpk extern "C" {
431676Sjpk #endif
441676Sjpk 
451676Sjpk #ifdef _KERNEL
461676Sjpk /* Maximum label returned by tsol_compute_label_v6 */
471676Sjpk #define	TSOL_MAX_IPV6_OPTION	(8 + IP_MAX_OPT_LENGTH)
481676Sjpk 
491676Sjpk extern int tsol_tnrh_chk(tsol_tpent_t *, bslabel_t *, int);
50*3292Skp158701 extern tsol_tnrhc_t *find_rhc(const void *, uchar_t, boolean_t);
511676Sjpk extern int tsol_compute_label(const cred_t *, ipaddr_t, uchar_t *, boolean_t);
521676Sjpk extern int tsol_compute_label_v6(const cred_t *, const in6_addr_t *, uchar_t *,
531676Sjpk     boolean_t);
541676Sjpk extern int tsol_check_label(const cred_t *, mblk_t **, int *, boolean_t);
551676Sjpk extern int tsol_check_label_v6(const cred_t *, mblk_t **, int *, boolean_t);
561676Sjpk extern int tsol_prepend_option(uchar_t *, ipha_t *, int);
571676Sjpk extern int tsol_prepend_option_v6(uchar_t *, ip6_t *, int);
581676Sjpk extern int tsol_remove_secopt(ipha_t *, int);
591676Sjpk extern int tsol_remove_secopt_v6(ip6_t *, int);
601676Sjpk extern int tsol_update_sticky(ip6_pkt_t *, uint_t *, const uchar_t *);
611676Sjpk extern int tsol_update_options(uchar_t **, uint_t *, uint_t *,
621676Sjpk     const uchar_t *);
631676Sjpk extern boolean_t tsol_option_set(uchar_t **, uint_t *, uint_t, const uchar_t *,
641676Sjpk     uint_t);
651676Sjpk 
661676Sjpk extern tsol_ire_gw_secattr_t *ire_gw_secattr_alloc(int);
671676Sjpk extern void ire_gw_secattr_free(tsol_ire_gw_secattr_t *);
681676Sjpk 
691676Sjpk extern boolean_t tsol_can_reply_error(const mblk_t *);
701676Sjpk extern boolean_t tsol_receive_local(const mblk_t *, const void *, uchar_t,
711676Sjpk     boolean_t, const conn_t *);
721676Sjpk extern boolean_t tsol_can_accept_raw(mblk_t *, boolean_t);
731676Sjpk extern boolean_t tsol_get_pkt_label(mblk_t *, int);
741676Sjpk extern zoneid_t tsol_packet_to_zoneid(const mblk_t *);
751676Sjpk 
761676Sjpk extern tsol_ip_label_t tsol_get_option(mblk_t *, uint8_t **);
771676Sjpk extern uchar_t *tsol_find_secopt_v6(const uchar_t *, uint_t, uchar_t **,
781676Sjpk     boolean_t *);
791676Sjpk 
801676Sjpk extern int tsol_ire_match_gwattr(ire_t *, const ts_label_t *);
811676Sjpk extern int tsol_rtsa_init(rt_msghdr_t *, tsol_rtsecattr_t *, caddr_t);
821676Sjpk extern int tsol_ire_init_gwattr(ire_t *, uchar_t, tsol_gc_t *, tsol_gcgrp_t *);
831676Sjpk extern mblk_t *tsol_ip_forward(ire_t *, mblk_t *);
841676Sjpk 
851676Sjpk extern mlp_type_t tsol_mlp_addr_type(zoneid_t, uchar_t, const void *);
861676Sjpk extern boolean_t tsol_check_interface_address(const ipif_t *);
871676Sjpk 
881676Sjpk #endif /* _KERNEL */
891676Sjpk 
901676Sjpk #ifdef	__cplusplus
911676Sjpk }
921676Sjpk #endif
931676Sjpk 
941676Sjpk #endif	/* _SYS_TSOL_TNET_H */
95