[tor-commits] [tor/master] relay: Make a transport_config function private
teor at torproject.org
teor at torproject.org
Tue Nov 5 04:28:52 UTC 2019
commit 85e50954d85e0372d2f4e854e651817389b4ece9
Author: teor <teor at torproject.org>
Date: Thu Oct 31 00:18:22 2019 +1000
relay: Make a transport_config function private
Part of 32213.
---
src/feature/relay/transport_config.c | 3 ++-
src/feature/relay/transport_config.h | 12 ++++++++++--
src/test/test_config.c | 1 +
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/feature/relay/transport_config.c b/src/feature/relay/transport_config.c
index 4ce00ec6c..4a2eb0d32 100644
--- a/src/feature/relay/transport_config.c
+++ b/src/feature/relay/transport_config.c
@@ -11,6 +11,7 @@
**/
#include "orconfig.h"
+#define RELAY_TRANSPORT_CONFIG_PRIVATE
#include "feature/relay/transport_config.h"
#include "lib/encoding/confline.h"
@@ -111,7 +112,7 @@ get_transport_bindaddr_from_config(const char *transport)
*
* The returned smartlist and its strings are allocated on the heap
* and it's the responsibility of the caller to free it. */
-smartlist_t *
+STATIC smartlist_t *
get_options_from_transport_options_line(const char *line,const char *transport)
{
smartlist_t *items = smartlist_new();
diff --git a/src/feature/relay/transport_config.h b/src/feature/relay/transport_config.h
index d3ecc9338..fe3747f66 100644
--- a/src/feature/relay/transport_config.h
+++ b/src/feature/relay/transport_config.h
@@ -12,12 +12,12 @@
#ifndef TOR_FEATURE_RELAY_TRANSPORT_CONFIG_H
#define TOR_FEATURE_RELAY_TRANSPORT_CONFIG_H
+#include "lib/testsupport/testsupport.h"
+
typedef struct or_options_t or_options_t;
typedef struct smartlist_t smartlist_t;
char *get_transport_bindaddr_from_config(const char *transport);
-smartlist_t *get_options_from_transport_options_line(const char *line,
- const char *transport);
smartlist_t *get_options_for_server_transport(const char *transport);
int options_validate_server_transport(const or_options_t *old_options,
@@ -26,4 +26,12 @@ int options_validate_server_transport(const or_options_t *old_options,
int options_act_server_transport(const or_options_t *old_options);
+#ifdef RELAY_TRANSPORT_CONFIG_PRIVATE
+
+STATIC smartlist_t *get_options_from_transport_options_line(
+ const char *line,
+ const char *transport);
+
+#endif
+
#endif /* !defined(TOR_FEATURE_RELAY_TRANSPORT_CONFIG_H) */
diff --git a/src/test/test_config.c b/src/test/test_config.c
index fce6ad97d..8d036f9f2 100644
--- a/src/test/test_config.c
+++ b/src/test/test_config.c
@@ -7,6 +7,7 @@
#define CONFIG_PRIVATE
#define RELAY_CONFIG_PRIVATE
+#define RELAY_TRANSPORT_CONFIG_PRIVATE
#define PT_PRIVATE
#define ROUTERSET_PRIVATE
#include "core/or/or.h"
More information about the tor-commits
mailing list