[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r16522: {tor} Move policy_summarize() prototype to or.h (tor/trunk/src/or)



Author: weasel
Date: 2008-08-13 08:45:28 -0400 (Wed, 13 Aug 2008)
New Revision: 16522

Modified:
   tor/trunk/src/or/or.h
   tor/trunk/src/or/policies.c
Log:
Move policy_summarize() prototype to or.h

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-08-13 12:45:23 UTC (rev 16521)
+++ tor/trunk/src/or/or.h	2008-08-13 12:45:28 UTC (rev 16522)
@@ -3666,6 +3666,8 @@
 void addr_policy_free(addr_policy_t *p);
 void policies_free_all(void);
 
+char *policy_summarize(smartlist_t *policy);
+
 /********************************* reasons.c ***************************/
 
 const char *stream_end_reason_to_control_string(int reason);

Modified: tor/trunk/src/or/policies.c
===================================================================
--- tor/trunk/src/or/policies.c	2008-08-13 12:45:23 UTC (rev 16521)
+++ tor/trunk/src/or/policies.c	2008-08-13 12:45:28 UTC (rev 16522)
@@ -38,6 +38,22 @@
  * to directories at. */
 static smartlist_t *reachable_dir_addr_policy = NULL;
 
+/** Element of an exit policy summary */
+typedef struct policy_summary_item_t {
+    uint16_t prt_min; /**< Lowest port number to accept/reject. */
+    uint16_t prt_max; /**< Highest port number to accept/reject. */
+    uint64_t reject_count; /**< Number of IP-Addresses that are rejected to
+                                this portrange. */
+    int accepted:1; /** Has this port already been accepted */
+} policy_summary_item_t;
+
+smartlist_t *policy_summary_create(void);
+void policy_summary_accept(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max);
+void policy_summary_reject(smartlist_t *summary, maskbits_t maskbits, uint16_t prt_min, uint16_t prt_max);
+void policy_summary_add_item(smartlist_t *summary, addr_policy_t *p);
+int policy_summary_split(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max);
+policy_summary_item_t* policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts);
+
 /** Private networks.  This list is used in two places, once to expand the
  *  "private" keyword when parsing our own exit policy, secondly to ignore
  *  just such networks when building exit policy summaries.  It is important
@@ -911,23 +927,6 @@
   return (int)written;
 }
 
-/** Element of an exit policy summary */
-typedef struct policy_summary_item_t {
-    uint16_t prt_min; /**< Lowest port number to accept/reject. */
-    uint16_t prt_max; /**< Highest port number to accept/reject. */
-    uint64_t reject_count; /**< Number of IP-Addresses that are rejected to
-                                this portrange. */
-    int accepted:1; /** Has this port already been accepted */
-} policy_summary_item_t;
-
-smartlist_t *policy_summary_create(void);
-void policy_summary_accept(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max);
-void policy_summary_reject(smartlist_t *summary, maskbits_t maskbits, uint16_t prt_min, uint16_t prt_max);
-void policy_summary_add_item(smartlist_t *summary, addr_policy_t *p);
-char * policy_summarize(smartlist_t *policy);
-int policy_summary_split(smartlist_t *summary, uint16_t prt_min, uint16_t prt_max);
-policy_summary_item_t* policy_summary_item_split(policy_summary_item_t* old, uint16_t new_starts);
-
 /** Create a new exit policy summary, initially only with a single
  *  port 1-64k item */
 /* XXXX This entire thing will do most stuff in O(N^2), or worse.  Use an
@@ -1169,7 +1168,6 @@
   return result;
 }
 
-
 /** Implementation for GETINFO control command: knows the answer for questions
  * about "exit-policy/..." */
 int