[IPV6] MIP6: Transformation support mobility header.
[linux-2.6-microblaze.git] / include / net / xfrm.h
index 0d735a5..13488e7 100644 (file)
@@ -134,6 +134,9 @@ struct xfrm_state
        /* Data for encapsulator */
        struct xfrm_encap_tmpl  *encap;
 
+       /* Data for care-of address */
+       xfrm_address_t  *coaddr;
+
        /* IPComp needs an IPIP tunnel for handling uncompressed packets */
        struct xfrm_state       *tunnel;
 
@@ -164,6 +167,9 @@ struct xfrm_state
        struct xfrm_lifetime_cur curlft;
        struct timer_list       timer;
 
+       /* Last used time */
+       u64                     lastused;
+
        /* Reference to data common to all the instances of this
         * transformer. */
        struct xfrm_type        *type;
@@ -260,12 +266,16 @@ struct xfrm_type
        char                    *description;
        struct module           *owner;
        __u8                    proto;
+       __u8                    flags;
+#define XFRM_TYPE_NON_FRAGMENT 1
 
        int                     (*init_state)(struct xfrm_state *x);
        void                    (*destructor)(struct xfrm_state *);
        int                     (*input)(struct xfrm_state *, struct sk_buff *skb);
        int                     (*output)(struct xfrm_state *, struct sk_buff *pskb);
        int                     (*hdr_offset)(struct xfrm_state *, struct sk_buff *, u8 **);
+       xfrm_address_t          *(*local_addr)(struct xfrm_state *, xfrm_address_t *);
+       xfrm_address_t          *(*remote_addr)(struct xfrm_state *, xfrm_address_t *);
        /* Estimate maximal size of result of transformation of a dgram */
        u32                     (*get_max_size)(struct xfrm_state *, int size);
 };
@@ -536,6 +546,11 @@ u16 xfrm_flowi_sport(struct flowi *fl)
        case IPPROTO_ICMPV6:
                port = htons(fl->fl_icmp_type);
                break;
+#ifdef CONFIG_IPV6_MIP6
+       case IPPROTO_MH:
+               port = htons(fl->fl_mh_type);
+               break;
+#endif
        default:
                port = 0;       /*XXX*/
        }
@@ -859,6 +874,23 @@ xfrm_state_addr_check(struct xfrm_state *x,
        return 0;
 }
 
+static __inline__ int
+xfrm_state_addr_flow_check(struct xfrm_state *x, struct flowi *fl,
+                          unsigned short family)
+{
+       switch (family) {
+       case AF_INET:
+               return __xfrm4_state_addr_check(x,
+                                               (xfrm_address_t *)&fl->fl4_dst,
+                                               (xfrm_address_t *)&fl->fl4_src);
+       case AF_INET6:
+               return __xfrm6_state_addr_check(x,
+                                               (xfrm_address_t *)&fl->fl6_dst,
+                                               (xfrm_address_t *)&fl->fl6_src);
+       }
+       return 0;
+}
+
 static inline int xfrm_state_kern(struct xfrm_state *x)
 {
        return atomic_read(&x->tunnel_users);
@@ -1004,7 +1036,7 @@ extern void xfrm_policy_flush(void);
 extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
 extern int xfrm_flush_bundles(void);
 extern void xfrm_flush_all_bundles(void);
-extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family);
+extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family, int strict);
 extern void xfrm_init_pmtu(struct dst_entry *dst);
 
 extern wait_queue_head_t km_waitq;