From: David S. Miller Date: Sat, 12 Mar 2011 00:23:02 +0000 (-0500) Subject: net: Add flowiX_to_flowi() shorthands. X-Git-Tag: v2.6.39-rc1~468^2~78 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=59b1a94c9a034e63a5e030a5154be1d4d84677d9;p=~shefty%2Frdma-dev.git net: Add flowiX_to_flowi() shorthands. This is just a shorthand which will help in passing around AF specific flow structures as generic ones. Signed-off-by: David S. Miller --- diff --git a/include/net/flow.h b/include/net/flow.h index 931169095cc..8139257ee11 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