Deleted Added
full compact
flowtable.h (197687) flowtable.h (205066)
1/**************************************************************************
2
1/**************************************************************************
2
3Copyright (c) 2008-2009, BitGravity Inc.
3Copyright (c) 2008-2010, BitGravity Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

--- 8 unchanged lines hidden (view full) ---

20LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

--- 8 unchanged lines hidden (view full) ---

20LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28$FreeBSD: head/sys/net/flowtable.h 197687 2009-10-01 20:32:29Z qingli $
28$FreeBSD: head/sys/net/flowtable.h 205066 2010-03-12 05:03:26Z kmacy $
29
30***************************************************************************/
31
32#ifndef _NET_FLOWTABLE_H_
33#define _NET_FLOWTABLE_H_
34
35#ifdef _KERNEL
36
29
30***************************************************************************/
31
32#ifndef _NET_FLOWTABLE_H_
33#define _NET_FLOWTABLE_H_
34
35#ifdef _KERNEL
36
37#define FL_HASH_PORTS (1<<0) /* hash 4-tuple + protocol */
37#define FL_HASH_ALL (1<<0) /* hash 4-tuple + protocol */
38#define FL_PCPU (1<<1) /* pcpu cache */
38#define FL_PCPU (1<<1) /* pcpu cache */
39#define FL_NOAUTO (1<<2) /* don't automatically add flentry on miss */
39
40
41#define FL_TCP (1<<11)
42#define FL_SCTP (1<<12)
43#define FL_UDP (1<<13)
44#define FL_DEBUG (1<<14)
45#define FL_DEBUG_ALL (1<<15)
46
40struct flowtable;
47struct flowtable;
48struct flentry;
49struct route;
50struct route_in6;
51
41VNET_DECLARE(struct flowtable *, ip_ft);
42#define V_ip_ft VNET(ip_ft)
43
52VNET_DECLARE(struct flowtable *, ip_ft);
53#define V_ip_ft VNET(ip_ft)
54
44struct flowtable *flowtable_alloc(int nentry, int flags);
55VNET_DECLARE(struct flowtable *, ip6_ft);
56#define V_ip6_ft VNET(ip6_ft)
45
57
58struct flowtable *flowtable_alloc(char *name, int nentry, int flags);
59
46/*
47 * Given a flow table, look up the L3 and L2 information and
48 * return it in the route.
49 *
50 */
60/*
61 * Given a flow table, look up the L3 and L2 information and
62 * return it in the route.
63 *
64 */
51int flowtable_lookup(struct flowtable *ft, struct mbuf *m,
52 struct route *ro, uint32_t fibnum);
65struct flentry *flowtable_lookup_mbuf(struct flowtable *ft, struct mbuf *m, int af);
53
66
67struct flentry *flowtable_lookup(struct flowtable *ft, struct sockaddr_storage *ssa,
68 struct sockaddr_storage *dsa, uint32_t fibnum, int flags);
69
70int kern_flowtable_insert(struct flowtable *ft, struct sockaddr_storage *ssa,
71 struct sockaddr_storage *dsa, struct route *ro, uint32_t fibnum, int flags);
72
73void flow_invalidate(struct flentry *fl);
54void flowtable_route_flush(struct flowtable *ft, struct rtentry *rt);
55
74void flowtable_route_flush(struct flowtable *ft, struct rtentry *rt);
75
76void flow_to_route(struct flentry *fl, struct route *ro);
77
78void flow_to_route_in6(struct flentry *fl, struct route_in6 *ro);
79
80
56#endif /* _KERNEL */
57#endif
81#endif /* _KERNEL */
82#endif