Skip to content

Commit

Permalink
Merge 5b14542 into ae7899c
Browse files Browse the repository at this point in the history
  • Loading branch information
cotox committed Jun 26, 2018
2 parents ae7899c + 5b14542 commit 81cd78a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
10 changes: 5 additions & 5 deletions toxcore/tox.api.h
Original file line number Diff line number Diff line change
Expand Up @@ -756,18 +756,18 @@ uint8_t[size] savedata {
* This function will attempt to connect to the node using UDP. You must use
* this function even if ${options.this.udp_enabled} was set to false.
*
* @param address The hostname or IP address (IPv4 or IPv6) of the node. Must be
* @param host The hostname or IP address (IPv4 or IPv6) of the node. Must be
* at most $MAX_HOSTNAME_LENGTH chars, including the NUL byte.
* @param port The port on the host on which the bootstrap Tox instance is
* listening.
* @param public_key The long term public key of the bootstrap node
* ($PUBLIC_KEY_SIZE bytes).
* @return true on success.
*/
bool bootstrap(string address, uint16_t port, const uint8_t[PUBLIC_KEY_SIZE] public_key) {
bool bootstrap(string host, uint16_t port, const uint8_t[PUBLIC_KEY_SIZE] public_key) {
NULL,
/**
* The address could not be resolved to an IP address, or the IP address
* The hostname could not be resolved to an IP address, or the IP address
* passed was invalid.
*/
BAD_HOST,
Expand All @@ -785,13 +785,13 @@ bool bootstrap(string address, uint16_t port, const uint8_t[PUBLIC_KEY_SIZE] pub
* the same bootstrap node, or to add TCP relays without using them as
* bootstrap nodes.
*
* @param address The hostname or IP address (IPv4 or IPv6) of the TCP relay.
* @param host The hostname or IP address (IPv4 or IPv6) of the TCP relay.
* @param port The port on the host on which the TCP relay is listening.
* @param public_key The long term public key of the TCP relay
* ($PUBLIC_KEY_SIZE bytes).
* @return true on success.
*/
bool add_tcp_relay(string address, uint16_t port, const uint8_t[PUBLIC_KEY_SIZE] public_key)
bool add_tcp_relay(string host, uint16_t port, const uint8_t[PUBLIC_KEY_SIZE] public_key)
with error for bootstrap;


Expand Down
12 changes: 6 additions & 6 deletions toxcore/tox.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ void tox_get_savedata(const Tox *tox, uint8_t *savedata)
}
}

bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error)
bool tox_bootstrap(Tox *tox, const char *host, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error)
{
if (!address || !public_key) {
if (!host || !public_key) {
SET_ERROR_PARAMETER(error, TOX_ERR_BOOTSTRAP_NULL);
return 0;
}
Expand All @@ -262,7 +262,7 @@ bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *

IP_Port *root;

int32_t count = net_getipport(address, &root, TOX_SOCK_DGRAM);
int32_t count = net_getipport(host, &root, TOX_SOCK_DGRAM);

if (count == -1) {
net_freeipport(root);
Expand Down Expand Up @@ -291,10 +291,10 @@ bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *
return 0;
}

bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key,
bool tox_add_tcp_relay(Tox *tox, const char *host, uint16_t port, const uint8_t *public_key,
TOX_ERR_BOOTSTRAP *error)
{
if (!address || !public_key) {
if (!host || !public_key) {
SET_ERROR_PARAMETER(error, TOX_ERR_BOOTSTRAP_NULL);
return 0;
}
Expand All @@ -306,7 +306,7 @@ bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8

IP_Port *root;

int32_t count = net_getipport(address, &root, TOX_SOCK_STREAM);
int32_t count = net_getipport(host, &root, TOX_SOCK_STREAM);

if (count == -1) {
net_freeipport(root);
Expand Down
11 changes: 5 additions & 6 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ typedef enum TOX_ERR_BOOTSTRAP {
TOX_ERR_BOOTSTRAP_NULL,

/**
* The address could not be resolved to an IP address, or the IP address
* The hostname could not be resolved to an IP address, or the IP address
* passed was invalid.
*/
TOX_ERR_BOOTSTRAP_BAD_HOST,
Expand All @@ -925,15 +925,15 @@ typedef enum TOX_ERR_BOOTSTRAP {
* This function will attempt to connect to the node using UDP. You must use
* this function even if Tox_Options.udp_enabled was set to false.
*
* @param address The hostname or IP address (IPv4 or IPv6) of the node. Must be
* @param host The hostname or IP address (IPv4 or IPv6) of the node. Must be
* at most TOX_MAX_HOSTNAME_LENGTH chars, including the NUL byte.
* @param port The port on the host on which the bootstrap Tox instance is
* listening.
* @param public_key The long term public key of the bootstrap node
* (TOX_PUBLIC_KEY_SIZE bytes).
* @return true on success.
*/
bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error);
bool tox_bootstrap(Tox *tox, const char *host, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error);

/**
* Adds additional host:port pair as TCP relay.
Expand All @@ -942,14 +942,13 @@ bool tox_bootstrap(Tox *tox, const char *address, uint16_t port, const uint8_t *
* the same bootstrap node, or to add TCP relays without using them as
* bootstrap nodes.
*
* @param address The hostname or IP address (IPv4 or IPv6) of the TCP relay.
* @param host The hostname or IP address (IPv4 or IPv6) of the TCP relay.
* @param port The port on the host on which the TCP relay is listening.
* @param public_key The long term public key of the TCP relay
* (TOX_PUBLIC_KEY_SIZE bytes).
* @return true on success.
*/
bool tox_add_tcp_relay(Tox *tox, const char *address, uint16_t port, const uint8_t *public_key,
TOX_ERR_BOOTSTRAP *error);
bool tox_add_tcp_relay(Tox *tox, const char *host, uint16_t port, const uint8_t *public_key, TOX_ERR_BOOTSTRAP *error);

/**
* Protocols that can be used to connect to the network or friends.
Expand Down

0 comments on commit 81cd78a

Please sign in to comment.