8442 uts: startup_bios_disk() should check for BIOS
[unleashed.git] / include / inet / iptun.h
blob7745c8b3d7c8227f2666230174603cefc2da9f28
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _INET_IPTUN_H
27 #define _INET_IPTUN_H
29 #include <sys/socket.h>
30 #include <sys/types.h>
31 #include <sys/dld_ioc.h>
32 #include <netinet/in.h>
33 #include <netinet/ip6.h>
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
40 * from http://www.iana.org/assignments/ip-parameters
42 #define IPTUN_DEFAULT_HOPLIMIT 64
43 /* from RFC 2473 */
44 #define IPTUN_DEFAULT_ENCAPLIMIT 4
46 #define IPTUN_CREATE IPTUNIOC(1)
47 #define IPTUN_DELETE IPTUNIOC(2)
48 #define IPTUN_MODIFY IPTUNIOC(3)
49 #define IPTUN_INFO IPTUNIOC(4)
50 #define IPTUN_SET_6TO4RELAY IPTUNIOC(9)
51 #define IPTUN_GET_6TO4RELAY IPTUNIOC(10)
53 typedef enum {
54 IPTUN_TYPE_UNKNOWN = 0,
55 IPTUN_TYPE_IPV4,
56 IPTUN_TYPE_IPV6,
57 IPTUN_TYPE_6TO4
58 } iptun_type_t;
61 * To maintain proper alignment of fields between 32bit user-land and 64bit
62 * kernel, all fields in iptun_kparams_t after itk_fields must be in
63 * descending order of size. Due to strict structure size checks done in the
64 * iptun ioctl processing, the structure size must be the same on 32 and 64
65 * bit. amd64 will pad the end of the structure to make the end 64bit
66 * aligned, so we must add explicit padding to make sure that it's similarly
67 * aligned when compiled in 32 bit mode.
69 typedef struct iptun_kparams {
70 datalink_id_t iptun_kparam_linkid;
71 uint32_t iptun_kparam_flags;
72 struct sockaddr_storage iptun_kparam_laddr; /* local address */
73 struct sockaddr_storage iptun_kparam_raddr; /* remote address */
74 ipsec_req_t iptun_kparam_secinfo;
75 iptun_type_t iptun_kparam_type;
76 uint32_t _iptun_kparam_padding;
77 } iptun_kparams_t;
79 /* itk_flags */
80 #define IPTUN_KPARAM_TYPE 0x00000001 /* itk_type is set */
81 #define IPTUN_KPARAM_LADDR 0x00000002 /* itk_laddr is set */
82 #define IPTUN_KPARAM_RADDR 0x00000004 /* itk_raddr is set */
83 #define IPTUN_KPARAM_SECINFO 0x00000008 /* itk_secinfo is set */
84 #define IPTUN_KPARAM_IMPLICIT 0x00000010 /* implicitly created IP tunnel */
85 #define IPTUN_KPARAM_IPSECPOL 0x00000020 /* ipsecconf(8) policy present */
87 #ifdef __cplusplus
89 #endif
91 #endif /* _INET_IPTUN_H */