]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Expose more nodelist.c functions to tests
authorNick Mathewson <nickm@torproject.org>
Sat, 17 Nov 2018 17:55:23 +0000 (12:55 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 19 Nov 2018 13:26:10 +0000 (08:26 -0500)
src/feature/nodelist/nodelist.c
src/feature/nodelist/nodelist.h

index 3994c8d0723f3dac7c661ca25ff3bcac38d2b7d5..d070f31c121ca9a2a706accf230f15f1f1eeaef6 100644 (file)
@@ -1870,7 +1870,7 @@ addrs_in_same_network_family(const tor_addr_t *a1,
  * (case-insensitive), or if <b>node's</b> identity key digest
  * matches a hexadecimal value stored in <b>nickname</b>.  Return
  * false otherwise. */
-static int
+STATIC int
 node_nickname_matches(const node_t *node, const char *nickname)
 {
   const char *n = node_get_nickname(node);
@@ -1882,7 +1882,7 @@ node_nickname_matches(const node_t *node, const char *nickname)
 }
 
 /** Return true iff <b>node</b> is named by some nickname in <b>lst</b>. */
-static inline int
+STATIC int
 node_in_nickname_smartlist(const smartlist_t *lst, const node_t *node)
 {
   if (!lst) return 0;
@@ -1894,7 +1894,7 @@ node_in_nickname_smartlist(const smartlist_t *lst, const node_t *node)
 }
 
 /** Return true iff n1's declared family contains n2. */
-static int
+STATIC int
 node_family_contains(const node_t *n1, const node_t *n2)
 {
   if (n1->ri && n1->ri->declared_family) {
@@ -1909,7 +1909,7 @@ node_family_contains(const node_t *n1, const node_t *n2)
 /**
  * Return true iff <b>node</b> has declared a nonempty family.
  **/
-static bool
+STATIC bool
 node_has_declared_family(const node_t *node)
 {
   if (node->ri && node->ri->declared_family &&
@@ -1929,7 +1929,7 @@ node_has_declared_family(const node_t *node)
  * its family.  (Note that these nodes are not in node's family unless they
  * also agree that node is in their family.)
  **/
-static void
+STATIC void
 node_lookup_declared_family(smartlist_t *out, const node_t *node)
 {
   if (node->ri && node->ri->declared_family &&
index 87ea544db270f151bf7d3ac087c1ff4d525c0deb..32300eb00cdaf6b950c95a0f20d8a801f31fa33c 100644 (file)
@@ -154,10 +154,16 @@ int count_loading_descriptors_progress(void);
 
 #ifdef NODELIST_PRIVATE
 
+STATIC int node_nickname_matches(const node_t *node, const char *nickname);
+STATIC int node_in_nickname_smartlist(const smartlist_t *lst,
+                                      const node_t *node);
+STATIC int node_family_contains(const node_t *n1, const node_t *n2);
+STATIC bool node_has_declared_family(const node_t *node);
+STATIC void node_lookup_declared_family(smartlist_t *out, const node_t *node);
+
 #ifdef TOR_UNIT_TESTS
 
-STATIC void
-node_set_hsdir_index(node_t *node, const networkstatus_t *ns);
+STATIC void node_set_hsdir_index(node_t *node, const networkstatus_t *ns);
 
 #endif /* defined(TOR_UNIT_TESTS) */