ip_stack.h revision 328c7d1fa5cb168d2356ae60c27a09bd3f6f35e8
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _INET_IP_STACK_H
#define _INET_IP_STACK_H
#pragma ident "%Z%%M% %I% %E% SMI"
#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;
/*
* IP stack instances
*/
struct ip_stack {
struct ipndp_s *ips_ndp_arr;
/*
* 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 */
/* protects the list of IPsec capable ills */
struct ipsec_capab_ill_s *ips_ipsec_capab_ills_ah;
/* 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;
struct connf_s *ips_ipcl_proto_fanout_v6;
struct connf_s *ips_ipcl_udp_fanout;
struct connf_s *ips_ipcl_raw_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;
/* This is dynamically allocated in ip_ire_init */
struct irb *ips_ip_cache_table;
#define IPV6_ABITS 128
/* This is dynamically allocated in ip_ire_init */
struct irb *ips_ip_cache_table_v6;
/*
* ire_ft_init_lock is used while initializing ip_forwarding_table
* dynamically in ire_add.
*/
/* pending binds */
/* Synchronize updates with table usage */
struct ip6_asp *ips_ip6_asp_table;
/* The number of policy entries in the table */
int ips_ip_g_forward;
int ips_ipv6_forward;
int ips_ipmp_hook_emulation; /* ndd variable */
struct conn_s *ips_ip_g_mrouter;
/* Time since last icmp_pkt_err */
/* Number of packets sent in burst */
/* Used by icmp_send_redirect_v6 for picking random src. */
/* Protected by ip_mi_lock */
void *ips_ip_g_head; /* Instance Data List Head */
/* Multirouting stuff */
/* Interval (in ms) between consecutive 'bad MTU' warnings */
/* Time since last warning issued. */
struct ipsq_s *ips_ipsq_g_head;
/* When set search for unused index */
/* Time since IRE cache last flushed */
/* ... redirect IREs last flushed */
/* Time since path mtu increase */
/* Num of redirect routes in ftable */
/* Number of IPv6 IRE_DEFAULT entries */
/* Walking IPv6 index used to mod in */
/* 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;
int ips_conn_drain_list_index; /* Next drain_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;
/*
* Reflects value of FAILBACK variable in IPMP config file
* Set to B_FALSE if user disabled failback by configuring
* "FAILBACK=no" in.mpathd uses SIOCSIPMPFAILBACK ioctl to pass this
* information to kernel.
*/
/* ip_neti.c */
/*
* Hooks for firewalling
*/
};
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 */