diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-06-25 15:18:14 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-06-25 19:56:11 +0000 |
commit | 56d249e5ad798f65a6cf97ecc9ae22b4c86ddf5b (patch) | |
tree | 737483763195e9993fbb739b2118a591f5e439a5 /toxcore/tox.api.h | |
parent | d22332dd505b5a269d379863a091d74522fce27b (diff) |
Add a MAX_HOSTNAME_LENGTH constant.
Fixes #946.
Diffstat (limited to 'toxcore/tox.api.h')
-rw-r--r-- | toxcore/tox.api.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/toxcore/tox.api.h b/toxcore/tox.api.h index 241441b8..4e20429e 100644 --- a/toxcore/tox.api.h +++ b/toxcore/tox.api.h | |||
@@ -307,6 +307,16 @@ const FILE_ID_LENGTH = 32; | |||
307 | */ | 307 | */ |
308 | const MAX_FILENAME_LENGTH = 255; | 308 | const MAX_FILENAME_LENGTH = 255; |
309 | 309 | ||
310 | /** | ||
311 | * Maximum length of a hostname, e.g. proxy or bootstrap node names. | ||
312 | * | ||
313 | * This length includes the NUL byte. Hostnames are NUL-terminated C strings, so | ||
314 | * they are 255 characters plus one NUL byte. | ||
315 | * | ||
316 | * @deprecated The macro will be removed in 0.3.0. Use the function instead. | ||
317 | */ | ||
318 | const MAX_HOSTNAME_LENGTH = 256; | ||
319 | |||
310 | 320 | ||
311 | /******************************************************************************* | 321 | /******************************************************************************* |
312 | * | 322 | * |
@@ -496,8 +506,8 @@ static class options { | |||
496 | * The IP address or DNS name of the proxy to be used. | 506 | * The IP address or DNS name of the proxy to be used. |
497 | * | 507 | * |
498 | * If used, this must be non-NULL and be a valid DNS name. The name must not | 508 | * If used, this must be non-NULL and be a valid DNS name. The name must not |
499 | * exceed 255 characters, and be in a NUL-terminated C string format | 509 | * exceed $MAX_HOSTNAME_LENGTH characters, and be in a NUL-terminated C string |
500 | * (255 chars + 1 NUL byte). | 510 | * format ($MAX_HOSTNAME_LENGTH includes the NUL byte). |
501 | * | 511 | * |
502 | * This member is ignored (it can be NULL) if proxy_type is ${PROXY_TYPE.NONE}. | 512 | * This member is ignored (it can be NULL) if proxy_type is ${PROXY_TYPE.NONE}. |
503 | * | 513 | * |
@@ -746,7 +756,8 @@ uint8_t[size] savedata { | |||
746 | * This function will attempt to connect to the node using UDP. You must use | 756 | * This function will attempt to connect to the node using UDP. You must use |
747 | * this function even if ${options.this.udp_enabled} was set to false. | 757 | * this function even if ${options.this.udp_enabled} was set to false. |
748 | * | 758 | * |
749 | * @param address The hostname or IP address (IPv4 or IPv6) of the node. | 759 | * @param address The hostname or IP address (IPv4 or IPv6) of the node. Must be |
760 | * at most $MAX_HOSTNAME_LENGTH chars, including the NUL byte. | ||
750 | * @param port The port on the host on which the bootstrap Tox instance is | 761 | * @param port The port on the host on which the bootstrap Tox instance is |
751 | * listening. | 762 | * listening. |
752 | * @param public_key The long term public key of the bootstrap node | 763 | * @param public_key The long term public key of the bootstrap node |