ip_stack.h revision 6e91bba0d6c6bdabbba62cefae583715a4a58e2a
/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _INET_IP_STACK_H
#define _INET_IP_STACK_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/netstack.h>
#include <netinet/igmp_var.h>
#ifdef _KERNEL
/*
* IP statistics.
*/
#define IP_STAT_UPDATE(ipst, x, n) \
typedef struct ip_stat {
} ip_stat_t;
/*
* IP6 statistics.
*/
#define IP6_STAT_UPDATE(ipst, x, n) \
typedef struct ip6_stat {
} ip6_stat_t;
typedef struct ire_stats {
} ire_stats_t;
#define TX_FANOUT_SIZE 128
#define IDLHASHINDEX(X) \
/* Data structure to represent addresses */
typedef struct srcid_map {
} srcid_map_t;
/*
* IP stack instances
*/
struct ip_stack {
/*
* IPv6 mibs when the interface (ill) is not known.
* When the ill is known the per-interface mib in the ill is used.
*/
struct igmpstat ips_igmpstat;
/* ip.c */
/* Taskq dispatcher for capability operations */
/* ipclassifier.c - keep in ip_stack_t */
/* ipclassifier hash tables */
struct connf_s *ips_rts_clients;
struct connf_s *ips_ipcl_conn_fanout;
struct connf_s *ips_ipcl_bind_fanout;
struct connf_s *ips_ipcl_proto_fanout_v4;
struct connf_s *ips_ipcl_proto_fanout_v6;
struct connf_s *ips_ipcl_udp_fanout;
struct connf_s *ips_ipcl_iptun_fanout;
struct connf_s *ips_ipcl_globalhash_fanout;
int ips_conn_g_index;
/* ip.c */
/* Following protected by igmp_timer_lock */
int ips_igmp_time_to_next; /* Time since last timeout */
/* Following protected by mld_timer_lock */
int ips_mld_time_to_next; /* Time since last timeout */
/* Protected by igmp_slowtimeout_lock */
/* Protected by mld_slowtimeout_lock */
/* IPv4 forwarding table */
struct radix_node_head *ips_ip_ftable;
#define IPV6_ABITS 128
/*
* ire_ft_init_lock is used while initializing ip_forwarding_table
* dynamically in ire_add.
*/
/*
* This is the IPv6 counterpart of RADIX_NODE_HEAD_LOCK. It is used
* to prevent adds and deletes while we are doing a ftable_lookup
* and extracting the ire_generation.
*/
/* Count how many condemned objects for kmem_cache callbacks */
/* ips_ire_dep_lock protects ire_dep_* relationship between IREs */
/* Destination Cache Entries */
struct dce_s *ips_dce_default;
struct dcb_s *ips_dce_hash_v4;
struct dcb_s *ips_dce_hash_v6;
/* pending binds */
/* Synchronize updates with table usage */
struct ip6_asp *ips_ip6_asp_table;
/* The number of policy entries in the table */
struct conn_s *ips_ip_g_mrouter;
/* Time since last icmp_pkt_err */
/* Number of packets sent in burst */
/* Protected by ip_mi_lock */
void *ips_ip_g_head; /* IP Instance Data List Head */
void *ips_arp_g_head; /* ARP Instance Data List Head */
/* Multirouting stuff */
/* Interval (in ms) between consecutive 'bad MTU' warnings */
/* Time since last warning issued. */
/*
* CGTP hooks. Enabling and disabling of hooks is controlled by an
* IP tunable 'ips_ip_cgtp_filter'.
*/
struct cgtp_filter_ops *ips_ip_cgtp_filter_ops;
struct ipsq_s *ips_ipsq_g_head;
/* When set search for unused index */
/* ip_mroute stuff */
/* numvifs is only a hint about the max interface being used. */
/*
* One-back cache used to locate a tunnel's vif,
* given a datagram's src ip address.
*/
struct vif *ips_last_encap_vif;
/*
* reg_vif_num is protected by numvifs_mutex
*/
/* Whether or not special PIM assert processing is enabled. */
int ips_pim_assert;
/* Array of conn drain lists */
struct idl_tx_list_s *ips_idl_tx_list;
/*
* ID used to assign next free one.
* Increases by one. Once it wraps we search for an unused ID.
*/
struct srcid_map *ips_srcid_head;
/* ip_netinfo.c */
/*
* Hooks for firewalling
*/
struct __ldi_ident *ips_ldi_ident;
/* ipmp.c */
};
typedef struct ip_stack ip_stack_t;
/* Finding an ip_stack_t */
#else /* _KERNEL */
typedef int ip_stack_t;
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _INET_IP_STACK_H */