summaryrefslogtreecommitdiffstats
path: root/sys/net/flowtable.h
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2010-03-12 05:03:26 +0000
committerkmacy <kmacy@FreeBSD.org>2010-03-12 05:03:26 +0000
commit128542c7580511b148e26e2929e4d11da27a8e4d (patch)
tree892d80f823d6c6d886b13b8b52823bc01f00c33f /sys/net/flowtable.h
parent7ca6d1bcd1c9d23ec8247d13014708dc09cdb3d5 (diff)
downloadFreeBSD-src-128542c7580511b148e26e2929e4d11da27a8e4d.zip
FreeBSD-src-128542c7580511b148e26e2929e4d11da27a8e4d.tar.gz
- restructure flowtable to support ipv6
- add a name argument to flowtable_alloc for printing with ddb commands - extend ddb commands to print destination address or 4-tuples - don't parse ports in ulp header if FL_HASH_ALL is not passed - add kern_flowtable_insert to enable more generic use of flowtable (e.g. system calls for adding entries) - don't hash loopback addresses - cleanup whitespace - keep statistics per-cpu for per-cpu flowtables to avoid cache line contention - add sysctls to accumulate stats and report aggregate MFC after: 7 days
Diffstat (limited to 'sys/net/flowtable.h')
-rw-r--r--sys/net/flowtable.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/sys/net/flowtable.h b/sys/net/flowtable.h
index 7d7abdf..6e79a3c 100644
--- a/sys/net/flowtable.h
+++ b/sys/net/flowtable.h
@@ -1,6 +1,6 @@
/**************************************************************************
-Copyright (c) 2008-2009, BitGravity Inc.
+Copyright (c) 2008-2010, BitGravity Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,24 +34,49 @@ $FreeBSD$
#ifdef _KERNEL
-#define FL_HASH_PORTS (1<<0) /* hash 4-tuple + protocol */
+#define FL_HASH_ALL (1<<0) /* hash 4-tuple + protocol */
#define FL_PCPU (1<<1) /* pcpu cache */
+#define FL_NOAUTO (1<<2) /* don't automatically add flentry on miss */
+
+#define FL_TCP (1<<11)
+#define FL_SCTP (1<<12)
+#define FL_UDP (1<<13)
+#define FL_DEBUG (1<<14)
+#define FL_DEBUG_ALL (1<<15)
struct flowtable;
+struct flentry;
+struct route;
+struct route_in6;
+
VNET_DECLARE(struct flowtable *, ip_ft);
#define V_ip_ft VNET(ip_ft)
-struct flowtable *flowtable_alloc(int nentry, int flags);
+VNET_DECLARE(struct flowtable *, ip6_ft);
+#define V_ip6_ft VNET(ip6_ft)
+
+struct flowtable *flowtable_alloc(char *name, int nentry, int flags);
/*
* Given a flow table, look up the L3 and L2 information and
* return it in the route.
*
*/
-int flowtable_lookup(struct flowtable *ft, struct mbuf *m,
- struct route *ro, uint32_t fibnum);
+struct flentry *flowtable_lookup_mbuf(struct flowtable *ft, struct mbuf *m, int af);
+
+struct flentry *flowtable_lookup(struct flowtable *ft, struct sockaddr_storage *ssa,
+ struct sockaddr_storage *dsa, uint32_t fibnum, int flags);
+int kern_flowtable_insert(struct flowtable *ft, struct sockaddr_storage *ssa,
+ struct sockaddr_storage *dsa, struct route *ro, uint32_t fibnum, int flags);
+
+void flow_invalidate(struct flentry *fl);
void flowtable_route_flush(struct flowtable *ft, struct rtentry *rt);
+void flow_to_route(struct flentry *fl, struct route *ro);
+
+void flow_to_route_in6(struct flentry *fl, struct route_in6 *ro);
+
+
#endif /* _KERNEL */
#endif
OpenPOWER on IntegriCloud