1*10616SSebastien.Roy@Sun.COM /* 2*10616SSebastien.Roy@Sun.COM * CDDL HEADER START 3*10616SSebastien.Roy@Sun.COM * 4*10616SSebastien.Roy@Sun.COM * The contents of this file are subject to the terms of the 5*10616SSebastien.Roy@Sun.COM * Common Development and Distribution License (the "License"). 6*10616SSebastien.Roy@Sun.COM * You may not use this file except in compliance with the License. 7*10616SSebastien.Roy@Sun.COM * 8*10616SSebastien.Roy@Sun.COM * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*10616SSebastien.Roy@Sun.COM * or http://www.opensolaris.org/os/licensing. 10*10616SSebastien.Roy@Sun.COM * See the License for the specific language governing permissions 11*10616SSebastien.Roy@Sun.COM * and limitations under the License. 12*10616SSebastien.Roy@Sun.COM * 13*10616SSebastien.Roy@Sun.COM * When distributing Covered Code, include this CDDL HEADER in each 14*10616SSebastien.Roy@Sun.COM * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*10616SSebastien.Roy@Sun.COM * If applicable, add the following below this CDDL HEADER, with the 16*10616SSebastien.Roy@Sun.COM * fields enclosed by brackets "[]" replaced with your own identifying 17*10616SSebastien.Roy@Sun.COM * information: Portions Copyright [yyyy] [name of copyright owner] 18*10616SSebastien.Roy@Sun.COM * 19*10616SSebastien.Roy@Sun.COM * CDDL HEADER END 20*10616SSebastien.Roy@Sun.COM */ 21*10616SSebastien.Roy@Sun.COM /* 22*10616SSebastien.Roy@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23*10616SSebastien.Roy@Sun.COM * Use is subject to license terms. 24*10616SSebastien.Roy@Sun.COM */ 25*10616SSebastien.Roy@Sun.COM 26*10616SSebastien.Roy@Sun.COM #ifndef _LIBDLIPTUN_H 27*10616SSebastien.Roy@Sun.COM #define _LIBDLIPTUN_H 28*10616SSebastien.Roy@Sun.COM 29*10616SSebastien.Roy@Sun.COM #include <netdb.h> 30*10616SSebastien.Roy@Sun.COM #include <sys/types.h> 31*10616SSebastien.Roy@Sun.COM #include <netinet/in.h> 32*10616SSebastien.Roy@Sun.COM #include <inet/iptun.h> 33*10616SSebastien.Roy@Sun.COM #include <libdladm.h> 34*10616SSebastien.Roy@Sun.COM 35*10616SSebastien.Roy@Sun.COM #ifdef __cplusplus 36*10616SSebastien.Roy@Sun.COM extern "C" { 37*10616SSebastien.Roy@Sun.COM #endif 38*10616SSebastien.Roy@Sun.COM 39*10616SSebastien.Roy@Sun.COM typedef struct iptun_params { 40*10616SSebastien.Roy@Sun.COM datalink_id_t iptun_param_linkid; 41*10616SSebastien.Roy@Sun.COM uint_t iptun_param_flags; 42*10616SSebastien.Roy@Sun.COM iptun_type_t iptun_param_type; 43*10616SSebastien.Roy@Sun.COM char iptun_param_laddr[NI_MAXHOST]; /* local address */ 44*10616SSebastien.Roy@Sun.COM char iptun_param_raddr[NI_MAXHOST]; /* remote address */ 45*10616SSebastien.Roy@Sun.COM ipsec_req_t iptun_param_secinfo; 46*10616SSebastien.Roy@Sun.COM } iptun_params_t; 47*10616SSebastien.Roy@Sun.COM 48*10616SSebastien.Roy@Sun.COM /* iptun_param_flags */ 49*10616SSebastien.Roy@Sun.COM #define IPTUN_PARAM_TYPE 0x00000001 /* itp_type is set */ 50*10616SSebastien.Roy@Sun.COM #define IPTUN_PARAM_LADDR 0x00000002 /* itp_laddr is set */ 51*10616SSebastien.Roy@Sun.COM #define IPTUN_PARAM_RADDR 0x00000004 /* itp_raddr is set */ 52*10616SSebastien.Roy@Sun.COM #define IPTUN_PARAM_SECINFO 0x00000008 /* itp_secinfo is set */ 53*10616SSebastien.Roy@Sun.COM #define IPTUN_PARAM_IMPLICIT 0x00000010 /* implicitly created IP tunnel */ 54*10616SSebastien.Roy@Sun.COM #define IPTUN_PARAM_IPSECPOL 0x00000020 /* IPsec policy exists */ 55*10616SSebastien.Roy@Sun.COM 56*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_create(dladm_handle_t, const char *, 57*10616SSebastien.Roy@Sun.COM iptun_params_t *, uint_t); 58*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_delete(dladm_handle_t, datalink_id_t, 59*10616SSebastien.Roy@Sun.COM uint_t); 60*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_modify(dladm_handle_t, 61*10616SSebastien.Roy@Sun.COM const iptun_params_t *, uint_t); 62*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_getparams(dladm_handle_t, iptun_params_t *, 63*10616SSebastien.Roy@Sun.COM uint_t); 64*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_up(dladm_handle_t, datalink_id_t); 65*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_down(dladm_handle_t, datalink_id_t); 66*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_set6to4relay(dladm_handle_t, 67*10616SSebastien.Roy@Sun.COM struct in_addr *); 68*10616SSebastien.Roy@Sun.COM extern dladm_status_t dladm_iptun_get6to4relay(dladm_handle_t, 69*10616SSebastien.Roy@Sun.COM struct in_addr *); 70*10616SSebastien.Roy@Sun.COM 71*10616SSebastien.Roy@Sun.COM #ifdef __cplusplus 72*10616SSebastien.Roy@Sun.COM } 73*10616SSebastien.Roy@Sun.COM #endif 74*10616SSebastien.Roy@Sun.COM 75*10616SSebastien.Roy@Sun.COM #endif /* _LIBDLIPTUN_H */ 76