aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-08 18:07:32 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-08 18:07:32 -0400
commit159141a8c6e8ae6dc60110f897a931bf0a63e0b1 (patch)
tree872b2ea9f97c2dd63ad34627b33645012eb141df /src/feature
parentda4f4cb269c3bc68c8e468e9fb704aecb8531238 (diff)
parent772106c6bc37966f60be99a479240ced8abfea1b (diff)
downloadtor-159141a8c6e8ae6dc60110f897a931bf0a63e0b1.tar.gz
tor-159141a8c6e8ae6dc60110f897a931bf0a63e0b1.zip
Merge branch 'ticket26947'
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/api/tor_api.c7
-rw-r--r--src/feature/api/tor_api.h12
2 files changed, 17 insertions, 2 deletions
diff --git a/src/feature/api/tor_api.c b/src/feature/api/tor_api.c
index 2a4458bf69..a53ade1f3e 100644
--- a/src/feature/api/tor_api.c
+++ b/src/feature/api/tor_api.c
@@ -61,6 +61,12 @@ tor_main_configuration_free(tor_main_configuration_t *cfg)
raw_free(cfg);
}
+const char *
+tor_api_get_provider_version(void)
+{
+ return "tor " VERSION;
+}
+
/* Main entry point for the Tor process. Called from main().
*
* This function is distinct from main() only so we can link main.c into
@@ -85,4 +91,3 @@ tor_main(int argc, char *argv[])
tor_main_configuration_free(cfg);
return rv;
}
-
diff --git a/src/feature/api/tor_api.h b/src/feature/api/tor_api.h
index ead9493c1f..a08606ee3c 100644
--- a/src/feature/api/tor_api.h
+++ b/src/feature/api/tor_api.h
@@ -58,6 +58,17 @@ int tor_main_configuration_set_command_line(tor_main_configuration_t *cfg,
void tor_main_configuration_free(tor_main_configuration_t *cfg);
/**
+ * Return the name and version of the software implementing the tor_api
+ * functionality. Current implementors are "tor" and "libtorrunner".
+ *
+ * Note that if you're using libtorrunner, you'll see the version of
+ * libtorrunner, not the version of Tor that it's invoking for you.
+ *
+ * Added in Tor 0.3.5.1-alpha.
+ **/
+const char *tor_api_get_provider_version(void);
+
+/**
* Run the tor process, as if from the command line.
*
* The command line arguments from tor_main_configuration_set_command_line()
@@ -98,4 +109,3 @@ int tor_run_main(const tor_main_configuration_t *);
int tor_main(int argc, char **argv);
#endif /* !defined(TOR_API_H) */
-