]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
if_connected() is again private.
authorMartin Mares <mj@ucw.cz>
Mon, 27 Mar 2000 12:16:37 +0000 (12:16 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 27 Mar 2000 12:16:37 +0000 (12:16 +0000)
Introduced neigh_connected_to() to serve the same purpose efficiently.

nest/iface.h
nest/neighbor.c

index 379f566c1cb8ca85f0e7490a39e9e7dcd482c8ef..94c0945be8b7812f3788908be6182e80c16ab2e3 100644 (file)
@@ -114,6 +114,12 @@ typedef struct neighbor {
  */
 neighbor *neigh_find(struct proto *, ip_addr *, unsigned flags);
 
+static inline int neigh_connected_to(struct proto *p, ip_addr *a, struct iface *i)
+{
+  neighbor *n = neigh_find(p, a, 0);
+  return n && n->iface == i;
+}
+
 void neigh_dump(neighbor *);
 void neigh_dump_all(void);
 void neigh_prune(void);
@@ -121,8 +127,6 @@ void neigh_if_up(struct iface *);
 void neigh_if_down(struct iface *);
 void neigh_init(struct pool *);
 
-extern int if_connected(ip_addr *a, struct iface *i); /* -1=error, 1=match, 0=no match */
-
 /*
  *     Interface Pattern Lists
  */
index 5750f8cf473a973ec8a6f0704da642974ca28d64..c4328b6cf98ad2683d3bfcb2ed0113cf431ffe03 100644 (file)
@@ -24,7 +24,7 @@ neigh_hash(struct proto *p, ip_addr *a)
   return (p->hash_key ^ ipa_hash(*a)) & (NEIGH_HASH_SIZE-1);
 }
 
-int
+static int
 if_connected(ip_addr *a, struct iface *i) /* -1=error, 1=match, 0=no match */
 {
   struct ifa *b;