xref: /illumos-gate/usr/src/uts/common/sys/tsol/tnet.h (revision bd670b35)
145916cd2Sjpk /*
245916cd2Sjpk  * CDDL HEADER START
345916cd2Sjpk  *
445916cd2Sjpk  * The contents of this file are subject to the terms of the
545916cd2Sjpk  * Common Development and Distribution License (the "License").
645916cd2Sjpk  * You may not use this file except in compliance with the License.
745916cd2Sjpk  *
845916cd2Sjpk  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
945916cd2Sjpk  * or http://www.opensolaris.org/os/licensing.
1045916cd2Sjpk  * See the License for the specific language governing permissions
1145916cd2Sjpk  * and limitations under the License.
1245916cd2Sjpk  *
1345916cd2Sjpk  * When distributing Covered Code, include this CDDL HEADER in each
1445916cd2Sjpk  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1545916cd2Sjpk  * If applicable, add the following below this CDDL HEADER, with the
1645916cd2Sjpk  * fields enclosed by brackets "[]" replaced with your own identifying
1745916cd2Sjpk  * information: Portions Copyright [yyyy] [name of copyright owner]
1845916cd2Sjpk  *
1945916cd2Sjpk  * CDDL HEADER END
2045916cd2Sjpk  */
2145916cd2Sjpk /*
225f9878b0Sken Powell - Sun Microsystem  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
2345916cd2Sjpk  * Use is subject to license terms.
2445916cd2Sjpk  *
2545916cd2Sjpk  * from "tnet.h	7.44	02/10/09 SMI; TSOL 2.x"
2645916cd2Sjpk  */
2745916cd2Sjpk 
2845916cd2Sjpk #ifndef	_SYS_TSOL_TNET_H
2945916cd2Sjpk #define	_SYS_TSOL_TNET_H
3045916cd2Sjpk 
3145916cd2Sjpk #include <sys/types.h>
3245916cd2Sjpk #include <sys/stream.h>
3345916cd2Sjpk #include <sys/tsol/label.h>
3445916cd2Sjpk #include <sys/tsol/tndb.h>
3545916cd2Sjpk #include <netinet/in.h>
3645916cd2Sjpk #include <inet/ip.h>
3745916cd2Sjpk #include <net/route.h>
3845916cd2Sjpk 
3945916cd2Sjpk #ifdef	__cplusplus
4045916cd2Sjpk extern "C" {
4145916cd2Sjpk #endif
4245916cd2Sjpk 
4345916cd2Sjpk #ifdef _KERNEL
4445916cd2Sjpk /* Maximum label returned by tsol_compute_label_v6 */
4545916cd2Sjpk #define	TSOL_MAX_IPV6_OPTION	(8 + IP_MAX_OPT_LENGTH)
4645916cd2Sjpk 
4745916cd2Sjpk extern int tsol_tnrh_chk(tsol_tpent_t *, bslabel_t *, int);
48bfabfc35Skp extern tsol_tnrhc_t *find_rhc(const void *, uchar_t, boolean_t);
49*bd670b35SErik Nordmark extern int tsol_check_dest(const ts_label_t *, const void *, uchar_t,
50*bd670b35SErik Nordmark     uint_t, boolean_t, ts_label_t **);
51*bd670b35SErik Nordmark extern int tsol_compute_label_v4(const ts_label_t *, zoneid_t, ipaddr_t,
52*bd670b35SErik Nordmark     uchar_t *, ip_stack_t *);
53*bd670b35SErik Nordmark extern int tsol_compute_label_v6(const ts_label_t *, zoneid_t,
54*bd670b35SErik Nordmark     const in6_addr_t *, uchar_t *, ip_stack_t *);
55*bd670b35SErik Nordmark extern int tsol_check_label_v4(const ts_label_t *, zoneid_t, mblk_t **,
56*bd670b35SErik Nordmark     uint_t, boolean_t, ip_stack_t *, ts_label_t **);
57*bd670b35SErik Nordmark extern int tsol_check_label_v6(const ts_label_t *, zoneid_t, mblk_t **,
58*bd670b35SErik Nordmark     uint_t, boolean_t, ip_stack_t *, ts_label_t **);
5945916cd2Sjpk extern int tsol_prepend_option(uchar_t *, ipha_t *, int);
6045916cd2Sjpk extern int tsol_prepend_option_v6(uchar_t *, ip6_t *, int);
6145916cd2Sjpk extern int tsol_remove_secopt(ipha_t *, int);
6245916cd2Sjpk extern int tsol_remove_secopt_v6(ip6_t *, int);
6345916cd2Sjpk 
6445916cd2Sjpk extern tsol_ire_gw_secattr_t *ire_gw_secattr_alloc(int);
6545916cd2Sjpk extern void ire_gw_secattr_free(tsol_ire_gw_secattr_t *);
6645916cd2Sjpk 
67*bd670b35SErik Nordmark extern boolean_t tsol_can_reply_error(const mblk_t *, ip_recv_attr_t *);
6845916cd2Sjpk extern boolean_t tsol_receive_local(const mblk_t *, const void *, uchar_t,
69*bd670b35SErik Nordmark     ip_recv_attr_t *, const conn_t *);
70*bd670b35SErik Nordmark extern boolean_t tsol_can_accept_raw(mblk_t *, ip_recv_attr_t *, boolean_t);
71*bd670b35SErik Nordmark extern boolean_t tsol_get_pkt_label(mblk_t *, int, ip_recv_attr_t *);
72*bd670b35SErik Nordmark extern zoneid_t tsol_attr_to_zoneid(const ip_recv_attr_t *);
7345916cd2Sjpk 
74c4e55c13Sken Powell - Sun Microsystem extern boolean_t tsol_get_option_v4(mblk_t *, tsol_ip_label_t *, uint8_t **);
75c4e55c13Sken Powell - Sun Microsystem extern boolean_t tsol_get_option_v6(mblk_t *, tsol_ip_label_t *, uint8_t **);
76c4e55c13Sken Powell - Sun Microsystem extern boolean_t tsol_find_secopt_v6(const uchar_t *, uint_t, uchar_t **,
77c4e55c13Sken Powell - Sun Microsystem     uchar_t **, boolean_t *);
7845916cd2Sjpk 
7945916cd2Sjpk extern int tsol_ire_match_gwattr(ire_t *, const ts_label_t *);
8045916cd2Sjpk extern int tsol_rtsa_init(rt_msghdr_t *, tsol_rtsecattr_t *, caddr_t);
81*bd670b35SErik Nordmark extern int tsol_ire_init_gwattr(ire_t *, uchar_t, tsol_gc_t *);
82*bd670b35SErik Nordmark extern mblk_t *tsol_ip_forward(ire_t *, mblk_t *, const ip_recv_attr_t *);
830ec92a15Swy extern uint32_t tsol_pmtu_adjust(mblk_t *, uint32_t, int, int);
8445916cd2Sjpk 
85f4b3ec61Sdh extern mlp_type_t tsol_mlp_addr_type(zoneid_t, uchar_t, const void *,
86f4b3ec61Sdh     ip_stack_t *);
8745916cd2Sjpk extern boolean_t tsol_check_interface_address(const ipif_t *);
8845916cd2Sjpk 
8945916cd2Sjpk #endif /* _KERNEL */
9045916cd2Sjpk 
9145916cd2Sjpk #ifdef	__cplusplus
9245916cd2Sjpk }
9345916cd2Sjpk #endif
9445916cd2Sjpk 
9545916cd2Sjpk #endif	/* _SYS_TSOL_TNET_H */
96