aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index d675836ba6c3..029522a4ceda 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -158,6 +158,20 @@ enum {
158 XFRM_STATE_DEAD 158 XFRM_STATE_DEAD
159}; 159};
160 160
161/* callback structure passed from either netlink or pfkey */
162struct km_event
163{
164 union {
165 u32 hard;
166 u32 proto;
167 u32 byid;
168 } data;
169
170 u32 seq;
171 u32 pid;
172 u32 event;
173};
174
161struct xfrm_type; 175struct xfrm_type;
162struct xfrm_dst; 176struct xfrm_dst;
163struct xfrm_policy_afinfo { 177struct xfrm_policy_afinfo {
@@ -179,6 +193,8 @@ struct xfrm_policy_afinfo {
179 193
180extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); 194extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo);
181extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); 195extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo);
196extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c);
197extern void km_state_notify(struct xfrm_state *x, struct km_event *c);
182 198
183#define XFRM_ACQ_EXPIRES 30 199#define XFRM_ACQ_EXPIRES 30
184 200
@@ -188,6 +204,7 @@ struct xfrm_state_afinfo {
188 rwlock_t lock; 204 rwlock_t lock;
189 struct list_head *state_bydst; 205 struct list_head *state_bydst;
190 struct list_head *state_byspi; 206 struct list_head *state_byspi;
207 int (*init_flags)(struct xfrm_state *x);
191 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, 208 void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl,
192 struct xfrm_tmpl *tmpl, 209 struct xfrm_tmpl *tmpl,
193 xfrm_address_t *daddr, xfrm_address_t *saddr); 210 xfrm_address_t *daddr, xfrm_address_t *saddr);
@@ -209,7 +226,7 @@ struct xfrm_type
209 struct module *owner; 226 struct module *owner;
210 __u8 proto; 227 __u8 proto;
211 228
212 int (*init_state)(struct xfrm_state *x, void *args); 229 int (*init_state)(struct xfrm_state *x);
213 void (*destructor)(struct xfrm_state *); 230 void (*destructor)(struct xfrm_state *);
214 int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); 231 int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb);
215 int (*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); 232 int (*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb);
@@ -290,11 +307,11 @@ struct xfrm_mgr
290{ 307{
291 struct list_head list; 308 struct list_head list;
292 char *id; 309 char *id;
293 int (*notify)(struct xfrm_state *x, int event); 310 int (*notify)(struct xfrm_state *x, struct km_event *c);
294 int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir); 311 int (*acquire)(struct xfrm_state *x, struct xfrm_tmpl *, struct xfrm_policy *xp, int dir);
295 struct xfrm_policy *(*compile_policy)(u16 family, int opt, u8 *data, int len, int *dir); 312 struct xfrm_policy *(*compile_policy)(u16 family, int opt, u8 *data, int len, int *dir);
296 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); 313 int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport);
297 int (*notify_policy)(struct xfrm_policy *x, int dir, int event); 314 int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c);
298}; 315};
299 316
300extern int xfrm_register_km(struct xfrm_mgr *km); 317extern int xfrm_register_km(struct xfrm_mgr *km);
@@ -656,7 +673,7 @@ static inline int xfrm_sk_clone_policy(struct sock *sk)
656 return 0; 673 return 0;
657} 674}
658 675
659extern void xfrm_policy_delete(struct xfrm_policy *pol, int dir); 676extern int xfrm_policy_delete(struct xfrm_policy *pol, int dir);
660 677
661static inline void xfrm_sk_free_policy(struct sock *sk) 678static inline void xfrm_sk_free_policy(struct sock *sk)
662{ 679{
@@ -817,12 +834,13 @@ extern int xfrm_state_add(struct xfrm_state *x);
817extern int xfrm_state_update(struct xfrm_state *x); 834extern int xfrm_state_update(struct xfrm_state *x);
818extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); 835extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family);
819extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); 836extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq);
820extern void xfrm_state_delete(struct xfrm_state *x); 837extern int xfrm_state_delete(struct xfrm_state *x);
821extern void xfrm_state_flush(u8 proto); 838extern void xfrm_state_flush(u8 proto);
822extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); 839extern int xfrm_replay_check(struct xfrm_state *x, u32 seq);
823extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); 840extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq);
824extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); 841extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb);
825extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); 842extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
843extern int xfrm_init_state(struct xfrm_state *x);
826extern int xfrm4_rcv(struct sk_buff *skb); 844extern int xfrm4_rcv(struct sk_buff *skb);
827extern int xfrm4_output(struct sk_buff *skb); 845extern int xfrm4_output(struct sk_buff *skb);
828extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); 846extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);