diff options
author | David S. Miller <davem@davemloft.net> | 2011-03-11 19:23:02 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-12 18:08:47 -0500 |
commit | 59b1a94c9a034e63a5e030a5154be1d4d84677d9 (patch) | |
tree | 218ffc79cd1fc4aaaf51feafeb1fad1e8e5295b2 | |
parent | 56bb8059e1a8bf291054c26367564dc302f6fd8f (diff) |
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 <davem@davemloft.net>
-rw-r--r-- | 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 931169095cc9..8139257ee11e 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
@@ -112,6 +112,21 @@ struct flowi { | |||
112 | #define fl6_gre_key u.ip6.uli.gre_key | 112 | #define fl6_gre_key u.ip6.uli.gre_key |
113 | } __attribute__((__aligned__(BITS_PER_LONG/8))); | 113 | } __attribute__((__aligned__(BITS_PER_LONG/8))); |
114 | 114 | ||
115 | static inline struct flowi *flowi4_to_flowi(struct flowi4 *fl4) | ||
116 | { | ||
117 | return container_of(fl4, struct flowi, u.ip4); | ||
118 | } | ||
119 | |||
120 | static inline struct flowi *flowi6_to_flowi(struct flowi6 *fl6) | ||
121 | { | ||
122 | return container_of(fl6, struct flowi, u.ip6); | ||
123 | } | ||
124 | |||
125 | static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn) | ||
126 | { | ||
127 | return container_of(fldn, struct flowi, u.dn); | ||
128 | } | ||
129 | |||
115 | #define FLOW_DIR_IN 0 | 130 | #define FLOW_DIR_IN 0 |
116 | #define FLOW_DIR_OUT 1 | 131 | #define FLOW_DIR_OUT 1 |
117 | #define FLOW_DIR_FWD 2 | 132 | #define FLOW_DIR_FWD 2 |