linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / include / net / neighbour.h
index 40073cf..6fa9ae1 100644 (file)
@@ -49,8 +49,8 @@
 #ifdef __KERNEL__
 
 #include <asm/atomic.h>
-#include <linux/skbuff.h>
 #include <linux/netdevice.h>
+#include <linux/skbuff.h>
 #include <linux/rcupdate.h>
 #include <linux/seq_file.h>
 
@@ -65,11 +65,10 @@ struct neighbour;
 
 struct neigh_parms
 {
+       struct net_device *dev;
        struct neigh_parms *next;
        int     (*neigh_setup)(struct neighbour *);
        struct neigh_table *tbl;
-       int     entries;
-       void    *priv;
 
        void    *sysctl_table;
 
@@ -112,7 +111,11 @@ struct neigh_statistics
 };
 
 #define NEIGH_CACHE_STAT_INC(tbl, field)                               \
-               (per_cpu_ptr((tbl)->stats, smp_processor_id())->field++)
+       do {                                                            \
+               preempt_disable();                                      \
+               (per_cpu_ptr((tbl)->stats, smp_processor_id())->field)++; \
+               preempt_enable();                                       \
+       } while (0)
 
 struct neighbour
 {
@@ -185,10 +188,9 @@ struct neigh_table
        struct timer_list       gc_timer;
        struct timer_list       proxy_timer;
        struct sk_buff_head     proxy_queue;
-       int                     entries;
+       atomic_t                entries;
        rwlock_t                lock;
        unsigned long           last_rand;
-       struct neigh_parms      *parms_list;
        kmem_cache_t            *kmem_cachep;
        struct neigh_statistics *stats;
        struct neighbour        **hash_buckets;
@@ -248,6 +250,9 @@ extern int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
 extern int neigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
 extern void neigh_app_ns(struct neighbour *n);
 
+extern int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb);
+extern int neightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);
+
 extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie);
 extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *));
 extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *));
@@ -270,7 +275,8 @@ extern int                  neigh_sysctl_register(struct net_device *dev,
                                                      struct neigh_parms *p,
                                                      int p_id, int pdev_id,
                                                      char *p_name,
-                                                     proc_handler *proc_handler);
+                                                     proc_handler *proc_handler,
+                                                     ctl_handler *strategy);
 extern void                    neigh_sysctl_unregister(struct neigh_parms *p);
 
 static inline void __neigh_parms_put(struct neigh_parms *parms)
@@ -357,7 +363,14 @@ __neigh_lookup_errno(struct neigh_table *tbl, const void *pkey,
        return neigh_create(tbl, pkey, dev);
 }
 
-#define LOCALLY_ENQUEUED -2
+struct neighbour_cb {
+       unsigned long sched_next;
+       unsigned int flags;
+};
+
+#define LOCALLY_ENQUEUED 0x1
+
+#define NEIGH_CB(skb)  ((struct neighbour_cb *)(skb)->cb)
 
 #endif
 #endif