netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 9/25] net: Add flowiX_to_flowi() shorthands.
@ 2011-03-12 23:27 David Miller
  0 siblings, 0 replies; only message in thread
From: David Miller @ 2011-03-12 23:27 UTC (permalink / raw)
  To: netdev


This is just a shorthand which will help in passing around AF
specific flow structures as generic ones.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 include/net/flow.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/net/flow.h b/include/net/flow.h
index 9311690..8139257 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -112,6 +112,21 @@ struct flowi {
 #define fl6_gre_key	u.ip6.uli.gre_key
 } __attribute__((__aligned__(BITS_PER_LONG/8)));
 
+static inline struct flowi *flowi4_to_flowi(struct flowi4 *fl4)
+{
+	return container_of(fl4, struct flowi, u.ip4);
+}
+
+static inline struct flowi *flowi6_to_flowi(struct flowi6 *fl6)
+{
+	return container_of(fl6, struct flowi, u.ip6);
+}
+
+static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn)
+{
+	return container_of(fldn, struct flowi, u.dn);
+}
+
 #define FLOW_DIR_IN	0
 #define FLOW_DIR_OUT	1
 #define FLOW_DIR_FWD	2
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-12 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-12 23:27 [PATCH 9/25] net: Add flowiX_to_flowi() shorthands David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).