[NETNS][IPV6] addrconf - Pass the proper network namespace parameters to addrconf
[safe/jmp/linux-2.6] / include / net / sch_generic.h
index c76d34e..ab502ec 100644 (file)
@@ -1,15 +1,14 @@
 #ifndef __NET_SCHED_GENERIC_H
 #define __NET_SCHED_GENERIC_H
 
-#include <linux/config.h>
 #include <linux/netdevice.h>
 #include <linux/types.h>
 #include <linux/rcupdate.h>
 #include <linux/module.h>
-#include <linux/rtnetlink.h>
 #include <linux/pkt_sched.h>
 #include <linux/pkt_cls.h>
 #include <net/gen_stats.h>
+#include <net/rtnetlink.h>
 
 struct Qdisc_ops;
 struct qdisc_walker;
@@ -61,12 +60,13 @@ struct Qdisc_class_ops
        int                     (*graft)(struct Qdisc *, unsigned long cl,
                                        struct Qdisc *, struct Qdisc **);
        struct Qdisc *          (*leaf)(struct Qdisc *, unsigned long cl);
+       void                    (*qlen_notify)(struct Qdisc *, unsigned long);
 
        /* Class manipulation routines */
        unsigned long           (*get)(struct Qdisc *, u32 classid);
        void                    (*put)(struct Qdisc *, unsigned long);
        int                     (*change)(struct Qdisc *, u32, u32,
-                                       struct rtattr **, unsigned long *);
+                                       struct nlattr **, unsigned long *);
        int                     (*delete)(struct Qdisc *, unsigned long);
        void                    (*walk)(struct Qdisc *, struct qdisc_walker * arg);
 
@@ -86,7 +86,7 @@ struct Qdisc_class_ops
 struct Qdisc_ops
 {
        struct Qdisc_ops        *next;
-       struct Qdisc_class_ops  *cl_ops;
+       const struct Qdisc_class_ops    *cl_ops;
        char                    id[IFNAMSIZ];
        int                     priv_size;
 
@@ -95,10 +95,10 @@ struct Qdisc_ops
        int                     (*requeue)(struct sk_buff *, struct Qdisc *);
        unsigned int            (*drop)(struct Qdisc *);
 
-       int                     (*init)(struct Qdisc *, struct rtattr *arg);
+       int                     (*init)(struct Qdisc *, struct nlattr *arg);
        void                    (*reset)(struct Qdisc *);
        void                    (*destroy)(struct Qdisc *);
-       int                     (*change)(struct Qdisc *, struct rtattr *arg);
+       int                     (*change)(struct Qdisc *, struct nlattr *arg);
 
        int                     (*dump)(struct Qdisc *, struct sk_buff *);
        int                     (*dump_stats)(struct Qdisc *, struct gnet_dump *);
@@ -126,7 +126,7 @@ struct tcf_proto_ops
        unsigned long           (*get)(struct tcf_proto*, u32 handle);
        void                    (*put)(struct tcf_proto*, unsigned long);
        int                     (*change)(struct tcf_proto*, unsigned long,
-                                       u32 handle, struct rtattr **,
+                                       u32 handle, struct nlattr **,
                                        unsigned long *);
        int                     (*delete)(struct tcf_proto*, unsigned long);
        void                    (*walk)(struct tcf_proto*, struct tcf_walker *arg);
@@ -145,7 +145,7 @@ struct tcf_proto
        void                    *root;
        int                     (*classify)(struct sk_buff*, struct tcf_proto*,
                                        struct tcf_result *);
-       u32                     protocol;
+       __be16                  protocol;
 
        /* All the rest */
        u32                     prio;
@@ -173,16 +173,12 @@ extern void dev_activate(struct net_device *dev);
 extern void dev_deactivate(struct net_device *dev);
 extern void qdisc_reset(struct Qdisc *qdisc);
 extern void qdisc_destroy(struct Qdisc *qdisc);
+extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
+extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops);
 extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
-                                      struct Qdisc_ops *ops);
-
-static inline void
-tcf_destroy(struct tcf_proto *tp)
-{
-       tp->ops->destroy(tp);
-       module_put(tp->ops->owner);
-       kfree(tp);
-}
+                                      struct Qdisc_ops *ops, u32 parentid);
+extern void tcf_destroy(struct tcf_proto *tp);
+extern void tcf_destroy_chain(struct tcf_proto *fl);
 
 static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
                                       struct sk_buff_head *list)
@@ -294,7 +290,7 @@ static inline int qdisc_reshape_fail(struct sk_buff *skb, struct Qdisc *sch)
 {
        sch->qstats.drops++;
 
-#ifdef CONFIG_NET_CLS_POLICE
+#ifdef CONFIG_NET_CLS_ACT
        if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch))
                goto drop;
 
@@ -306,4 +302,32 @@ drop:
        return NET_XMIT_DROP;
 }
 
+/* Length to Time (L2T) lookup in a qdisc_rate_table, to determine how
+   long it will take to send a packet given its size.
+ */
+static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
+{
+       int slot = pktlen + rtab->rate.cell_align + rtab->rate.overhead;
+       if (slot < 0)
+               slot = 0;
+       slot >>= rtab->rate.cell_log;
+       if (slot > 255)
+               return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]);
+       return rtab->data[slot];
+}
+
+#ifdef CONFIG_NET_CLS_ACT
+static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask)
+{
+       struct sk_buff *n = skb_clone(skb, gfp_mask);
+
+       if (n) {
+               n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
+               n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd);
+               n->tc_verd = CLR_TC_MUNGED(n->tc_verd);
+       }
+       return n;
+}
+#endif
+
 #endif