From 266f8cddd87f8cf507e094725b3f6028bb8d803b Mon Sep 17 00:00:00 2001 From: George Kadianakis Date: Mon, 11 Feb 2013 13:43:20 +0000 Subject: Refactoring to make parse_bridge_line() unittestable. - Make parse_bridge_line() return a struct. - Make bridge_add_from_config() accept a struct. - Make string_is_key_value() less hysterical. --- src/or/config.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/or/config.h') diff --git a/src/or/config.h b/src/or/config.h index 8e3465580..b5c0c734b 100644 --- a/src/or/config.h +++ b/src/or/config.h @@ -96,5 +96,19 @@ int addressmap_register_auto(const char *from, const char *to, addressmap_entry_source_t addrmap_source, const char **msg); +/** Represents the information stored in a torrc Bridge line. */ +typedef struct bridge_line_t { + tor_addr_t addr; /* The IP address of the bridge. */ + uint16_t port; /* The TCP port of the bridge. */ + char *transport_name; /* The name of the pluggable transport that + should be used to connect to the bridge. */ + char digest[DIGEST_LEN]; /* The bridge's identity key digest. */ + smartlist_t *socks_args;; /* SOCKS arguments for the pluggable + transport proxy. */ +} bridge_line_t; + +void bridge_line_free(bridge_line_t *bridge_line); +bridge_line_t *parse_bridge_line(const char *line); + #endif -- cgit v1.2.3