aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-07-22 12:30:46 +0200
committerSebastian Hahn <sebastian@torproject.org>2010-07-27 07:58:16 +0200
commita86f464f6b04e2f592d3e8dcbd2b26414a36e971 (patch)
tree8e34d5453a82b08f3310d4fc3edee674c1c0d432 /src/or
parentdc2f1666ff5285823ad6c7e3df59b8022aff936c (diff)
downloadtor-a86f464f6b04e2f592d3e8dcbd2b26414a36e971.tar
tor-a86f464f6b04e2f592d3e8dcbd2b26414a36e971.tar.gz
Create hibernate.h
Diffstat (limited to 'src/or')
-rw-r--r--src/or/command.c1
-rw-r--r--src/or/config.c1
-rw-r--r--src/or/connection_edge.c1
-rw-r--r--src/or/control.c1
-rw-r--r--src/or/dirserv.c1
-rw-r--r--src/or/hibernate.c1
-rw-r--r--src/or/hibernate.h30
-rw-r--r--src/or/main.c1
-rw-r--r--src/or/or.h16
-rw-r--r--src/or/router.c1
-rw-r--r--src/or/routerlist.c1
11 files changed, 39 insertions, 16 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 771dcc4c4..796f75cde 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -24,6 +24,7 @@
#include "config.h"
#include "control.h"
#include "cpuworker.h"
+#include "hibernate.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/config.c b/src/or/config.c
index eed14f2fe..68710ee8c 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -23,6 +23,7 @@
#include "dirvote.h"
#include "dns.h"
#include "geoip.h"
+#include "hibernate.h"
#include "rendclient.h"
#include "rendservice.h"
#include "router.h"
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 0277b88d1..28ed9ad62 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -21,6 +21,7 @@
#include "dns.h"
#include "dnsserv.h"
#include "dirserv.h"
+#include "hibernate.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "rendservice.h"
diff --git a/src/or/control.c b/src/or/control.c
index 9ad6dfd47..f8a3f20ec 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -23,6 +23,7 @@
#include "dirserv.h"
#include "dnsserv.h"
#include "geoip.h"
+#include "hibernate.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index b9fc489d5..d3fe0a709 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -13,6 +13,7 @@
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
+#include "hibernate.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index cd7cdad3d..a30e25ee9 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -25,6 +25,7 @@ hibernating, phase 2:
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "hibernate.h"
#include "router.h"
/** Possible values of hibernate_state */
diff --git a/src/or/hibernate.h b/src/or/hibernate.h
new file mode 100644
index 000000000..8192ac5d8
--- /dev/null
+++ b/src/or/hibernate.h
@@ -0,0 +1,30 @@
+/* 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 hibernate.h
+ * \brief Header file for hibernate.c.
+ **/
+
+#ifndef _TOR_HIBERNATE_H
+#define _TOR_HIBERNATE_H
+
+int accounting_parse_options(or_options_t *options, int validate_only);
+int accounting_is_enabled(or_options_t *options);
+void configure_accounting(time_t now);
+void accounting_run_housekeeping(time_t now);
+void accounting_add_bytes(size_t n_read, size_t n_written, int seconds);
+int accounting_record_bandwidth_usage(time_t now, or_state_t *state);
+void hibernate_begin_shutdown(void);
+int we_are_hibernating(void);
+void consider_hibernation(time_t now);
+int getinfo_helper_accounting(control_connection_t *conn,
+ const char *question, char **answer,
+ const char **errmsg);
+void accounting_set_bandwidth_usage_from_state(or_state_t *state);
+
+#endif
+
diff --git a/src/or/main.c b/src/or/main.c
index d42cda27a..d33072197 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -29,6 +29,7 @@
#include "dns.h"
#include "dnsserv.h"
#include "geoip.h"
+#include "hibernate.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "rendservice.h"
diff --git a/src/or/or.h b/src/or/or.h
index 828908e66..550331fce 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3268,22 +3268,6 @@ typedef enum {
DIRREQ_OR_CONN_BUFFER_FLUSHED = 4
} dirreq_state_t;
-/********************************* hibernate.c **********************/
-
-int accounting_parse_options(or_options_t *options, int validate_only);
-int accounting_is_enabled(or_options_t *options);
-void configure_accounting(time_t now);
-void accounting_run_housekeeping(time_t now);
-void accounting_add_bytes(size_t n_read, size_t n_written, int seconds);
-int accounting_record_bandwidth_usage(time_t now, or_state_t *state);
-void hibernate_begin_shutdown(void);
-int we_are_hibernating(void);
-void consider_hibernation(time_t now);
-int getinfo_helper_accounting(control_connection_t *conn,
- const char *question, char **answer,
- const char **errmsg);
-void accounting_set_bandwidth_usage_from_state(or_state_t *state);
-
/********************************* main.c ***************************/
extern int has_completed_circuit;
diff --git a/src/or/router.c b/src/or/router.c
index 44cffa4a3..e4ffc2f21 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -16,6 +16,7 @@
#include "dirserv.h"
#include "dns.h"
#include "geoip.h"
+#include "hibernate.h"
#include "router.h"
#include "routerlist.h"
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 85e2d14ed..0e42acfee 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -20,6 +20,7 @@
#include "dirserv.h"
#include "dirvote.h"
#include "geoip.h"
+#include "hibernate.h"
#include "rendcommon.h"
#include "rendservice.h"
#include "router.h"