]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Create config.h
authorSebastian Hahn <sebastian@torproject.org>
Thu, 22 Jul 2010 08:22:51 +0000 (10:22 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Tue, 27 Jul 2010 05:58:14 +0000 (07:58 +0200)
37 files changed:
src/or/buffers.c
src/or/circuitbuild.c
src/or/circuitlist.c
src/or/circuituse.c
src/or/command.c
src/or/config.c
src/or/config.h [new file with mode: 0644]
src/or/connection.c
src/or/connection_edge.c
src/or/connection_or.c
src/or/control.c
src/or/cpuworker.c
src/or/directory.c
src/or/dirserv.c
src/or/dirvote.c
src/or/dns.c
src/or/dnsserv.c
src/or/geoip.c
src/or/hibernate.c
src/or/main.c
src/or/microdesc.c
src/or/networkstatus.c
src/or/onion.c
src/or/or.h
src/or/policies.c
src/or/reasons.c
src/or/relay.c
src/or/rendclient.c
src/or/rendcommon.c
src/or/rendmid.c
src/or/rendservice.c
src/or/rephist.c
src/or/router.c
src/or/routerlist.c
src/or/routerparse.c
src/test/test.c
src/test/test_util.c

index 807ca5076d827e588687a7c6584f4b0cf86debd1..2c1ba78ecffb534a49759e8ec10bc5e763912795 100644 (file)
@@ -13,6 +13,7 @@
 #define BUFFERS_PRIVATE
 #include "or.h"
 #include "buffers.h"
+#include "config.h"
 #include "../common/util.h"
 #include "../common/torlog.h"
 #ifdef HAVE_UNISTD_H
index 9d54dbec577aeb3c61d7f0224e3cbf9a2a282046..041aed3a0ab4274849916e611f56b3485d135aa0 100644 (file)
@@ -15,6 +15,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "router.h"
 #include "routerlist.h"
 #include "crypto.h"
index dbbe7bf364cca60b7992a0347425ba6deef5eeb7..a4ec4c06a454b85bc123c19469600e1b3387a04b 100644 (file)
@@ -13,6 +13,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "routerlist.h"
index 6ae929e8410c9a4d5c6afc1b09132ef618aa7619..70def3d480e9bd22dc628e503d5aced051d914e3 100644 (file)
@@ -13,6 +13,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "rendservice.h"
index 1a5c893b7e4f881567200823bdcbd8d56d427eef..96c5fca59bd8f1e2080aae6163f10d62f931162d 100644 (file)
@@ -19,6 +19,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "command.h"
+#include "config.h"
 #include "router.h"
 #include "routerlist.h"
 
index e9c9cbd69aff8cea54fc50a68678752a20ee1468..a87238bec16e596f35eb7e7c8ff5a7a7f2d1e991 100644 (file)
@@ -14,6 +14,7 @@
 #include "or.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "config.h"
 #include "geoip.h"
 #include "rendclient.h"
 #include "rendservice.h"
diff --git a/src/or/config.h b/src/or/config.h
new file mode 100644 (file)
index 0000000..7a4ba5c
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2010, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * \file config.h
+ * \brief Header file for config.c.
+ **/
+
+#ifndef _TOR_CONFIG_H
+#define _TOR_CONFIG_H
+
+const char *get_dirportfrontpage(void);
+or_options_t *get_options(void);
+int set_options(or_options_t *new_val, char **msg);
+void config_free_all(void);
+const char *safe_str_client(const char *address);
+const char *safe_str(const char *address);
+const char *escaped_safe_str_client(const char *address);
+const char *escaped_safe_str(const char *address);
+const char *get_version(void);
+
+int config_get_lines(const char *string, config_line_t **result);
+void config_free_lines(config_line_t *front);
+setopt_err_t options_trial_assign(config_line_t *list, int use_defaults,
+                                  int clear_first, char **msg);
+int resolve_my_address(int warn_severity, or_options_t *options,
+                       uint32_t *addr, char **hostname_out);
+int is_local_addr(const tor_addr_t *addr) ATTR_PURE;
+void options_init(or_options_t *options);
+char *options_dump(or_options_t *options, int minimal);
+int options_init_from_torrc(int argc, char **argv);
+setopt_err_t options_init_from_string(const char *cf,
+                            int command, const char *command_arg, char **msg);
+int option_is_recognized(const char *key);
+const char *option_get_canonical_name(const char *key);
+config_line_t *option_get_assignment(or_options_t *options,
+                                     const char *key);
+int options_save_current(void);
+const char *get_torrc_fname(void);
+char *options_get_datadir_fname2_suffix(or_options_t *options,
+                                        const char *sub1, const char *sub2,
+                                        const char *suffix);
+#define get_datadir_fname2_suffix(sub1, sub2, suffix) \
+  options_get_datadir_fname2_suffix(get_options(), (sub1), (sub2), (suffix))
+/** Return a newly allocated string containing datadir/sub1.  See
+ * get_datadir_fname2_suffix.  */
+#define get_datadir_fname(sub1) get_datadir_fname2_suffix((sub1), NULL, NULL)
+/** Return a newly allocated string containing datadir/sub1/sub2.  See
+ * get_datadir_fname2_suffix.  */
+#define get_datadir_fname2(sub1,sub2) \
+  get_datadir_fname2_suffix((sub1), (sub2), NULL)
+/** Return a newly allocated string containing datadir/sub1suffix.  See
+ * get_datadir_fname2_suffix. */
+#define get_datadir_fname_suffix(sub1, suffix) \
+  get_datadir_fname2_suffix((sub1), NULL, (suffix))
+
+or_state_t *get_or_state(void);
+int or_state_save(time_t now);
+
+int options_need_geoip_info(or_options_t *options, const char **reason_out);
+int getinfo_helper_config(control_connection_t *conn,
+                          const char *question, char **answer,
+                          const char **errmsg);
+
+const char *tor_get_digests(void);
+uint32_t get_effective_bwrate(or_options_t *options);
+uint32_t get_effective_bwburst(or_options_t *options);
+
+#ifdef CONFIG_PRIVATE
+/* Used only by config.c and test.c */
+or_options_t *options_new(void);
+#endif
+
+#endif
+
index 255dcccdf5421cd411e520b112cae75f15e5f01a..5265430ac1bcd492df4b93e21eb84cb70611e900 100644 (file)
@@ -15,6 +15,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "dnsserv.h"
 #include "geoip.h"
 #include "rendclient.h"
index 311c481611e714c8083923793481f05a97803228..ec49d6632a0be8f4c7cebee17ced38312ffe9a03 100644 (file)
@@ -13,6 +13,7 @@
 #include "buffers.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "dnsserv.h"
 #include "rendclient.h"
 #include "rendcommon.h"
index a1e37200313dc01bfc415c3e4275143d2426dda6..f9fda6553f9eb96af3fb8a945aa43051e3251000 100644 (file)
@@ -14,6 +14,7 @@
 #include "buffers.h"
 #include "circuitbuild.h"
 #include "command.h"
+#include "config.h"
 #include "geoip.h"
 #include "router.h"
 #include "routerlist.h"
index 9c2f4f55d2f87a1ba91193bd8164d83a15a1e52b..f6363e522e28d3039ffa2a7388c78f9bf8377b90 100644 (file)
@@ -15,6 +15,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "dnsserv.h"
 #include "geoip.h"
 #include "router.h"
index b9c51d4fcb725dfbc1df20eaadffc72a6e2ee990..babc6d67ba002199531baa921bd5cc973884f471 100644 (file)
@@ -16,6 +16,7 @@
 #include "buffers.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "config.h"
 #include "router.h"
 
 /** The maximum number of cpuworker processes we will keep around. */
index 40f1a1e7f440cd4af85be1b584ff9f63fd27e43e..fa340c1266e0eccd062c2cd2757b5a0a608222ff 100644 (file)
@@ -6,6 +6,7 @@
 #include "or.h"
 #include "buffers.h"
 #include "circuitbuild.h"
+#include "config.h"
 #include "geoip.h"
 #include "rendclient.h"
 #include "rendcommon.h"
index d24fca027a73f532d3408898a41386c204035ccc..2177344878a7575b56cd8160b5d3a87bc121549b 100644 (file)
@@ -6,6 +6,7 @@
 #define DIRSERV_PRIVATE
 #include "or.h"
 #include "buffers.h"
+#include "config.h"
 #include "router.h"
 #include "routerlist.h"
 
index 782e04c1b7adfd2e494c5ff8aae9ff3ee06cac81..6e6bf8d08899a62c4f6c50294bb948636a2b2f7f 100644 (file)
@@ -5,6 +5,7 @@
 
 #define DIRVOTE_PRIVATE
 #include "or.h"
+#include "config.h"
 #include "router.h"
 #include "routerlist.h"
 
index 131304711a693f61b639da23c4a0a632cfe568b4..905be3ef9be2d16acc60582c7d93c69fcd100c22 100644 (file)
@@ -14,6 +14,7 @@
 #include "or.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "router.h"
 #include "ht.h"
 #ifdef HAVE_EVENT2_DNS_H
index 390ef2f7b1bf7210eab01165deb6a58a079e9dc8..68d8122f82bf2eac12ab18fbc1980a988421a300 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "or.h"
 #include "dnsserv.h"
+#include "config.h"
 #ifdef HAVE_EVENT2_DNS_H
 #include <event2/dns.h>
 #include <event2/dns_compat.h>
index 5275c6ec7340bef4e8c89f93a635c01150b4255e..16b3b14ed9324db3229891e52fc4189f93576568 100644 (file)
@@ -10,6 +10,7 @@
 #define GEOIP_PRIVATE
 #include "or.h"
 #include "ht.h"
+#include "config.h"
 #include "dnsserv.h"
 #include "geoip.h"
 #include "routerlist.h"
index 245c6d4efbbd249056e65e3f745351790fbd13aa..74b1d85ded06d58e9ef4b93980269e5cbe949f7c 100644 (file)
@@ -22,6 +22,7 @@ hibernating, phase 2:
 */
 
 #include "or.h"
+#include "config.h"
 #include "router.h"
 
 /** Possible values of hibernate_state */
index 9d4dfed80595d0e2490a3ef958d938aef12c4c62..4af66c356097fb1fc2074e261db1532e51ae2262 100644 (file)
@@ -17,6 +17,7 @@
 #include "circuitlist.h"
 #include "circuituse.h"
 #include "command.h"
+#include "config.h"
 #include "dnsserv.h"
 #include "geoip.h"
 #include "rendclient.h"
index b3c54a84f5f3b00f2a6b311414dced39fdca0516..0e478bf2a67a040509dd09bf32faa09408b09edf 100644 (file)
@@ -2,6 +2,7 @@
 /* See LICENSE for licensing information */
 
 #include "or.h"
+#include "config.h"
 
 /** A data structure to hold a bunch of cached microdescriptors.  There are
  * two active files in the cache: a "cache file" that we mmap, and a "journal
index 06472f2e6094030ab827b2bda09dbfa0aa9ff384..34ead6f30dad267cecf062bbfa96ac062aa90b50 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "or.h"
 #include "circuitbuild.h"
+#include "config.h"
 #include "router.h"
 #include "routerlist.h"
 
index 2d666475fe4cc60e4a8d1cbd1c3976621aa2ebbd..5b4f3a07c7d65c17ef452b2ac357eebf04d845bd 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "or.h"
 #include "circuitlist.h"
+#include "config.h"
 
 /** Type for a linked list of circuits that are waiting for a free CPU worker
  * to process a waiting onion handshake. */
index 29d51fc19db06f34f03a3947716671e8dc7c6448..d2b6dd8bc74a7dfa4ddd0ccc7b55d5f990b17e8c 100644 (file)
@@ -3066,68 +3066,6 @@ typedef enum setopt_err_t {
   SETOPT_ERR_SETTING = -4,
 } setopt_err_t;
 
-const char *get_dirportfrontpage(void);
-or_options_t *get_options(void);
-int set_options(or_options_t *new_val, char **msg);
-void config_free_all(void);
-const char *safe_str_client(const char *address);
-const char *safe_str(const char *address);
-const char *escaped_safe_str_client(const char *address);
-const char *escaped_safe_str(const char *address);
-const char *get_version(void);
-
-int config_get_lines(const char *string, config_line_t **result);
-void config_free_lines(config_line_t *front);
-setopt_err_t options_trial_assign(config_line_t *list, int use_defaults,
-                                  int clear_first, char **msg);
-int resolve_my_address(int warn_severity, or_options_t *options,
-                       uint32_t *addr, char **hostname_out);
-int is_local_addr(const tor_addr_t *addr) ATTR_PURE;
-void options_init(or_options_t *options);
-char *options_dump(or_options_t *options, int minimal);
-int options_init_from_torrc(int argc, char **argv);
-setopt_err_t options_init_from_string(const char *cf,
-                            int command, const char *command_arg, char **msg);
-int option_is_recognized(const char *key);
-const char *option_get_canonical_name(const char *key);
-config_line_t *option_get_assignment(or_options_t *options,
-                                     const char *key);
-int options_save_current(void);
-const char *get_torrc_fname(void);
-char *options_get_datadir_fname2_suffix(or_options_t *options,
-                                        const char *sub1, const char *sub2,
-                                        const char *suffix);
-#define get_datadir_fname2_suffix(sub1, sub2, suffix) \
-  options_get_datadir_fname2_suffix(get_options(), (sub1), (sub2), (suffix))
-/** Return a newly allocated string containing datadir/sub1.  See
- * get_datadir_fname2_suffix.  */
-#define get_datadir_fname(sub1) get_datadir_fname2_suffix((sub1), NULL, NULL)
-/** Return a newly allocated string containing datadir/sub1/sub2.  See
- * get_datadir_fname2_suffix.  */
-#define get_datadir_fname2(sub1,sub2) \
-  get_datadir_fname2_suffix((sub1), (sub2), NULL)
-/** Return a newly allocated string containing datadir/sub1suffix.  See
- * get_datadir_fname2_suffix. */
-#define get_datadir_fname_suffix(sub1, suffix) \
-  get_datadir_fname2_suffix((sub1), NULL, (suffix))
-
-or_state_t *get_or_state(void);
-int or_state_save(time_t now);
-
-int options_need_geoip_info(or_options_t *options, const char **reason_out);
-int getinfo_helper_config(control_connection_t *conn,
-                          const char *question, char **answer,
-                          const char **errmsg);
-
-const char *tor_get_digests(void);
-uint32_t get_effective_bwrate(or_options_t *options);
-uint32_t get_effective_bwburst(or_options_t *options);
-
-#ifdef CONFIG_PRIVATE
-/* Used only by config.c and test.c */
-or_options_t *options_new(void);
-#endif
-
 /********************************* connection.c ***************************/
 
 const char *conn_type_to_string(int type);
index f5c02a6000f5114b6da9b2e910bddb23be18964e..8866b57c9d183a92549e70e2e0ac2f4ef771e4a8 100644 (file)
@@ -9,6 +9,7 @@
  **/
 
 #include "or.h"
+#include "config.h"
 #include "ht.h"
 
 /** Policy that addresses for incoming SOCKS connections must match. */
index e1c64ebff38d67435479693440b5969df9ecc036..569e25390099d24fa1e4713fdbc8e3b9b4c3c7c6 100644 (file)
@@ -9,6 +9,7 @@
  **/
 
 #include "or.h"
+#include "config.h"
 
 /***************************** Edge (stream) reasons **********************/
 
index 87f453dac894d56136298e0d969c029397655bcd..53631ab412daa5e513abae50d7233d341d33d30c 100644 (file)
@@ -15,6 +15,7 @@
 #include "buffers.h"
 #include "circuitbuild.h"
 #include "circuitlist.h"
+#include "config.h"
 #include "geoip.h"
 #include "mempool.h"
 #include "rendcommon.h"
index c8e6c0a4f5137acd1f1ffa414650587ce8bc97e0..5e1f81ee4f31bc839e991b9ef5bdccdd031ecda5 100644 (file)
@@ -11,6 +11,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "routerlist.h"
index e8d101484b8116796817c76e5a540c42fd82c95f..a8862ae447362fa5d4ec37cef940046643330f88 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "or.h"
 #include "circuitbuild.h"
+#include "config.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "rendservice.h"
index a248828a0a429b77ec876adce5c3fae2db0f19a5..f99654372a746678d52f614f26f356dca529395c 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "or.h"
 #include "circuitlist.h"
+#include "config.h"
 
 /** Respond to an ESTABLISH_INTRO cell by checking the signed data and
  * setting the circuit's purpose and service pk digest.
index fea0b06a1ad5fe6d6c9a7e9d9d5bb3731ca1da0f..a7ed2007f56b1f027b15a1641ae618533886f080 100644 (file)
@@ -11,6 +11,7 @@
 #include "circuitbuild.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "rendclient.h"
 #include "rendcommon.h"
 #include "rendservice.h"
index 4fa421e51e0ba289b134798600d36c61e632cd57..88ba83e3e5c63ce3a60554aa603aef01784d19f2 100644 (file)
@@ -12,6 +12,7 @@
 #include "or.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "router.h"
 #include "routerlist.h"
 #include "ht.h"
index a1af88f57c3c195ced355a4a8fc274293835fc5d..20990b2dd872233ae3476f1a7464230a6f66120d 100644 (file)
@@ -9,6 +9,7 @@
 #include "or.h"
 #include "circuitlist.h"
 #include "circuituse.h"
+#include "config.h"
 #include "geoip.h"
 #include "router.h"
 #include "routerlist.h"
index 76e9b1b3d58afdb4eac5d3f4c3021bab676056e6..5cf698aaa2c785d37818245dac9b9552cc2861bb 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "or.h"
 #include "circuitbuild.h"
+#include "config.h"
 #include "geoip.h"
 #include "rendcommon.h"
 #include "rendservice.h"
index 1a770c87e4846961c23aef73e13c743a944b805f..b406a1cbafc409d53b7ff2edcbd481fde428ce35 100644 (file)
@@ -10,6 +10,7 @@
  **/
 
 #include "or.h"
+#include "config.h"
 #include "rendcommon.h"
 #include "router.h"
 #include "routerlist.h"
index ef9d9d61ee921ecab0b1e3700eddb8dc5c07950a..30bb1a0f780323fe63ffb53650a8e377af9214c6 100644 (file)
@@ -45,6 +45,7 @@ double fabs(double x);
 #include "or.h"
 #include "buffers.h"
 #include "circuitbuild.h"
+#include "config.h"
 #include "geoip.h"
 #include "rendcommon.h"
 #include "test.h"
index bba96325c46b8bdb70bf77f0ffb1bc8e57e76c1b..fc31d055c77eb874b3da5c873ab38caf5bec84f9 100644 (file)
@@ -7,6 +7,7 @@
 #define CONTROL_PRIVATE
 #define MEMPOOL_PRIVATE
 #include "or.h"
+#include "config.h"
 #include "test.h"
 #include "mempool.h"
 #include "memarea.h"