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.
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.
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]
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
30 #include <sys/types.h>
31 #include <netinet/in.h>
32 #include <inet/iptun.h>
39 typedef struct iptun_params
{
40 datalink_id_t iptun_param_linkid
;
41 uint_t iptun_param_flags
;
42 iptun_type_t iptun_param_type
;
43 char iptun_param_laddr
[NI_MAXHOST
]; /* local address */
44 char iptun_param_raddr
[NI_MAXHOST
]; /* remote address */
45 ipsec_req_t iptun_param_secinfo
;
48 /* iptun_param_flags */
49 #define IPTUN_PARAM_TYPE 0x00000001 /* itp_type is set */
50 #define IPTUN_PARAM_LADDR 0x00000002 /* itp_laddr is set */
51 #define IPTUN_PARAM_RADDR 0x00000004 /* itp_raddr is set */
52 #define IPTUN_PARAM_SECINFO 0x00000008 /* itp_secinfo is set */
53 #define IPTUN_PARAM_IMPLICIT 0x00000010 /* implicitly created IP tunnel */
54 #define IPTUN_PARAM_IPSECPOL 0x00000020 /* IPsec policy exists */
56 extern dladm_status_t
dladm_iptun_create(dladm_handle_t
, const char *,
57 iptun_params_t
*, uint_t
);
58 extern dladm_status_t
dladm_iptun_delete(dladm_handle_t
, datalink_id_t
,
60 extern dladm_status_t
dladm_iptun_modify(dladm_handle_t
,
61 const iptun_params_t
*, uint_t
);
62 extern dladm_status_t
dladm_iptun_getparams(dladm_handle_t
, iptun_params_t
*,
64 extern dladm_status_t
dladm_iptun_up(dladm_handle_t
, datalink_id_t
);
65 extern dladm_status_t
dladm_iptun_down(dladm_handle_t
, datalink_id_t
);
66 extern dladm_status_t
dladm_iptun_set6to4relay(dladm_handle_t
,
68 extern dladm_status_t
dladm_iptun_get6to4relay(dladm_handle_t
,
75 #endif /* _LIBDLIPTUN_H */