diff options
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 28 |
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 */ | ||
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 | ||
@@ -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 | ||
300 | extern int xfrm_register_km(struct xfrm_mgr *km); | 317 | extern 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 | ||
659 | extern void xfrm_policy_delete(struct xfrm_policy *pol, int dir); | 676 | extern int xfrm_policy_delete(struct xfrm_policy *pol, int dir); |
660 | 677 | ||
661 | static inline void xfrm_sk_free_policy(struct sock *sk) | 678 | static inline void xfrm_sk_free_policy(struct sock *sk) |
662 | { | 679 | { |
@@ -817,12 +834,13 @@ extern int xfrm_state_add(struct xfrm_state *x); | |||
817 | extern int xfrm_state_update(struct xfrm_state *x); | 834 | 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); | 835 | 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); | 836 | extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); |
820 | extern void xfrm_state_delete(struct xfrm_state *x); | 837 | extern int xfrm_state_delete(struct xfrm_state *x); |
821 | extern void xfrm_state_flush(u8 proto); | 838 | extern void xfrm_state_flush(u8 proto); |
822 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); | 839 | extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); |
823 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); | 840 | extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); |
824 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); | 841 | extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); |
825 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 842 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
843 | extern int xfrm_init_state(struct xfrm_state *x); | ||
826 | extern int xfrm4_rcv(struct sk_buff *skb); | 844 | extern int xfrm4_rcv(struct sk_buff *skb); |
827 | extern int xfrm4_output(struct sk_buff *skb); | 845 | extern int xfrm4_output(struct sk_buff *skb); |
828 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); | 846 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); |