/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _INET_IPTUN_IMPL_H
#define _INET_IPTUN_IMPL_H
#include <sys/dld_impl.h>
#include <sys/netstack.h>
#include <inet/ipclassifier.h>
#include <inet/ipsec_impl.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
typedef struct iptun_encaplim_s {
typedef struct iptun_ipv6hdrs_s {
typedef union iptun_header_u {
typedef struct iptun_addr_s {
union {
} ia_addr;
} iptun_addr_t;
typedef struct iptun_typeinfo {
/*
* An iptun_t represents an IP tunnel link. The iptun_lock protects the
* integrity of all fields except statistics which are updated atomically, and
* is also used by iptun_upcall_cv and iptun_enter_cv. Access to all fields
* must be done under the protection of iptun_lock with the following
* exceptions:
*
* The datapath reads certain fields without locks for performance reasons.
*
* - IPTUN_IS_RUNNING() is used (read access to iptun_flags IPTUN_BOUND and
* IPTUN_MAC_STARTED) to drop packets if they're sent while the tunnel is
* not running. This is harmless as the worst case scenario is that a
* packet will be needlessly sent down to ip and be dropped due to an
* unspecified source or destination.
*/
typedef struct iptun_s {
/* statistics */
} iptun_t;
/* iptun_flags */
/*
* iptuns_lock protects iptuns_iptunlist.
*/
typedef struct iptun_stack {
extern dev_info_t *iptun_dip;
extern mod_hash_t *iptun_hash;
extern kmem_cache_t *iptun_cache;
extern ddi_taskq_t *iptun_taskq;
extern ldi_ident_t iptun_ldi_ident;
extern int iptun_ioc_init(void);
extern void iptun_ioc_fini(void);
extern uint_t iptun_count(void);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _INET_IPTUN_IMPL_H */