aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/xfrm.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-03-26 21:35:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-26 21:35:50 -0400
commitee20a0dd5400e771ff93eb7f2bcc731eab1f377e (patch)
tree43743bd300a5b1ed94888881689e1d6a8ecac1e1 /include/net/xfrm.h
parentd55a4528f7f607ca2872fec18574bc8cec060f05 (diff)
parent732c8bd590625e8bc0b88313b82930e336b2bec4 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (43 commits) [IPSEC]: Fix BEET output [ICMP]: Dst entry leak in icmp_send host re-lookup code (v2). [AX25]: Remove obsolete references to BKL from TODO file. [NET]: Fix multicast device ioctl checks [IRDA]: Store irnet_socket termios properly. [UML]: uml-net: don't set IFF_ALLMULTI in set_multicast_list [VLAN]: Don't copy ALLMULTI/PROMISC flags from underlying device netxen, phy/marvell, skge: minor checkpatch fixes S2io: Handle TX completions on the same CPU as the sender for MIS-X interrupts b44: Truncate PHY address skge napi->poll() locking bug rndis_host: fix oops when query for OID_GEN_PHYSICAL_MEDIUM fails cxgb3: Fix lockdep problems with sge.reg_lock ehea: Fix IPv6 support dm9000: Support promisc and all-multi modes dm9601: configure MAC to drop invalid (crc/length) packets dm9601: add Hirose USB-100 device ID Marvell PHY m88e1111 driver fix netxen: fix rx dropped stats netxen: remove low level tx lock ...
Diffstat (limited to 'include/net/xfrm.h')
-rw-r--r--include/net/xfrm.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 619c53bc3cd2..0d255ae008b6 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -204,6 +204,7 @@ struct xfrm_state
204 * transformer. */ 204 * transformer. */
205 const struct xfrm_type *type; 205 const struct xfrm_type *type;
206 struct xfrm_mode *inner_mode; 206 struct xfrm_mode *inner_mode;
207 struct xfrm_mode *inner_mode_iaf;
207 struct xfrm_mode *outer_mode; 208 struct xfrm_mode *outer_mode;
208 209
209 /* Security context */ 210 /* Security context */
@@ -387,6 +388,27 @@ enum {
387extern int xfrm_register_mode(struct xfrm_mode *mode, int family); 388extern int xfrm_register_mode(struct xfrm_mode *mode, int family);
388extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family); 389extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family);
389 390
391static inline int xfrm_af2proto(unsigned int family)
392{
393 switch(family) {
394 case AF_INET:
395 return IPPROTO_IPIP;
396 case AF_INET6:
397 return IPPROTO_IPV6;
398 default:
399 return 0;
400 }
401}
402
403static inline struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ipproto)
404{
405 if ((ipproto == IPPROTO_IPIP && x->props.family == AF_INET) ||
406 (ipproto == IPPROTO_IPV6 && x->props.family == AF_INET6))
407 return x->inner_mode;
408 else
409 return x->inner_mode_iaf;
410}
411
390struct xfrm_tmpl 412struct xfrm_tmpl
391{ 413{
392/* id in template is interpreted as: 414/* id in template is interpreted as:
@@ -530,6 +552,9 @@ struct xfrm_mode_skb_cb {
530 __be16 id; 552 __be16 id;
531 __be16 frag_off; 553 __be16 frag_off;
532 554
555 /* IP header length (excluding options or extension headers). */
556 u8 ihl;
557
533 /* TOS for IPv4, class for IPv6. */ 558 /* TOS for IPv4, class for IPv6. */
534 u8 tos; 559 u8 tos;
535 560
@@ -539,6 +564,9 @@ struct xfrm_mode_skb_cb {
539 /* Protocol for IPv4, NH for IPv6. */ 564 /* Protocol for IPv4, NH for IPv6. */
540 u8 protocol; 565 u8 protocol;
541 566
567 /* Option length for IPv4, zero for IPv6. */
568 u8 optlen;
569
542 /* Used by IPv6 only, zero for IPv4. */ 570 /* Used by IPv6 only, zero for IPv4. */
543 u8 flow_lbl[3]; 571 u8 flow_lbl[3];
544}; 572};
@@ -1253,6 +1281,7 @@ extern int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi,
1253extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr); 1281extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
1254extern int xfrm_output_resume(struct sk_buff *skb, int err); 1282extern int xfrm_output_resume(struct sk_buff *skb, int err);
1255extern int xfrm_output(struct sk_buff *skb); 1283extern int xfrm_output(struct sk_buff *skb);
1284extern int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb);
1256extern int xfrm4_extract_header(struct sk_buff *skb); 1285extern int xfrm4_extract_header(struct sk_buff *skb);
1257extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); 1286extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb);
1258extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, 1287extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,