aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-10-18 00:33:12 -0400
committerDavid S. Miller <davem@davemloft.net>2007-10-18 00:33:12 -0400
commit17c2a42a24e1e8dd6aa7cea4f84e034ab1bfff31 (patch)
tree3ee494a16a43f575f8c4900deaab894b73b2953a /include/net
parent1bfcb10f670f5ff5e1d9f53e59680573524cb142 (diff)
[IPSEC]: Store afinfo pointer in xfrm_mode
It is convenient to have a pointer from xfrm_state to address-specific functions such as the output function for a family. Currently the address-specific policy code calls out to the xfrm state code to get those pointers when we could get it in an easier way via the state itself. This patch adds an xfrm_state_afinfo to xfrm_mode (since they're address-specific) and changes the policy code to use it. I've also added an owner field to do reference counting on the module providing the afinfo even though it isn't strictly necessary today since IPv6 can't be unloaded yet. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/xfrm.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 2143f2911a21..f0f3318f6550 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -253,7 +253,8 @@ extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid);
253extern int __xfrm_state_delete(struct xfrm_state *x); 253extern int __xfrm_state_delete(struct xfrm_state *x);
254 254
255struct xfrm_state_afinfo { 255struct xfrm_state_afinfo {
256 unsigned short family; 256 unsigned int family;
257 struct module *owner;
257 struct xfrm_type *type_map[IPPROTO_MAX]; 258 struct xfrm_type *type_map[IPPROTO_MAX];
258 struct xfrm_mode *mode_map[XFRM_MODE_MAX]; 259 struct xfrm_mode *mode_map[XFRM_MODE_MAX];
259 int (*init_flags)(struct xfrm_state *x); 260 int (*init_flags)(struct xfrm_state *x);
@@ -267,8 +268,6 @@ struct xfrm_state_afinfo {
267 268
268extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); 269extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
269extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); 270extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
270extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family);
271extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
272 271
273extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 272extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
274 273
@@ -312,6 +311,7 @@ struct xfrm_mode {
312 */ 311 */
313 int (*output)(struct xfrm_state *x,struct sk_buff *skb); 312 int (*output)(struct xfrm_state *x,struct sk_buff *skb);
314 313
314 struct xfrm_state_afinfo *afinfo;
315 struct module *owner; 315 struct module *owner;
316 unsigned int encap; 316 unsigned int encap;
317 int flags; 317 int flags;