ip_ftable.h revision 11042:2d6e217af1b4
190075Sobrien/*
2132718Skan * CDDL HEADER START
390075Sobrien *
490075Sobrien * The contents of this file are subject to the terms of the
590075Sobrien * Common Development and Distribution License (the "License").
690075Sobrien * You may not use this file except in compliance with the License.
790075Sobrien *
890075Sobrien * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
990075Sobrien * or http://www.opensolaris.org/os/licensing.
1090075Sobrien * See the License for the specific language governing permissions
1190075Sobrien * and limitations under the License.
1290075Sobrien *
1390075Sobrien * When distributing Covered Code, include this CDDL HEADER in each
1490075Sobrien * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1590075Sobrien * If applicable, add the following below this CDDL HEADER, with the
1690075Sobrien * fields enclosed by brackets "[]" replaced with your own identifying
1790075Sobrien * information: Portions Copyright [yyyy] [name of copyright owner]
1890075Sobrien *
1990075Sobrien * CDDL HEADER END
2090075Sobrien */
2190075Sobrien
2290075Sobrien/*
2390075Sobrien * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24117395Skan * Use is subject to license terms.
2590075Sobrien */
2690075Sobrien
2790075Sobrien#ifndef _INET_IP_FTABLE_H
2890075Sobrien#define	_INET_IP_FTABLE_H
2990075Sobrien
3090075Sobrien#ifdef	__cplusplus
3190075Sobrienextern "C" {
3290075Sobrien#endif
3390075Sobrien
3490075Sobrien#ifdef 	_KERNEL
3590075Sobrien
3690075Sobrien#include <net/radix.h>
3790075Sobrien#include <inet/common.h>
3890075Sobrien#include <inet/ip.h>
3990075Sobrien
4090075Sobrienstruct rt_entry {
4190075Sobrien	struct	radix_node rt_nodes[2];	/* tree glue, and other values */
4290075Sobrien	/*
4390075Sobrien	 * struct rt_entry must begin with a struct radix_node (or two!)
4490075Sobrien	 * to a 'struct rt_entry *'
4590075Sobrien	 */
4690075Sobrien	struct rt_sockaddr rt_dst;
4790075Sobrien	/*
4890075Sobrien	 * multiple routes to same dest/mask via varying gate/ifp are stored
4990075Sobrien	 * in the rt_irb bucket.
5090075Sobrien	 */
5190075Sobrien	irb_t rt_irb;
52117395Skan};
53117395Skan
54117395Skan/*
5590075Sobrien * vehicle for passing args through rn_walktree
5690075Sobrien *
5790075Sobrien * The comment below (and for other netstack_t references) refers
5890075Sobrien * to the fact that we only do netstack_hold in particular cases,
5990075Sobrien * such as the references from open endpoints (ill_t and conn_t's
6090075Sobrien * pointers). Internally within IP we rely on IP's ability to cleanup e.g.
6190075Sobrien * ire_t's when an ill goes away.
6290075Sobrien */
6390075Sobrienstruct rtfuncarg {
6490075Sobrien	pfv_t rt_func;
6590075Sobrien	char *rt_arg;
6690075Sobrien	uint_t rt_match_flags;
6790075Sobrien	uint_t rt_ire_type;
6890075Sobrien	ill_t  *rt_ill;
6990075Sobrien	zoneid_t rt_zoneid;
7090075Sobrien	ip_stack_t *rt_ipst;   	/* Does not have a netstack_hold */
7190075Sobrien};
7290075Sobrienint rtfunc(struct radix_node *, void *);
7390075Sobrien
7490075Sobrientypedef struct rt_entry rt_t;
7590075Sobrientypedef struct rtfuncarg rtf_t;
7690075Sobrien
7790075Sobrienstruct ts_label_s;
7890075Sobrienextern	void ire_delete_host_redirects(ipaddr_t, ip_stack_t *);
79132718Skanextern irb_t	*ire_get_bucket(ire_t *);
80132718Skanextern uint_t ifindex_lookup(const struct sockaddr *, zoneid_t);
8190075Sobrienextern int ipfil_sendpkt(const struct sockaddr *, mblk_t *, uint_t, zoneid_t);
8290075Sobrien
8390075Sobrienextern void  irb_refhold_rn(struct radix_node *);
8490075Sobrienextern void  irb_refrele_rn(struct radix_node *);
8590075Sobrien
8690075Sobrien#endif /* _KERNEL */
87117395Skan
88117395Skan#ifdef	__cplusplus
8990075Sobrien}
9090075Sobrien#endif
91132718Skan
92117395Skan#endif	/* _INET_IP_FTABLE_H */
93117395Skan