diff options
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r-- | include/net/xfrm.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 0e844845f3f4..688f6f5d3285 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -186,7 +186,8 @@ struct xfrm_state | |||
186 | /* Reference to data common to all the instances of this | 186 | /* Reference to data common to all the instances of this |
187 | * transformer. */ | 187 | * transformer. */ |
188 | struct xfrm_type *type; | 188 | struct xfrm_type *type; |
189 | struct xfrm_mode *mode; | 189 | struct xfrm_mode *inner_mode; |
190 | struct xfrm_mode *outer_mode; | ||
190 | 191 | ||
191 | /* Security context */ | 192 | /* Security context */ |
192 | struct xfrm_sec_ctx *security; | 193 | struct xfrm_sec_ctx *security; |
@@ -228,8 +229,6 @@ struct xfrm_type; | |||
228 | struct xfrm_dst; | 229 | struct xfrm_dst; |
229 | struct xfrm_policy_afinfo { | 230 | struct xfrm_policy_afinfo { |
230 | unsigned short family; | 231 | unsigned short family; |
231 | struct xfrm_type *type_map[IPPROTO_MAX]; | ||
232 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; | ||
233 | struct dst_ops *dst_ops; | 232 | struct dst_ops *dst_ops; |
234 | void (*garbage_collect)(void); | 233 | void (*garbage_collect)(void); |
235 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); | 234 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); |
@@ -255,7 +254,10 @@ extern void km_state_expired(struct xfrm_state *x, int hard, u32 pid); | |||
255 | extern int __xfrm_state_delete(struct xfrm_state *x); | 254 | extern int __xfrm_state_delete(struct xfrm_state *x); |
256 | 255 | ||
257 | struct xfrm_state_afinfo { | 256 | struct xfrm_state_afinfo { |
258 | unsigned short family; | 257 | unsigned int family; |
258 | struct module *owner; | ||
259 | struct xfrm_type *type_map[IPPROTO_MAX]; | ||
260 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; | ||
259 | int (*init_flags)(struct xfrm_state *x); | 261 | int (*init_flags)(struct xfrm_state *x); |
260 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, | 262 | void (*init_tempsel)(struct xfrm_state *x, struct flowi *fl, |
261 | struct xfrm_tmpl *tmpl, | 263 | struct xfrm_tmpl *tmpl, |
@@ -267,8 +269,6 @@ struct xfrm_state_afinfo { | |||
267 | 269 | ||
268 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); | 270 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); |
269 | extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | 271 | extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); |
270 | extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family); | ||
271 | extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo); | ||
272 | 272 | ||
273 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | 273 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); |
274 | 274 | ||
@@ -295,8 +295,6 @@ struct xfrm_type | |||
295 | 295 | ||
296 | extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); | 296 | extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); |
297 | extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); | 297 | extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); |
298 | extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family); | ||
299 | extern void xfrm_put_type(struct xfrm_type *type); | ||
300 | 298 | ||
301 | struct xfrm_mode { | 299 | struct xfrm_mode { |
302 | int (*input)(struct xfrm_state *x, struct sk_buff *skb); | 300 | int (*input)(struct xfrm_state *x, struct sk_buff *skb); |
@@ -314,14 +312,19 @@ struct xfrm_mode { | |||
314 | */ | 312 | */ |
315 | int (*output)(struct xfrm_state *x,struct sk_buff *skb); | 313 | int (*output)(struct xfrm_state *x,struct sk_buff *skb); |
316 | 314 | ||
315 | struct xfrm_state_afinfo *afinfo; | ||
317 | struct module *owner; | 316 | struct module *owner; |
318 | unsigned int encap; | 317 | unsigned int encap; |
318 | int flags; | ||
319 | }; | ||
320 | |||
321 | /* Flags for xfrm_mode. */ | ||
322 | enum { | ||
323 | XFRM_MODE_FLAG_TUNNEL = 1, | ||
319 | }; | 324 | }; |
320 | 325 | ||
321 | extern int xfrm_register_mode(struct xfrm_mode *mode, int family); | 326 | extern int xfrm_register_mode(struct xfrm_mode *mode, int family); |
322 | extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family); | 327 | extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family); |
323 | extern struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family); | ||
324 | extern void xfrm_put_mode(struct xfrm_mode *mode); | ||
325 | 328 | ||
326 | struct xfrm_tmpl | 329 | struct xfrm_tmpl |
327 | { | 330 | { |
@@ -1046,11 +1049,19 @@ extern void xfrm_replay_notify(struct xfrm_state *x, int event); | |||
1046 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 1049 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
1047 | extern int xfrm_init_state(struct xfrm_state *x); | 1050 | extern int xfrm_init_state(struct xfrm_state *x); |
1048 | extern int xfrm_output(struct sk_buff *skb); | 1051 | extern int xfrm_output(struct sk_buff *skb); |
1052 | extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, | ||
1053 | int encap_type); | ||
1049 | extern int xfrm4_rcv(struct sk_buff *skb); | 1054 | extern int xfrm4_rcv(struct sk_buff *skb); |
1055 | |||
1056 | static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) | ||
1057 | { | ||
1058 | return xfrm4_rcv_encap(skb, nexthdr, spi, 0); | ||
1059 | } | ||
1060 | |||
1050 | extern int xfrm4_output(struct sk_buff *skb); | 1061 | extern int xfrm4_output(struct sk_buff *skb); |
1051 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); | 1062 | extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short family); |
1052 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); | 1063 | extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); |
1053 | extern int xfrm6_rcv_spi(struct sk_buff *skb, __be32 spi); | 1064 | extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); |
1054 | extern int xfrm6_rcv(struct sk_buff *skb); | 1065 | extern int xfrm6_rcv(struct sk_buff *skb); |
1055 | extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | 1066 | extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, |
1056 | xfrm_address_t *saddr, u8 proto); | 1067 | xfrm_address_t *saddr, u8 proto); |