xref: /titanic_51/usr/src/uts/common/inet/ip_ftable.h (revision bd670b35a010421b6e1a5536c34453a827007c81)
1c793af95Ssangeeta /*
2c793af95Ssangeeta  * CDDL HEADER START
3c793af95Ssangeeta  *
4c793af95Ssangeeta  * The contents of this file are subject to the terms of the
5c793af95Ssangeeta  * Common Development and Distribution License (the "License").
6c793af95Ssangeeta  * You may not use this file except in compliance with the License.
7c793af95Ssangeeta  *
8c793af95Ssangeeta  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9c793af95Ssangeeta  * or http://www.opensolaris.org/os/licensing.
10c793af95Ssangeeta  * See the License for the specific language governing permissions
11c793af95Ssangeeta  * and limitations under the License.
12c793af95Ssangeeta  *
13c793af95Ssangeeta  * When distributing Covered Code, include this CDDL HEADER in each
14c793af95Ssangeeta  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15c793af95Ssangeeta  * If applicable, add the following below this CDDL HEADER, with the
16c793af95Ssangeeta  * fields enclosed by brackets "[]" replaced with your own identifying
17c793af95Ssangeeta  * information: Portions Copyright [yyyy] [name of copyright owner]
18c793af95Ssangeeta  *
19c793af95Ssangeeta  * CDDL HEADER END
20c793af95Ssangeeta  */
21c793af95Ssangeeta 
22c793af95Ssangeeta /*
23*bd670b35SErik Nordmark  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24c793af95Ssangeeta  * Use is subject to license terms.
25c793af95Ssangeeta  */
26c793af95Ssangeeta 
27c793af95Ssangeeta #ifndef _INET_IP_FTABLE_H
28c793af95Ssangeeta #define	_INET_IP_FTABLE_H
29c793af95Ssangeeta 
30c793af95Ssangeeta #ifdef	__cplusplus
31c793af95Ssangeeta extern "C" {
32c793af95Ssangeeta #endif
33c793af95Ssangeeta 
34c793af95Ssangeeta #ifdef 	_KERNEL
35c793af95Ssangeeta 
36c793af95Ssangeeta #include <net/radix.h>
37c793af95Ssangeeta #include <inet/common.h>
38c793af95Ssangeeta #include <inet/ip.h>
39c793af95Ssangeeta 
40c793af95Ssangeeta struct rt_entry {
41c793af95Ssangeeta 	struct	radix_node rt_nodes[2];	/* tree glue, and other values */
42c793af95Ssangeeta 	/*
43c793af95Ssangeeta 	 * struct rt_entry must begin with a struct radix_node (or two!)
44c793af95Ssangeeta 	 * to a 'struct rt_entry *'
45c793af95Ssangeeta 	 */
46c793af95Ssangeeta 	struct rt_sockaddr rt_dst;
47c793af95Ssangeeta 	/*
48c793af95Ssangeeta 	 * multiple routes to same dest/mask via varying gate/ifp are stored
49c793af95Ssangeeta 	 * in the rt_irb bucket.
50c793af95Ssangeeta 	 */
51c793af95Ssangeeta 	irb_t rt_irb;
52c793af95Ssangeeta };
53c793af95Ssangeeta 
54f4b3ec61Sdh155122 /*
55f4b3ec61Sdh155122  * vehicle for passing args through rn_walktree
56f4b3ec61Sdh155122  *
57f4b3ec61Sdh155122  * The comment below (and for other netstack_t references) refers
58f4b3ec61Sdh155122  * to the fact that we only do netstack_hold in particular cases,
59*bd670b35SErik Nordmark  * such as the references from open endpoints (ill_t and conn_t's
60f4b3ec61Sdh155122  * pointers). Internally within IP we rely on IP's ability to cleanup e.g.
61f4b3ec61Sdh155122  * ire_t's when an ill goes away.
62f4b3ec61Sdh155122  */
63c793af95Ssangeeta struct rtfuncarg {
64c793af95Ssangeeta 	pfv_t rt_func;
65c793af95Ssangeeta 	char *rt_arg;
66c793af95Ssangeeta 	uint_t rt_match_flags;
67c793af95Ssangeeta 	uint_t rt_ire_type;
68c793af95Ssangeeta 	ill_t  *rt_ill;
69c793af95Ssangeeta 	zoneid_t rt_zoneid;
70f4b3ec61Sdh155122 	ip_stack_t *rt_ipst;   	/* Does not have a netstack_hold */
71c793af95Ssangeeta };
72c793af95Ssangeeta int rtfunc(struct radix_node *, void *);
73c793af95Ssangeeta 
74c793af95Ssangeeta typedef struct rt_entry rt_t;
75c793af95Ssangeeta typedef struct rtfuncarg rtf_t;
76c793af95Ssangeeta 
77c793af95Ssangeeta struct ts_label_s;
78f4b3ec61Sdh155122 extern	void ire_delete_host_redirects(ipaddr_t, ip_stack_t *);
79c793af95Ssangeeta extern irb_t	*ire_get_bucket(ire_t *);
80c793af95Ssangeeta extern uint_t ifindex_lookup(const struct sockaddr *, zoneid_t);
81c793af95Ssangeeta extern int ipfil_sendpkt(const struct sockaddr *, mblk_t *, uint_t, zoneid_t);
82c793af95Ssangeeta 
832679e103Ssowmini extern void  irb_refhold_rn(struct radix_node *);
842679e103Ssowmini extern void  irb_refrele_rn(struct radix_node *);
85c793af95Ssangeeta 
86c793af95Ssangeeta #endif /* _KERNEL */
87c793af95Ssangeeta 
88c793af95Ssangeeta #ifdef	__cplusplus
89c793af95Ssangeeta }
90c793af95Ssangeeta #endif
91c793af95Ssangeeta 
92c793af95Ssangeeta #endif	/* _INET_IP_FTABLE_H */
93