[Olsr-dev] [olsrd] [PATCH v1 15/29] gateway: make olsr_find_gateway_entry static

Ferry Huberts (spam-protected)
Tue Jul 24 18:09:04 CEST 2012


From: Ferry Huberts <(spam-protected)>

it is only used in gateway.c

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/gateway.c |   22 +++++++++++-----------
 src/gateway.h |    1 -
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/gateway.c b/src/gateway.c
index 46fb695..bf9d1ba 100644
--- a/src/gateway.c
+++ b/src/gateway.c
@@ -216,6 +216,17 @@ olsr_set_inetgw_handler(struct olsr_gw_handler *h) {
 }
 
 /**
+ * @param originator
+ * @return gateway_entry for corresponding router
+ */
+static struct gateway_entry *
+olsr_find_gateway_entry(union olsr_ip_addr *originator) {
+  struct avl_node *node = avl_find(&gateway_tree, originator);
+
+  return node == NULL ? NULL : node2gateway(node);
+}
+
+/**
  * Sets a new internet gateway.
  * An external set command might trigger an internal one if
  * address is not a legal gateway.
@@ -314,17 +325,6 @@ struct gateway_entry *olsr_get_ipv6_inet_gateway(bool *ext) {
 }
 
 /**
- * @param originator
- * @return gateway_entry for corresponding router
- */
-struct gateway_entry *
-olsr_find_gateway_entry(union olsr_ip_addr *originator) {
-  struct avl_node *node = avl_find(&gateway_tree, originator);
-
-  return node == NULL ? NULL : node2gateway(node);
-}
-
-/**
  * update a gateway_entry based on data received from a HNA
  * @param originator ip of the source of the HNA
  * @param mask netmask of the HNA
diff --git a/src/gateway.h b/src/gateway.h
index 7dd7775..60b4e70 100644
--- a/src/gateway.h
+++ b/src/gateway.h
@@ -70,7 +70,6 @@ void olsr_cleanup_gateways(void);
 void olsr_trigger_inetgw_startup(void);
 void olsr_trigger_gatewayloss_check(void);
 
-struct gateway_entry *olsr_find_gateway_entry(union olsr_ip_addr *originator);
 void olsr_update_gateway_entry(union olsr_ip_addr *originator, union olsr_ip_addr *mask, int prefixlen, uint16_t seqno);
 void olsr_delete_gateway_entry(union olsr_ip_addr *originator, uint8_t prefixlen);
 void olsr_print_gateway_entries(void);
-- 
1.7.10.4





More information about the Olsr-dev mailing list