summaryrefslogtreecommitdiff
path: root/src/feature/control/control_events.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-03-25 12:48:52 -0400
committerNick Mathewson <nickm@torproject.org>2019-03-25 12:49:24 -0400
commit4754e9058b7521967dd92092e54483cec456bb2f (patch)
treeaeb765f6880ee356e339cb5c5efe4a408bd833f4 /src/feature/control/control_events.c
parenta49f506e05364eb0fd14d02e3cd482941942928e (diff)
downloadtor-4754e9058b7521967dd92092e54483cec456bb2f.tar.gz
tor-4754e9058b7521967dd92092e54483cec456bb2f.zip
Split getinfo handling into a new control_getinfo.c
Diffstat (limited to 'src/feature/control/control_events.c')
-rw-r--r--src/feature/control/control_events.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/feature/control/control_events.c b/src/feature/control/control_events.c
index 07e1a9d94a..129776f49f 100644
--- a/src/feature/control/control_events.c
+++ b/src/feature/control/control_events.c
@@ -72,6 +72,43 @@ static void send_control_event(uint16_t event,
const char *format, ...)
CHECK_PRINTF(2,3);
+/** Table mapping event values to their names. Used to implement SETEVENTS
+ * and GETINFO events/names, and to keep they in sync. */
+const struct control_event_t control_event_table[] = {
+ { EVENT_CIRCUIT_STATUS, "CIRC" },
+ { EVENT_CIRCUIT_STATUS_MINOR, "CIRC_MINOR" },
+ { EVENT_STREAM_STATUS, "STREAM" },
+ { EVENT_OR_CONN_STATUS, "ORCONN" },
+ { EVENT_BANDWIDTH_USED, "BW" },
+ { EVENT_DEBUG_MSG, "DEBUG" },
+ { EVENT_INFO_MSG, "INFO" },
+ { EVENT_NOTICE_MSG, "NOTICE" },
+ { EVENT_WARN_MSG, "WARN" },
+ { EVENT_ERR_MSG, "ERR" },
+ { EVENT_NEW_DESC, "NEWDESC" },
+ { EVENT_ADDRMAP, "ADDRMAP" },
+ { EVENT_DESCCHANGED, "DESCCHANGED" },
+ { EVENT_NS, "NS" },
+ { EVENT_STATUS_GENERAL, "STATUS_GENERAL" },
+ { EVENT_STATUS_CLIENT, "STATUS_CLIENT" },
+ { EVENT_STATUS_SERVER, "STATUS_SERVER" },
+ { EVENT_GUARD, "GUARD" },
+ { EVENT_STREAM_BANDWIDTH_USED, "STREAM_BW" },
+ { EVENT_CLIENTS_SEEN, "CLIENTS_SEEN" },
+ { EVENT_NEWCONSENSUS, "NEWCONSENSUS" },
+ { EVENT_BUILDTIMEOUT_SET, "BUILDTIMEOUT_SET" },
+ { EVENT_GOT_SIGNAL, "SIGNAL" },
+ { EVENT_CONF_CHANGED, "CONF_CHANGED"},
+ { EVENT_CONN_BW, "CONN_BW" },
+ { EVENT_CELL_STATS, "CELL_STATS" },
+ { EVENT_CIRC_BANDWIDTH_USED, "CIRC_BW" },
+ { EVENT_TRANSPORT_LAUNCHED, "TRANSPORT_LAUNCHED" },
+ { EVENT_HS_DESC, "HS_DESC" },
+ { EVENT_HS_DESC_CONTENT, "HS_DESC_CONTENT" },
+ { EVENT_NETWORK_LIVENESS, "NETWORK_LIVENESS" },
+ { 0, NULL },
+};
+
/** Given a log severity, return the corresponding control event code. */
static inline int
log_severity_to_event(int severity)