diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-11-14 00:44:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:53:50 -0500 |
commit | 716062fd4c2f88a33ab409f62a1e7397ad0a7e33 (patch) | |
tree | 73f2618fe99bca3870a0dbdc35acf6466ab3b976 /include | |
parent | c6581a457e661b7070e484ad723bbf555b17aca2 (diff) |
[IPSEC]: Merge most of the input path
As part of the work on asynchronous cryptographic operations, we need
to be able to resume from the spot where they occur. As such, it
helps if we isolate them to one spot.
This patch moves most of the remaining family-specific processing into
the common input code.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/xfrm.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 99677207a4ce..329de412c0ba 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -274,6 +274,8 @@ struct xfrm_state_afinfo { | |||
274 | struct sk_buff *skb); | 274 | struct sk_buff *skb); |
275 | int (*extract_output)(struct xfrm_state *x, | 275 | int (*extract_output)(struct xfrm_state *x, |
276 | struct sk_buff *skb); | 276 | struct sk_buff *skb); |
277 | int (*transport_finish)(struct sk_buff *skb, | ||
278 | int async); | ||
277 | }; | 279 | }; |
278 | 280 | ||
279 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); | 281 | extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); |
@@ -522,6 +524,22 @@ struct xfrm_mode_skb_cb { | |||
522 | 524 | ||
523 | #define XFRM_MODE_SKB_CB(__skb) ((struct xfrm_mode_skb_cb *)&((__skb)->cb[0])) | 525 | #define XFRM_MODE_SKB_CB(__skb) ((struct xfrm_mode_skb_cb *)&((__skb)->cb[0])) |
524 | 526 | ||
527 | /* | ||
528 | * This structure is used by the input processing to locate the SPI and | ||
529 | * related information. | ||
530 | */ | ||
531 | struct xfrm_spi_skb_cb { | ||
532 | union { | ||
533 | struct inet_skb_parm h4; | ||
534 | struct inet6_skb_parm h6; | ||
535 | } header; | ||
536 | |||
537 | unsigned int nhoff; | ||
538 | unsigned int daddroff; | ||
539 | }; | ||
540 | |||
541 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) | ||
542 | |||
525 | /* Audit Information */ | 543 | /* Audit Information */ |
526 | struct xfrm_audit | 544 | struct xfrm_audit |
527 | { | 545 | { |
@@ -1119,12 +1137,15 @@ extern void xfrm_replay_notify(struct xfrm_state *x, int event); | |||
1119 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); | 1137 | extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); |
1120 | extern int xfrm_init_state(struct xfrm_state *x); | 1138 | extern int xfrm_init_state(struct xfrm_state *x); |
1121 | extern int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); | 1139 | extern int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); |
1140 | extern int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, | ||
1141 | int encap_type); | ||
1122 | extern int xfrm_output_resume(struct sk_buff *skb, int err); | 1142 | extern int xfrm_output_resume(struct sk_buff *skb, int err); |
1123 | extern int xfrm_output(struct sk_buff *skb); | 1143 | extern int xfrm_output(struct sk_buff *skb); |
1124 | extern int xfrm4_extract_header(struct sk_buff *skb); | 1144 | extern int xfrm4_extract_header(struct sk_buff *skb); |
1125 | extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); | 1145 | extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); |
1126 | extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, | 1146 | extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, |
1127 | int encap_type); | 1147 | int encap_type); |
1148 | extern int xfrm4_transport_finish(struct sk_buff *skb, int async); | ||
1128 | extern int xfrm4_rcv(struct sk_buff *skb); | 1149 | extern int xfrm4_rcv(struct sk_buff *skb); |
1129 | 1150 | ||
1130 | static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) | 1151 | static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) |
@@ -1140,6 +1161,7 @@ extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short f | |||
1140 | extern int xfrm6_extract_header(struct sk_buff *skb); | 1161 | extern int xfrm6_extract_header(struct sk_buff *skb); |
1141 | extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); | 1162 | extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); |
1142 | extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); | 1163 | extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); |
1164 | extern int xfrm6_transport_finish(struct sk_buff *skb, int async); | ||
1143 | extern int xfrm6_rcv(struct sk_buff *skb); | 1165 | extern int xfrm6_rcv(struct sk_buff *skb); |
1144 | extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | 1166 | extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, |
1145 | xfrm_address_t *saddr, u8 proto); | 1167 | xfrm_address_t *saddr, u8 proto); |