diff options
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index d675836ba6c3..0e65e02b7a1d 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 */ | ||
162 | struct 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 | |||
161 | struct xfrm_type; | 175 | struct xfrm_type; |
162 | struct xfrm_dst; | 176 | struct xfrm_dst; |
163 | struct xfrm_policy_afinfo { | 177 | struct xfrm_policy_afinfo { |
@@ -179,6 +193,8 @@ struct xfrm_policy_afinfo { | |||
179 | 193 | ||
180 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); | 194 | extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo); |
181 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); | 195 | extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); |
196 | extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); | ||
197 | extern 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 | ||
@@ -290,11 +306,11 @@ struct xfrm_mgr | |||
290 | { | 306 | { |
291 | struct list_head list; | 307 | struct list_head list; |
292 | char *id; | 308 | char *id; |
293 | int (*notify)(struct xfrm_state *x, int event); | 309 | 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); | 310 | 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); | 311 | 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); | 312 | 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); | 313 | int (*notify_policy)(struct xfrm_policy *x, int dir, struct km_event *c); |
298 | }; | 314 | }; |
299 | 315 | ||
300 | extern int xfrm_register_km(struct xfrm_mgr *km); | 316 | extern int xfrm_register_km(struct xfrm_mgr *km); |
@@ -656,7 +672,7 @@ static inline int xfrm_sk_clone_policy(struct sock *sk) | |||
656 | return 0; | 672 | return 0; |
657 | } | 673 | } |
658 | 674 | ||
659 | extern void xfrm_policy_delete(struct xfrm_policy *pol, int dir); | 675 | extern int xfrm_policy_delete(struct xfrm_policy *pol, int dir); |
660 | 676 | ||
661 | static inline void xfrm_sk_free_policy(struct sock *sk) | 677 | static inline void xfrm_sk_free_policy(struct sock *sk) |
662 | { | 678 | { |
@@ -817,7 +833,7 @@ extern int xfrm_state_add(struct xfrm_state *x); | |||
817 | extern int xfrm_state_update(struct xfrm_state *x); | 833 | extern int xfrm_state_update(struct xfrm_state *x); |
818 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); | 834 | extern struct xfrm_state *xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family); |
819 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); | 835 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); |
820 | extern void xfrm_state_delete(struct xfrm_state *x); | 836 | extern int xfrm_state_delete(struct xfrm_state *x); |
821 | extern void xfrm_state_flush(u8 proto); | 837 | extern void xfrm_state_flush(u8 proto); |
822 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 838 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
823 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 839 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |