patch-2.1.30 linux/include/net/dst.h

Next file: linux/include/net/flow.h
Previous file: linux/include/net/br.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/include/net/dst.h linux/include/net/dst.h
@@ -8,6 +8,8 @@
 #ifndef _NET_DST_H
 #define _NET_DST_H
 
+#include <net/neighbour.h>
+
 /*
  * 0 - no debugging messages
  * 1 - rare events and bugs (default)
@@ -28,8 +30,8 @@
 struct dst_entry
 {
 	struct dst_entry        *next;
-	atomic_t		refcnt;
-	atomic_t		use;
+	atomic_t		refcnt;		/* tree/hash references	*/
+	atomic_t		use;		/* client references	*/
 	struct device	        *dev;
 	char			obsolete;
 	char			priority;
@@ -40,7 +42,7 @@
 	unsigned		rtt;
 	int			error;
 
-	struct dst_entry	*neighbour;
+	struct neighbour	*neighbour;
 	struct hh_cache		*hh;
 
 	int			(*input)(struct sk_buff*);
@@ -55,8 +57,9 @@
 struct dst_ops
 {
 	unsigned short		family;
-	struct dst_entry *	(*check)(struct dst_entry *);
-	struct dst_entry *	(*reroute)(struct dst_entry *);
+	struct dst_entry *	(*check)(struct dst_entry *, u32 cookie);
+	struct dst_entry *	(*reroute)(struct dst_entry *,
+					   struct sk_buff *);
 	void			(*destroy)(struct dst_entry *);
 };
 
@@ -67,7 +70,7 @@
 struct dst_entry * dst_clone(struct dst_entry * dst)
 {
 	if (dst)
-		atomic_inc(&dst->refcnt);
+		atomic_inc(&dst->use);
 	return dst;
 }
 
@@ -75,24 +78,24 @@
 void dst_release(struct dst_entry * dst)
 {
 	if (dst)
-		atomic_dec(&dst->refcnt);
+		atomic_dec(&dst->use);
 }
 
 static __inline__
-struct dst_entry * dst_check(struct dst_entry ** dst_p)
+struct dst_entry * dst_check(struct dst_entry ** dst_p, u32 cookie)
 {
 	struct dst_entry * dst = *dst_p;
 	if (dst && dst->obsolete)
-		dst = dst->ops->check(dst);
+		dst = dst->ops->check(dst, cookie);
 	return (*dst_p = dst);
 }
 
 static __inline__
-struct dst_entry * dst_reroute(struct dst_entry ** dst_p)
+struct dst_entry * dst_reroute(struct dst_entry ** dst_p, struct sk_buff *skb)
 {
 	struct dst_entry * dst = *dst_p;
 	if (dst && dst->obsolete)
-		dst = dst->ops->reroute(dst);
+		dst = dst->ops->reroute(dst, skb);
 	return (*dst_p = dst);
 }
 
@@ -100,7 +103,7 @@
 void dst_destroy(struct dst_entry * dst)
 {
 	if (dst->neighbour)
-		dst_release(dst->neighbour);
+		neigh_release(dst->neighbour);
 	if (dst->ops->destroy)
 		dst->ops->destroy(dst);
 	kfree(dst);
@@ -113,7 +116,7 @@
 static __inline__
 void dst_free(struct dst_entry * dst)
 {
-	if (!dst->refcnt) {
+	if (!dst->use) {
 		dst_destroy(dst);
 		return;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov