aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-11 10:28:20 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-11 10:28:20 -0500
commitc5b58df77588fd1307d248e75d360eb27023033c (patch)
treef623990af1f5dcbd975b2390250fa42dc3cf5ecc /src/or/control.c
parent0e911abf27c7a7ede6dea81167c6e8b12b53174c (diff)
downloadtor-c5b58df77588fd1307d248e75d360eb27023033c.tar.gz
tor-c5b58df77588fd1307d248e75d360eb27023033c.zip
Add clarity/typesafety wrappers for control_event_circuit_status_minor
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 9cbb8cd04d..e15adbd8e8 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -3376,7 +3376,7 @@ control_event_circuit_status(origin_circuit_t *circ, circuit_status_event_t tp,
/** Something minor has happened to circuit <b>circ</b>: tell any
* interested control connections. */
-int
+static int
control_event_circuit_status_minor(origin_circuit_t *circ,
circuit_status_minor_event_t e,
int purpose, const struct timeval *tv)
@@ -3444,6 +3444,36 @@ control_event_circuit_status_minor(origin_circuit_t *circ,
return 0;
}
+/**
+ * <b>circ</b> has changed its purpose from <b>old_purpose</b>: tell any
+ * interested controllers.
+ */
+int
+control_event_circuit_purpose_changed(origin_circuit_t *circ,
+ int old_purpose)
+{
+ return control_event_circuit_status_minor(circ,
+ CIRC_MINOR_EVENT_PURPOSE_CHANGED,
+ old_purpose,
+ NULL);
+}
+
+/**
+ * <b>circ</b> has changed its purpose from <b>old_purpose</b>, and its
+ * created-time from <b>old_tv_created</b>: tell any interested controllers.
+ */
+int
+control_event_circuit_cannibalized(origin_circuit_t *circ,
+ int old_purpose,
+ const struct timeval *old_tv_created)
+{
+ return control_event_circuit_status_minor(circ,
+ CIRC_MINOR_EVENT_CANNIBALIZED,
+ old_purpose,
+ old_tv_created);
+}
+
+
/** Given an AP connection <b>conn</b> and a <b>len</b>-character buffer
* <b>buf</b>, determine the address:port combination requested on
* <b>conn</b>, and write it to <b>buf</b>. Return 0 on success, -1 on