diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-02-11 13:43:20 +0000 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2013-02-11 18:07:26 +0000 |
commit | 266f8cddd87f8cf507e094725b3f6028bb8d803b (patch) | |
tree | 5d903eb81b90ccfe4b5356e8623d83b53ec434d0 /src/or/config.h | |
parent | b5dceab1751dfa12b27b3042a49d90e0b02c2e0c (diff) | |
download | tor-266f8cddd87f8cf507e094725b3f6028bb8d803b.tar.gz tor-266f8cddd87f8cf507e094725b3f6028bb8d803b.zip |
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.
Diffstat (limited to 'src/or/config.h')
-rw-r--r-- | src/or/config.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/config.h b/src/or/config.h index 8e34655805..b5c0c734bf 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 |