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 /* 229710SKen.Powell@Sun.COM * Copyright 2009 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 #include <sys/types.h> 321676Sjpk #include <sys/stream.h> 331676Sjpk #include <sys/tsol/label.h> 341676Sjpk #include <sys/tsol/tndb.h> 351676Sjpk #include <netinet/in.h> 361676Sjpk #include <inet/ip.h> 371676Sjpk #include <net/route.h> 381676Sjpk 391676Sjpk #ifdef __cplusplus 401676Sjpk extern "C" { 411676Sjpk #endif 421676Sjpk 431676Sjpk #ifdef _KERNEL 441676Sjpk /* Maximum label returned by tsol_compute_label_v6 */ 451676Sjpk #define TSOL_MAX_IPV6_OPTION (8 + IP_MAX_OPT_LENGTH) 461676Sjpk 471676Sjpk extern int tsol_tnrh_chk(tsol_tpent_t *, bslabel_t *, int); 483292Skp158701 extern tsol_tnrhc_t *find_rhc(const void *, uchar_t, boolean_t); 49*11042SErik.Nordmark@Sun.COM extern int tsol_check_dest(const ts_label_t *, const void *, uchar_t, 50*11042SErik.Nordmark@Sun.COM uint_t, boolean_t, ts_label_t **); 51*11042SErik.Nordmark@Sun.COM extern int tsol_compute_label_v4(const ts_label_t *, zoneid_t, ipaddr_t, 52*11042SErik.Nordmark@Sun.COM uchar_t *, ip_stack_t *); 53*11042SErik.Nordmark@Sun.COM extern int tsol_compute_label_v6(const ts_label_t *, zoneid_t, 54*11042SErik.Nordmark@Sun.COM const in6_addr_t *, uchar_t *, ip_stack_t *); 55*11042SErik.Nordmark@Sun.COM extern int tsol_check_label_v4(const ts_label_t *, zoneid_t, mblk_t **, 56*11042SErik.Nordmark@Sun.COM uint_t, boolean_t, ip_stack_t *, ts_label_t **); 57*11042SErik.Nordmark@Sun.COM extern int tsol_check_label_v6(const ts_label_t *, zoneid_t, mblk_t **, 58*11042SErik.Nordmark@Sun.COM uint_t, boolean_t, ip_stack_t *, ts_label_t **); 591676Sjpk extern int tsol_prepend_option(uchar_t *, ipha_t *, int); 601676Sjpk extern int tsol_prepend_option_v6(uchar_t *, ip6_t *, int); 611676Sjpk extern int tsol_remove_secopt(ipha_t *, int); 621676Sjpk extern int tsol_remove_secopt_v6(ip6_t *, int); 631676Sjpk 641676Sjpk extern tsol_ire_gw_secattr_t *ire_gw_secattr_alloc(int); 651676Sjpk extern void ire_gw_secattr_free(tsol_ire_gw_secattr_t *); 661676Sjpk 67*11042SErik.Nordmark@Sun.COM extern boolean_t tsol_can_reply_error(const mblk_t *, ip_recv_attr_t *); 681676Sjpk extern boolean_t tsol_receive_local(const mblk_t *, const void *, uchar_t, 69*11042SErik.Nordmark@Sun.COM ip_recv_attr_t *, const conn_t *); 70*11042SErik.Nordmark@Sun.COM extern boolean_t tsol_can_accept_raw(mblk_t *, ip_recv_attr_t *, boolean_t); 71*11042SErik.Nordmark@Sun.COM extern boolean_t tsol_get_pkt_label(mblk_t *, int, ip_recv_attr_t *); 72*11042SErik.Nordmark@Sun.COM extern zoneid_t tsol_attr_to_zoneid(const ip_recv_attr_t *); 731676Sjpk 7410181SKen.Powell@Sun.COM extern boolean_t tsol_get_option_v4(mblk_t *, tsol_ip_label_t *, uint8_t **); 7510181SKen.Powell@Sun.COM extern boolean_t tsol_get_option_v6(mblk_t *, tsol_ip_label_t *, uint8_t **); 7610181SKen.Powell@Sun.COM extern boolean_t tsol_find_secopt_v6(const uchar_t *, uint_t, uchar_t **, 7710181SKen.Powell@Sun.COM uchar_t **, boolean_t *); 781676Sjpk 791676Sjpk extern int tsol_ire_match_gwattr(ire_t *, const ts_label_t *); 801676Sjpk extern int tsol_rtsa_init(rt_msghdr_t *, tsol_rtsecattr_t *, caddr_t); 81*11042SErik.Nordmark@Sun.COM extern int tsol_ire_init_gwattr(ire_t *, uchar_t, tsol_gc_t *); 82*11042SErik.Nordmark@Sun.COM extern mblk_t *tsol_ip_forward(ire_t *, mblk_t *, const ip_recv_attr_t *); 834564Swy83408 extern uint32_t tsol_pmtu_adjust(mblk_t *, uint32_t, int, int); 841676Sjpk 853448Sdh155122 extern mlp_type_t tsol_mlp_addr_type(zoneid_t, uchar_t, const void *, 863448Sdh155122 ip_stack_t *); 871676Sjpk extern boolean_t tsol_check_interface_address(const ipif_t *); 881676Sjpk 891676Sjpk #endif /* _KERNEL */ 901676Sjpk 911676Sjpk #ifdef __cplusplus 921676Sjpk } 931676Sjpk #endif 941676Sjpk 951676Sjpk #endif /* _SYS_TSOL_TNET_H */ 96