diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-01-23 12:41:19 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-25 10:37:03 -0400 |
commit | 6dd462e8bcaecb8224302b402214b546cf790c5f (patch) | |
tree | fdb0bd0e1029d1c5d9b6a3967b1adaa9203b196d /src/or/control.c | |
parent | 2452302354fdd6d34e1637380ffc73af067fd904 (diff) | |
download | tor-6dd462e8bcaecb8224302b402214b546cf790c5f.tar.gz tor-6dd462e8bcaecb8224302b402214b546cf790c5f.zip |
Implement the TRANSPORT_LAUNCHED control port event.
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c index fc4809b399..37bbab4d4f 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -82,7 +82,8 @@ #define EVENT_BUILDTIMEOUT_SET 0x0017 #define EVENT_SIGNAL 0x0018 #define EVENT_CONF_CHANGED 0x0019 -#define EVENT_MAX_ 0x0019 +#define EVENT_TRANSPORT_LAUNCHED 0x0020 +#define EVENT_MAX_ 0x0020 /* If EVENT_MAX_ ever hits 0x0020, we need to make the mask wider. */ /** Bitfield: The bit 1<<e is set if <b>any</b> open control @@ -958,6 +959,7 @@ static const struct control_event_t control_event_table[] = { { EVENT_BUILDTIMEOUT_SET, "BUILDTIMEOUT_SET" }, { EVENT_SIGNAL, "SIGNAL" }, { EVENT_CONF_CHANGED, "CONF_CHANGED"}, + { EVENT_TRANSPORT_LAUNCHED, "TRANSPORT_LAUNCHED" }, { 0, NULL }, }; @@ -4737,6 +4739,21 @@ control_event_clients_seen(const char *controller_str) "650 CLIENTS_SEEN %s\r\n", controller_str); } +/** A new pluggable transport called <b>transport_name</b> was + * launched on <b>addr</b>:<b>port</b>. <b>mode</b> is either + * "server" or "client" depending on the mode of the pluggable + * transport. + * "650" SP "TRANSPORT_LAUNCHED" SP Mode SP Name SP Address SP Port + */ +void +control_event_transport_launched(const char *mode, const char *transport_name, + tor_addr_t *addr, uint16_t port) +{ + send_control_event(EVENT_TRANSPORT_LAUNCHED, ALL_FORMATS, + "650 TRANSPORT_LAUNCHED %s %s %s %u\r\n", + mode, transport_name, fmt_addr(addr), port); +} + /** Free any leftover allocated memory of the control.c subsystem. */ void control_free_all(void) |