xref: /titanic_44/usr/src/uts/common/sys/tsol/tnet.h (revision 44991a1c1bb35cccb6bf99cb6dce14864dcee19c)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  *
25  * from "tnet.h	7.44	02/10/09 SMI; TSOL 2.x"
26  */
27 
28 #ifndef	_SYS_TSOL_TNET_H
29 #define	_SYS_TSOL_TNET_H
30 
31 #include <sys/types.h>
32 #include <sys/stream.h>
33 #include <sys/tsol/label.h>
34 #include <sys/tsol/tndb.h>
35 #include <netinet/in.h>
36 #include <inet/ip.h>
37 #include <net/route.h>
38 
39 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 #ifdef _KERNEL
44 /* Maximum label returned by tsol_compute_label_v6 */
45 #define	TSOL_MAX_IPV6_OPTION	(8 + IP_MAX_OPT_LENGTH)
46 
47 extern int tsol_tnrh_chk(tsol_tpent_t *, bslabel_t *, int);
48 extern tsol_tnrhc_t *find_rhc(const void *, uchar_t, boolean_t);
49 extern int tsol_check_dest(const cred_t *, const void *, uchar_t, boolean_t,
50     cred_t **);
51 extern int tsol_compute_label(const cred_t *, ipaddr_t, uchar_t *,
52     ip_stack_t *);
53 extern int tsol_compute_label_v6(const cred_t *, const in6_addr_t *, uchar_t *,
54     ip_stack_t *);
55 extern int tsol_check_label(const cred_t *, mblk_t **, boolean_t,
56     ip_stack_t *, pid_t);
57 extern int tsol_check_label_v6(const cred_t *, mblk_t **, boolean_t,
58     ip_stack_t *, pid_t);
59 extern int tsol_prepend_option(uchar_t *, ipha_t *, int);
60 extern int tsol_prepend_option_v6(uchar_t *, ip6_t *, int);
61 extern int tsol_remove_secopt(ipha_t *, int);
62 extern int tsol_remove_secopt_v6(ip6_t *, int);
63 extern int tsol_update_sticky(ip6_pkt_t *, uint_t *, const uchar_t *);
64 extern int tsol_update_options(uchar_t **, uint_t *, uint_t *,
65     const uchar_t *);
66 extern boolean_t tsol_option_set(uchar_t **, uint_t *, uint_t, const uchar_t *,
67     uint_t);
68 
69 extern tsol_ire_gw_secattr_t *ire_gw_secattr_alloc(int);
70 extern void ire_gw_secattr_free(tsol_ire_gw_secattr_t *);
71 
72 extern boolean_t tsol_can_reply_error(const mblk_t *);
73 extern boolean_t tsol_receive_local(const mblk_t *, const void *, uchar_t,
74     boolean_t, const conn_t *);
75 extern boolean_t tsol_can_accept_raw(mblk_t *, boolean_t);
76 extern boolean_t tsol_get_pkt_label(mblk_t *, int);
77 extern zoneid_t tsol_packet_to_zoneid(const mblk_t *);
78 
79 extern boolean_t tsol_get_option_v4(mblk_t *, tsol_ip_label_t *, uint8_t **);
80 extern boolean_t tsol_get_option_v6(mblk_t *, tsol_ip_label_t *, uint8_t **);
81 extern boolean_t tsol_find_secopt_v6(const uchar_t *, uint_t, uchar_t **,
82     uchar_t **, boolean_t *);
83 
84 extern int tsol_ire_match_gwattr(ire_t *, const ts_label_t *);
85 extern int tsol_rtsa_init(rt_msghdr_t *, tsol_rtsecattr_t *, caddr_t);
86 extern int tsol_ire_init_gwattr(ire_t *, uchar_t, tsol_gc_t *, tsol_gcgrp_t *);
87 extern mblk_t *tsol_ip_forward(ire_t *, mblk_t *);
88 extern uint32_t tsol_pmtu_adjust(mblk_t *, uint32_t, int, int);
89 
90 extern mlp_type_t tsol_mlp_addr_type(zoneid_t, uchar_t, const void *,
91     ip_stack_t *);
92 extern boolean_t tsol_check_interface_address(const ipif_t *);
93 
94 #endif /* _KERNEL */
95 
96 #ifdef	__cplusplus
97 }
98 #endif
99 
100 #endif	/* _SYS_TSOL_TNET_H */
101