inet: constify ip_route_output_flow() socket argument
[deliverable/linux.git] / include / net / dst.h
index 2bc73f8a00a9c4d20848a578eca44b99cf1b7281..779206c15f8bae0b86e5b3536ca256ba4eee2802 100644 (file)
@@ -57,6 +57,7 @@ struct dst_entry {
 #define DST_FAKE_RTABLE                0x0040
 #define DST_XFRM_TUNNEL                0x0080
 #define DST_XFRM_QUEUE         0x0100
+#define DST_METADATA           0x0200
 
        unsigned short          pending_confirm;
 
@@ -83,12 +84,13 @@ struct dst_entry {
        __u32                   __pad2;
 #endif
 
+#ifdef CONFIG_64BIT
+       struct lwtunnel_state   *lwtstate;
        /*
         * Align __refcnt to a 64 bytes alignment
         * (L1_CACHE_SIZE would be too much)
         */
-#ifdef CONFIG_64BIT
-       long                    __pad_to_align_refcnt[2];
+       long                    __pad_to_align_refcnt[1];
 #endif
        /*
         * __refcnt wants to be on a different cache line from
@@ -97,6 +99,9 @@ struct dst_entry {
        atomic_t                __refcnt;       /* client references    */
        int                     __use;
        unsigned long           lastuse;
+#ifndef CONFIG_64BIT
+       struct lwtunnel_state   *lwtstate;
+#endif
        union {
                struct dst_entry        *next;
                struct rtable __rcu     *rt_next;
@@ -202,6 +207,12 @@ static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
                p[metric-1] = val;
 }
 
+/* Kernel-internal feature bits that are unallocated in user space. */
+#define DST_FEATURE_ECN_CA     (1 << 31)
+
+#define DST_FEATURE_MASK       (DST_FEATURE_ECN_CA)
+#define DST_FEATURE_ECN_MASK   (DST_FEATURE_ECN_CA | RTAX_FEATURE_ECN)
+
 static inline u32
 dst_feature(const struct dst_entry *dst, u32 feature)
 {
@@ -284,13 +295,18 @@ static inline void skb_dst_drop(struct sk_buff *skb)
        }
 }
 
-static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
+static inline void __skb_dst_copy(struct sk_buff *nskb, unsigned long refdst)
 {
-       nskb->_skb_refdst = oskb->_skb_refdst;
+       nskb->_skb_refdst = refdst;
        if (!(nskb->_skb_refdst & SKB_DST_NOREF))
                dst_clone(skb_dst(nskb));
 }
 
+static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
+{
+       __skb_dst_copy(nskb, oskb->_skb_refdst);
+}
+
 /**
  * skb_dst_force - makes sure skb dst is refcounted
  * @skb: buffer
@@ -356,6 +372,9 @@ static inline int dst_discard(struct sk_buff *skb)
 }
 void *dst_alloc(struct dst_ops *ops, struct net_device *dev, int initial_ref,
                int initial_obsolete, unsigned short flags);
+void dst_init(struct dst_entry *dst, struct dst_ops *ops,
+             struct net_device *dev, int initial_ref, int initial_obsolete,
+             unsigned short flags);
 void __dst_free(struct dst_entry *dst);
 struct dst_entry *dst_destroy(struct dst_entry *dst);
 
@@ -435,13 +454,13 @@ static inline void dst_set_expires(struct dst_entry *dst, int timeout)
 }
 
 /* Output packet to network from transport.  */
-static inline int dst_output_sk(struct sock *sk, struct sk_buff *skb)
+static inline int dst_output(struct sock *sk, struct sk_buff *skb)
 {
        return skb_dst(skb)->output(sk, skb);
 }
-static inline int dst_output(struct sk_buff *skb)
+static inline int dst_output_okfn(struct net *net, struct sock *sk, struct sk_buff *skb)
 {
-       return dst_output_sk(skb->sk, skb);
+       return dst_output(sk, skb);
 }
 
 /* Input packet from network to transport.  */
@@ -457,7 +476,7 @@ static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
        return dst;
 }
 
-void dst_init(void);
+void dst_subsys_init(void);
 
 /* Flags for xfrm_lookup flags argument. */
 enum {
@@ -470,7 +489,8 @@ struct flowi;
 #ifndef CONFIG_XFRM
 static inline struct dst_entry *xfrm_lookup(struct net *net,
                                            struct dst_entry *dst_orig,
-                                           const struct flowi *fl, struct sock *sk,
+                                           const struct flowi *fl,
+                                           const struct sock *sk,
                                            int flags)
 {
        return dst_orig;
@@ -479,7 +499,7 @@ static inline struct dst_entry *xfrm_lookup(struct net *net,
 static inline struct dst_entry *xfrm_lookup_route(struct net *net,
                                                  struct dst_entry *dst_orig,
                                                  const struct flowi *fl,
-                                                 struct sock *sk,
+                                                 const struct sock *sk,
                                                  int flags)
 {
        return dst_orig;
@@ -492,11 +512,11 @@ static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
 
 #else
 struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
-                             const struct flowi *fl, struct sock *sk,
+                             const struct flowi *fl, const struct sock *sk,
                              int flags);
 
 struct dst_entry *xfrm_lookup_route(struct net *net, struct dst_entry *dst_orig,
-                                   const struct flowi *fl, struct sock *sk,
+                                   const struct flowi *fl, const struct sock *sk,
                                    int flags);
 
 /* skb attached with this dst needs transformation if dst->xfrm is valid */
This page took 0.038598 seconds and 5 git commands to generate.