diff options
author | Gregory Mullen (grayhatter) <greg@grayhatter.com> | 2016-11-11 03:10:24 -0800 |
---|---|---|
committer | Gregory Mullen (grayhatter) <greg@grayhatter.com> | 2016-11-24 17:38:34 -0800 |
commit | ad517eb1df8841db52a45c7ac9ecf5976a290d57 (patch) | |
tree | 6e0d82599a6c1b0fd819ecf84e4abc82aa41b02e /toxcore/tox.c | |
parent | 19711d0fd0e2c181c3fe9df692b15f57390420d1 (diff) |
add NAT hole punching level to Tox API
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r-- | toxcore/tox.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index c7d90871..6317d126 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -131,6 +131,7 @@ ACCESSORS(uint16_t, proxy_ , port) | |||
131 | ACCESSORS(uint16_t, , start_port) | 131 | ACCESSORS(uint16_t, , start_port) |
132 | ACCESSORS(uint16_t, , end_port) | 132 | ACCESSORS(uint16_t, , end_port) |
133 | ACCESSORS(uint16_t, , tcp_port) | 133 | ACCESSORS(uint16_t, , tcp_port) |
134 | ACCESSORS(bool, , hole_punching_enabled) | ||
134 | ACCESSORS(TOX_SAVEDATA_TYPE, savedata_, type) | 135 | ACCESSORS(TOX_SAVEDATA_TYPE, savedata_, type) |
135 | ACCESSORS(size_t, savedata_, length) | 136 | ACCESSORS(size_t, savedata_, length) |
136 | ACCESSORS(tox_log_cb *, log_, callback) | 137 | ACCESSORS(tox_log_cb *, log_, callback) |
@@ -155,6 +156,7 @@ void tox_options_default(struct Tox_Options *options) | |||
155 | options->ipv6_enabled = 1; | 156 | options->ipv6_enabled = 1; |
156 | options->udp_enabled = 1; | 157 | options->udp_enabled = 1; |
157 | options->proxy_type = TOX_PROXY_TYPE_NONE; | 158 | options->proxy_type = TOX_PROXY_TYPE_NONE; |
159 | options->hole_punching_enabled = true; | ||
158 | } | 160 | } |
159 | } | 161 | } |
160 | 162 | ||
@@ -219,6 +221,7 @@ Tox *tox_new(const struct Tox_Options *options, TOX_ERR_NEW *error) | |||
219 | m_options.port_range[0] = options->start_port; | 221 | m_options.port_range[0] = options->start_port; |
220 | m_options.port_range[1] = options->end_port; | 222 | m_options.port_range[1] = options->end_port; |
221 | m_options.tcp_server_port = options->tcp_port; | 223 | m_options.tcp_server_port = options->tcp_port; |
224 | m_options.hole_punching_enabled = options->hole_punching_enabled; | ||
222 | 225 | ||
223 | m_options.log_callback = (logger_cb *)options->log_callback; | 226 | m_options.log_callback = (logger_cb *)options->log_callback; |
224 | m_options.log_user_data = options->log_user_data; | 227 | m_options.log_user_data = options->log_user_data; |