flowtable.h revision 194076
1/************************************************************************** 2 3Copyright (c) 2008-2009, 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 12 2. Neither the name of the BitGravity Corporation nor the names of its 13 contributors may be used to endorse or promote products derived from 14 this software without specific prior written permission. 15 16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 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 194076 2009-06-12 20:46:36Z bz $ 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 */ 38#define FL_PCPU (1<<1) /* pcpu cache */ 39 40struct flowtable; 41extern struct flowtable *ip_ft; 42extern struct flowtable *ip_forward_ft; 43 44struct flowtable *flowtable_alloc(int nentry, int flags); 45 46/* 47 * Given a flow table, look up the L3 and L2 information and 48 * return it in the route 49 * 50 */ 51int flowtable_lookup(struct flowtable *ft, struct mbuf *m, 52 struct route *ro); 53 54#endif 55 56#endif 57