1*1676Sjpk /* 2*1676Sjpk * CDDL HEADER START 3*1676Sjpk * 4*1676Sjpk * The contents of this file are subject to the terms of the 5*1676Sjpk * Common Development and Distribution License (the "License"). 6*1676Sjpk * You may not use this file except in compliance with the License. 7*1676Sjpk * 8*1676Sjpk * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*1676Sjpk * or http://www.opensolaris.org/os/licensing. 10*1676Sjpk * See the License for the specific language governing permissions 11*1676Sjpk * and limitations under the License. 12*1676Sjpk * 13*1676Sjpk * When distributing Covered Code, include this CDDL HEADER in each 14*1676Sjpk * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*1676Sjpk * If applicable, add the following below this CDDL HEADER, with the 16*1676Sjpk * fields enclosed by brackets "[]" replaced with your own identifying 17*1676Sjpk * information: Portions Copyright [yyyy] [name of copyright owner] 18*1676Sjpk * 19*1676Sjpk * CDDL HEADER END 20*1676Sjpk */ 21*1676Sjpk /* 22*1676Sjpk * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23*1676Sjpk * Use is subject to license terms. 24*1676Sjpk * 25*1676Sjpk * from "tnet.h 7.44 02/10/09 SMI; TSOL 2.x" 26*1676Sjpk */ 27*1676Sjpk 28*1676Sjpk #ifndef _SYS_TSOL_TNET_H 29*1676Sjpk #define _SYS_TSOL_TNET_H 30*1676Sjpk 31*1676Sjpk #pragma ident "%Z%%M% %I% %E% SMI" 32*1676Sjpk 33*1676Sjpk #include <sys/types.h> 34*1676Sjpk #include <sys/stream.h> 35*1676Sjpk #include <sys/tsol/label.h> 36*1676Sjpk #include <sys/tsol/tndb.h> 37*1676Sjpk #include <netinet/in.h> 38*1676Sjpk #include <inet/ip.h> 39*1676Sjpk #include <net/route.h> 40*1676Sjpk 41*1676Sjpk #ifdef __cplusplus 42*1676Sjpk extern "C" { 43*1676Sjpk #endif 44*1676Sjpk 45*1676Sjpk #ifdef _KERNEL 46*1676Sjpk /* Maximum label returned by tsol_compute_label_v6 */ 47*1676Sjpk #define TSOL_MAX_IPV6_OPTION (8 + IP_MAX_OPT_LENGTH) 48*1676Sjpk 49*1676Sjpk extern int tsol_tnrh_chk(tsol_tpent_t *, bslabel_t *, int); 50*1676Sjpk extern tsol_tnrhc_t *find_rhc_v4(const in_addr_t *); 51*1676Sjpk extern tsol_tnrhc_t *find_rhc_v6(const in6_addr_t *); 52*1676Sjpk extern int tsol_compute_label(const cred_t *, ipaddr_t, uchar_t *, boolean_t); 53*1676Sjpk extern int tsol_compute_label_v6(const cred_t *, const in6_addr_t *, uchar_t *, 54*1676Sjpk boolean_t); 55*1676Sjpk extern int tsol_check_label(const cred_t *, mblk_t **, int *, boolean_t); 56*1676Sjpk extern int tsol_check_label_v6(const cred_t *, mblk_t **, int *, boolean_t); 57*1676Sjpk extern int tsol_prepend_option(uchar_t *, ipha_t *, int); 58*1676Sjpk extern int tsol_prepend_option_v6(uchar_t *, ip6_t *, int); 59*1676Sjpk extern int tsol_remove_secopt(ipha_t *, int); 60*1676Sjpk extern int tsol_remove_secopt_v6(ip6_t *, int); 61*1676Sjpk extern int tsol_update_sticky(ip6_pkt_t *, uint_t *, const uchar_t *); 62*1676Sjpk extern int tsol_update_options(uchar_t **, uint_t *, uint_t *, 63*1676Sjpk const uchar_t *); 64*1676Sjpk extern boolean_t tsol_option_set(uchar_t **, uint_t *, uint_t, const uchar_t *, 65*1676Sjpk uint_t); 66*1676Sjpk 67*1676Sjpk extern tsol_ire_gw_secattr_t *ire_gw_secattr_alloc(int); 68*1676Sjpk extern void ire_gw_secattr_free(tsol_ire_gw_secattr_t *); 69*1676Sjpk 70*1676Sjpk extern boolean_t tsol_can_reply_error(const mblk_t *); 71*1676Sjpk extern boolean_t tsol_receive_local(const mblk_t *, const void *, uchar_t, 72*1676Sjpk boolean_t, const conn_t *); 73*1676Sjpk extern boolean_t tsol_can_accept_raw(mblk_t *, boolean_t); 74*1676Sjpk extern boolean_t tsol_get_pkt_label(mblk_t *, int); 75*1676Sjpk extern zoneid_t tsol_packet_to_zoneid(const mblk_t *); 76*1676Sjpk 77*1676Sjpk extern tsol_ip_label_t tsol_get_option(mblk_t *, uint8_t **); 78*1676Sjpk extern uchar_t *tsol_find_secopt_v6(const uchar_t *, uint_t, uchar_t **, 79*1676Sjpk boolean_t *); 80*1676Sjpk 81*1676Sjpk extern int tsol_ire_match_gwattr(ire_t *, const ts_label_t *); 82*1676Sjpk extern int tsol_rtsa_init(rt_msghdr_t *, tsol_rtsecattr_t *, caddr_t); 83*1676Sjpk extern int tsol_ire_init_gwattr(ire_t *, uchar_t, tsol_gc_t *, tsol_gcgrp_t *); 84*1676Sjpk extern mblk_t *tsol_ip_forward(ire_t *, mblk_t *); 85*1676Sjpk 86*1676Sjpk extern mlp_type_t tsol_mlp_addr_type(zoneid_t, uchar_t, const void *); 87*1676Sjpk extern boolean_t tsol_check_interface_address(const ipif_t *); 88*1676Sjpk 89*1676Sjpk #endif /* _KERNEL */ 90*1676Sjpk 91*1676Sjpk #ifdef __cplusplus 92*1676Sjpk } 93*1676Sjpk #endif 94*1676Sjpk 95*1676Sjpk #endif /* _SYS_TSOL_TNET_H */ 96