aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-14 00:44:23 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:50 -0500
commit716062fd4c2f88a33ab409f62a1e7397ad0a7e33 (patch)
tree73f2618fe99bca3870a0dbdc35acf6466ab3b976 /include
parentc6581a457e661b7070e484ad723bbf555b17aca2 (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.h22
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
279extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); 281extern 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 */
531struct 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 */
526struct xfrm_audit 544struct xfrm_audit
527{ 545{
@@ -1119,12 +1137,15 @@ extern void xfrm_replay_notify(struct xfrm_state *x, int event);
1119extern int xfrm_state_mtu(struct xfrm_state *x, int mtu); 1137extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
1120extern int xfrm_init_state(struct xfrm_state *x); 1138extern int xfrm_init_state(struct xfrm_state *x);
1121extern int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb); 1139extern int xfrm_prepare_input(struct xfrm_state *x, struct sk_buff *skb);
1140extern int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi,
1141 int encap_type);
1122extern int xfrm_output_resume(struct sk_buff *skb, int err); 1142extern int xfrm_output_resume(struct sk_buff *skb, int err);
1123extern int xfrm_output(struct sk_buff *skb); 1143extern int xfrm_output(struct sk_buff *skb);
1124extern int xfrm4_extract_header(struct sk_buff *skb); 1144extern int xfrm4_extract_header(struct sk_buff *skb);
1125extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); 1145extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb);
1126extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, 1146extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
1127 int encap_type); 1147 int encap_type);
1148extern int xfrm4_transport_finish(struct sk_buff *skb, int async);
1128extern int xfrm4_rcv(struct sk_buff *skb); 1149extern int xfrm4_rcv(struct sk_buff *skb);
1129 1150
1130static inline int xfrm4_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) 1151static 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
1140extern int xfrm6_extract_header(struct sk_buff *skb); 1161extern int xfrm6_extract_header(struct sk_buff *skb);
1141extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); 1162extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
1142extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); 1163extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
1164extern int xfrm6_transport_finish(struct sk_buff *skb, int async);
1143extern int xfrm6_rcv(struct sk_buff *skb); 1165extern int xfrm6_rcv(struct sk_buff *skb);
1144extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, 1166extern 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);