#include "config.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "../common/util.h"
#include "../common/torlog.h"
#ifdef HAVE_UNISTD_H
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "router.h"
#include "routerlist.h"
#include "crypto.h"
#include "config.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "routerlist.h"
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "control.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "rendservice.h"
#include "connection.h"
#include "connection_or.h"
#include "config.h"
+#include "control.h"
#include "router.h"
#include "routerlist.h"
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "control.h"
#include "geoip.h"
#include "rendclient.h"
#include "rendservice.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "dnsserv.h"
#include "geoip.h"
#include "rendclient.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "dnsserv.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "config.h"
#include "connection.h"
#include "connection_or.h"
+#include "control.h"
#include "geoip.h"
#include "router.h"
#include "routerlist.h"
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "control.h"
#include "dnsserv.h"
#include "geoip.h"
#include "router.h"
--- /dev/null
+/* 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 control.h
+ * \brief Header file for control.c.
+ **/
+
+#ifndef _TOR_CONTROL_H
+#define _TOR_CONTROL_H
+
+void control_update_global_event_mask(void);
+void control_adjust_event_log_severity(void);
+
+/** Log information about the connection <b>conn</b>, protecting it as with
+ * CONN_LOG_PROTECT. Example:
+ *
+ * LOG_FN_CONN(conn, (LOG_DEBUG, "Socket %d wants to write", conn->s));
+ **/
+#define LOG_FN_CONN(conn, args) \
+ CONN_LOG_PROTECT(conn, log_fn args)
+
+int connection_control_finished_flushing(control_connection_t *conn);
+int connection_control_reached_eof(control_connection_t *conn);
+int connection_control_process_inbuf(control_connection_t *conn);
+
+#define EVENT_AUTHDIR_NEWDESCS 0x000D
+#define EVENT_NS 0x000F
+int control_event_is_interesting(int event);
+
+int control_event_circuit_status(origin_circuit_t *circ,
+ circuit_status_event_t e, int reason);
+int control_event_stream_status(edge_connection_t *conn,
+ stream_status_event_t e,
+ int reason);
+int control_event_or_conn_status(or_connection_t *conn,
+ or_conn_status_event_t e, int reason);
+int control_event_bandwidth_used(uint32_t n_read, uint32_t n_written);
+int control_event_stream_bandwidth(edge_connection_t *edge_conn);
+int control_event_stream_bandwidth_used(void);
+void control_event_logmsg(int severity, unsigned int domain, const char *msg);
+int control_event_descriptors_changed(smartlist_t *routers);
+int control_event_address_mapped(const char *from, const char *to,
+ time_t expires, const char *error);
+int control_event_or_authdir_new_descriptor(const char *action,
+ const char *desc,
+ size_t desclen,
+ const char *msg);
+int control_event_my_descriptor_changed(void);
+int control_event_networkstatus_changed(smartlist_t *statuses);
+
+int control_event_newconsensus(const networkstatus_t *consensus);
+int control_event_networkstatus_changed_single(routerstatus_t *rs);
+int control_event_general_status(int severity, const char *format, ...)
+ CHECK_PRINTF(2,3);
+int control_event_client_status(int severity, const char *format, ...)
+ CHECK_PRINTF(2,3);
+int control_event_server_status(int severity, const char *format, ...)
+ CHECK_PRINTF(2,3);
+int control_event_guard(const char *nickname, const char *digest,
+ const char *status);
+int control_event_buildtimeout_set(const circuit_build_times_t *cbt,
+ buildtimeout_set_event_t type);
+
+int init_cookie_authentication(int enabled);
+smartlist_t *decode_hashed_passwords(config_line_t *passwords);
+void disable_control_logging(void);
+void enable_control_logging(void);
+
+void control_event_bootstrap(bootstrap_status_t status, int progress);
+void control_event_bootstrap_problem(const char *warn, int reason);
+
+void control_event_clients_seen(const char *controller_str);
+
+#ifdef CONTROL_PRIVATE
+/* Used only by control.c and test.c */
+size_t write_escaped_data(const char *data, size_t len, char **out);
+size_t read_escaped_data(const char *data, size_t len, char **out);
+#endif
+
+#endif
+
#include "circuitlist.h"
#include "config.h"
#include "connection.h"
+#include "cpuworker.h"
#include "router.h"
/** The maximum number of cpuworker processes we will keep around. */
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "control.h"
#include "geoip.h"
#include "rendclient.h"
#include "rendcommon.h"
#include "config.h"
#include "connection.h"
#include "connection_or.h"
+#include "control.h"
#include "router.h"
#include "routerlist.h"
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "control.h"
#include "router.h"
#include "ht.h"
#ifdef HAVE_EVENT2_DNS_H
#include "config.h"
#include "connection.h"
#include "connection_edge.h"
+#include "control.h"
#ifdef HAVE_EVENT2_DNS_H
#include <event2/dns.h>
#include <event2/dns_compat.h>
#include "or.h"
#include "ht.h"
#include "config.h"
+#include "control.h"
#include "dnsserv.h"
#include "geoip.h"
#include "routerlist.h"
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "dnsserv.h"
#include "geoip.h"
#include "rendclient.h"
#include "circuitbuild.h"
#include "config.h"
#include "connection.h"
+#include "control.h"
#include "router.h"
#include "routerlist.h"
BUILDTIMEOUT_SET_EVENT_RESUME = 4
} buildtimeout_set_event_t;
-void control_update_global_event_mask(void);
-void control_adjust_event_log_severity(void);
-
/** Execute the statement <b>stmt</b>, which may log events concerning the
* connection <b>conn</b>. To prevent infinite loops, disable log messages
* being sent to controllers if <b>conn</b> is a control connection.
enable_control_logging(); \
STMT_END
-/** Log information about the connection <b>conn</b>, protecting it as with
- * CONN_LOG_PROTECT. Example:
- *
- * LOG_FN_CONN(conn, (LOG_DEBUG, "Socket %d wants to write", conn->s));
- **/
-#define LOG_FN_CONN(conn, args) \
- CONN_LOG_PROTECT(conn, log_fn args)
-
-int connection_control_finished_flushing(control_connection_t *conn);
-int connection_control_reached_eof(control_connection_t *conn);
-int connection_control_process_inbuf(control_connection_t *conn);
-
-#define EVENT_AUTHDIR_NEWDESCS 0x000D
-#define EVENT_NS 0x000F
-int control_event_is_interesting(int event);
-
-int control_event_circuit_status(origin_circuit_t *circ,
- circuit_status_event_t e, int reason);
-int control_event_stream_status(edge_connection_t *conn,
- stream_status_event_t e,
- int reason);
-int control_event_or_conn_status(or_connection_t *conn,
- or_conn_status_event_t e, int reason);
-int control_event_bandwidth_used(uint32_t n_read, uint32_t n_written);
-int control_event_stream_bandwidth(edge_connection_t *edge_conn);
-int control_event_stream_bandwidth_used(void);
-void control_event_logmsg(int severity, unsigned int domain, const char *msg);
-int control_event_descriptors_changed(smartlist_t *routers);
-int control_event_address_mapped(const char *from, const char *to,
- time_t expires, const char *error);
-int control_event_or_authdir_new_descriptor(const char *action,
- const char *desc,
- size_t desclen,
- const char *msg);
-int control_event_my_descriptor_changed(void);
-int control_event_networkstatus_changed(smartlist_t *statuses);
-int control_event_newconsensus(const networkstatus_t *consensus);
-int control_event_networkstatus_changed_single(routerstatus_t *rs);
-int control_event_general_status(int severity, const char *format, ...)
- CHECK_PRINTF(2,3);
-int control_event_client_status(int severity, const char *format, ...)
- CHECK_PRINTF(2,3);
-int control_event_server_status(int severity, const char *format, ...)
- CHECK_PRINTF(2,3);
-int control_event_guard(const char *nickname, const char *digest,
- const char *status);
-int control_event_buildtimeout_set(const circuit_build_times_t *cbt,
- buildtimeout_set_event_t type);
-
-int init_cookie_authentication(int enabled);
-smartlist_t *decode_hashed_passwords(config_line_t *passwords);
-void disable_control_logging(void);
-void enable_control_logging(void);
-
/** Enum describing various stages of bootstrapping, for use with controller
* bootstrap status events. The values range from 0 to 100. */
typedef enum {
BOOTSTRAP_STATUS_DONE=100
} bootstrap_status_t;
-void control_event_bootstrap(bootstrap_status_t status, int progress);
-void control_event_bootstrap_problem(const char *warn, int reason);
-
-void control_event_clients_seen(const char *controller_str);
-
-#ifdef CONTROL_PRIVATE
-/* Used only by control.c and test.c */
-size_t write_escaped_data(const char *data, size_t len, char **out);
-size_t read_escaped_data(const char *data, size_t len, char **out);
-#endif
-
/********************************* cpuworker.c *****************************/
void cpu_init(void);
#include "connection.h"
#include "connection_edge.h"
#include "connection_or.h"
+#include "control.h"
#include "geoip.h"
#include "mempool.h"
#include "rendcommon.h"
#include "circuituse.h"
#include "config.h"
#include "connection.h"
+#include "control.h"
#include "geoip.h"
#include "router.h"
#include "routerlist.h"
#include "circuitbuild.h"
#include "config.h"
#include "connection.h"
+#include "control.h"
#include "geoip.h"
#include "rendcommon.h"
#include "rendservice.h"
#define MEMPOOL_PRIVATE
#include "or.h"
#include "config.h"
+#include "control.h"
#include "test.h"
#include "mempool.h"
#include "memarea.h"