Commit cdca7265 authored by Miika Komu's avatar Miika Komu Committed by David S. Miller

[IPSEC]: exporting xfrm_state_afinfo

This patch exports xfrm_state_afinfo.
Signed-off-by: default avatarMiika Komu <miika@iki.fi>
Signed-off-by: default avatarDiego Beltrami <Diego.Beltrami@hiit.fi>
Signed-off-by: default avatarKazunori Miyazawa <miyazawa@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 243cb4e5
...@@ -252,10 +252,13 @@ struct xfrm_state_afinfo { ...@@ -252,10 +252,13 @@ struct xfrm_state_afinfo {
xfrm_address_t *daddr, xfrm_address_t *saddr); xfrm_address_t *daddr, xfrm_address_t *saddr);
int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n); int (*tmpl_sort)(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n);
int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n); int (*state_sort)(struct xfrm_state **dst, struct xfrm_state **src, int n);
int (*output)(struct sk_buff *skb);
}; };
extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family);
extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
extern void xfrm_state_delete_tunnel(struct xfrm_state *x); extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
......
...@@ -51,6 +51,7 @@ static struct xfrm_state_afinfo xfrm4_state_afinfo = { ...@@ -51,6 +51,7 @@ static struct xfrm_state_afinfo xfrm4_state_afinfo = {
.family = AF_INET, .family = AF_INET,
.init_flags = xfrm4_init_flags, .init_flags = xfrm4_init_flags,
.init_tempsel = __xfrm4_init_tempsel, .init_tempsel = __xfrm4_init_tempsel,
.output = xfrm4_output,
}; };
void __init xfrm4_state_init(void) void __init xfrm4_state_init(void)
......
...@@ -171,6 +171,7 @@ static struct xfrm_state_afinfo xfrm6_state_afinfo = { ...@@ -171,6 +171,7 @@ static struct xfrm_state_afinfo xfrm6_state_afinfo = {
.init_tempsel = __xfrm6_init_tempsel, .init_tempsel = __xfrm6_init_tempsel,
.tmpl_sort = __xfrm6_tmpl_sort, .tmpl_sort = __xfrm6_tmpl_sort,
.state_sort = __xfrm6_state_sort, .state_sort = __xfrm6_state_sort,
.output = xfrm6_output,
}; };
void __init xfrm6_state_init(void) void __init xfrm6_state_init(void)
......
...@@ -183,9 +183,6 @@ static DEFINE_SPINLOCK(xfrm_state_gc_lock); ...@@ -183,9 +183,6 @@ static DEFINE_SPINLOCK(xfrm_state_gc_lock);
int __xfrm_state_delete(struct xfrm_state *x); int __xfrm_state_delete(struct xfrm_state *x);
static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family);
static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);
void km_state_expired(struct xfrm_state *x, int hard, u32 pid); void km_state_expired(struct xfrm_state *x, int hard, u32 pid);
...@@ -1458,7 +1455,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo) ...@@ -1458,7 +1455,7 @@ int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo)
} }
EXPORT_SYMBOL(xfrm_state_unregister_afinfo); EXPORT_SYMBOL(xfrm_state_unregister_afinfo);
static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family) struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family)
{ {
struct xfrm_state_afinfo *afinfo; struct xfrm_state_afinfo *afinfo;
if (unlikely(family >= NPROTO)) if (unlikely(family >= NPROTO))
...@@ -1470,11 +1467,14 @@ static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family) ...@@ -1470,11 +1467,14 @@ static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family)
return afinfo; return afinfo;
} }
static void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo) void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo)
{ {
read_unlock(&xfrm_state_afinfo_lock); read_unlock(&xfrm_state_afinfo_lock);
} }
EXPORT_SYMBOL(xfrm_state_get_afinfo);
EXPORT_SYMBOL(xfrm_state_put_afinfo);
/* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */ /* Temporarily located here until net/xfrm/xfrm_tunnel.c is created */
void xfrm_state_delete_tunnel(struct xfrm_state *x) void xfrm_state_delete_tunnel(struct xfrm_state *x)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment