aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control/control.h
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2018-12-16 16:05:58 -0600
committerTaylor Yu <catalyst@torproject.org>2018-12-20 18:46:17 -0600
commit271b50f54abac7af44e3e54589ff965d3cdac816 (patch)
treeaef158a07f39a869855b0920f6dcd1241601b68b /src/feature/control/control.h
parent308dde0c386158971a66c6e035b3f1ad67019eb5 (diff)
downloadtor-271b50f54abac7af44e3e54589ff965d3cdac816.tar.gz
tor-271b50f54abac7af44e3e54589ff965d3cdac816.zip
Add ORCONN event pubsub system
Add a publish-subscribe subsystem to publish messages about changes to OR connections. connection_or_change_state() in connection_or.c and control_event_or_conn_event() in control.c publish messages to this subsystem via helper functions. Move state constants from connection_or.h to orconn_state.h so that subscribers don't have to include all of connection_or.h to take actions based on changes in OR connection state. Move event constants from control.h for similar reasons. Part of ticket 27167.
Diffstat (limited to 'src/feature/control/control.h')
-rw-r--r--src/feature/control/control.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/feature/control/control.h b/src/feature/control/control.h
index d78ce4d87c..d3245fcaf1 100644
--- a/src/feature/control/control.h
+++ b/src/feature/control/control.h
@@ -29,6 +29,8 @@ typedef enum circuit_status_minor_event_t {
CIRC_MINOR_EVENT_CANNIBALIZED,
} circuit_status_minor_event_t;
+#include "core/or/orconn_event.h"
+
/** Used to indicate the type of a stream event passed to the controller.
* The various types are defined in control-spec.txt */
typedef enum stream_status_event_t {
@@ -43,16 +45,6 @@ typedef enum stream_status_event_t {
STREAM_EVENT_REMAP = 8
} stream_status_event_t;
-/** Used to indicate the type of an OR connection event passed to the
- * controller. The various types are defined in control-spec.txt */
-typedef enum or_conn_status_event_t {
- OR_CONN_EVENT_LAUNCHED = 0,
- OR_CONN_EVENT_CONNECTED = 1,
- OR_CONN_EVENT_FAILED = 2,
- OR_CONN_EVENT_CLOSED = 3,
- OR_CONN_EVENT_NEW = 4,
-} or_conn_status_event_t;
-
/** Used to indicate the type of a buildtime event */
typedef enum buildtimeout_set_event_t {
BUILDTIMEOUT_SET_EVENT_COMPUTED = 0,