@@ -398,21 +398,22 @@ non_null()
398398void ipport_copy (IP_Port * target , const IP_Port * source );
399399
400400/**
401- * Resolves string into an IP address
401+ * @brief Resolves string into an IP address.
402402 *
403- * @param address a hostname (or something parseable to an IP address)
404- * @param to to.family MUST be initialized, either set to a specific IP version
403+ * @param[in] address a hostname (or something parseable to an IP address).
404+ * @param[in,out] to to.family MUST be initialized, either set to a specific IP version
405405 * (TOX_AF_INET/TOX_AF_INET6) or to the unspecified TOX_AF_UNSPEC (0), if both
406- * IP versions are acceptable
407- * @param extra can be NULL and is only set in special circumstances, see returns
406+ * IP versions are acceptable.
407+ * @param[out] extra can be NULL and is only set in special circumstances, see returns.
408+ * @param[in] dns_enabled if false, DNS resolution is skipped.
408409 *
409- * Returns in `*to` a matching address (IPv6 or IPv4)
410- * Returns in `*extra`, if not NULL, an IPv4 address, if `to->family` was TOX_AF_UNSPEC
410+ * Returns in `*to` a matching address (IPv6 or IPv4).
411+ * Returns in `*extra`, if not NULL, an IPv4 address, if `to->family` was ` TOX_AF_UNSPEC`.
411412 *
412413 * @return true on success, false on failure
413414 */
414415non_null (1 , 2 , 3 ) nullable (4 )
415- bool addr_resolve_or_parse_ip (const Network * ns , const char * address , IP * to , IP * extra );
416+ bool addr_resolve_or_parse_ip (const Network * ns , const char * address , IP * to , IP * extra , bool dns_enabled );
416417
417418/** @brief Function to receive data, ip and port of sender is put into ip_port.
418419 * Packet data is put into data.
@@ -512,14 +513,20 @@ bool net_connect(const Network *ns, const Memory *mem, const Logger *log, Socket
512513 * address that can be specified by calling `net_connect()`, the port is ignored.
513514 *
514515 * Skip all addresses with socktype != type (use type = -1 to get all addresses)
515- * To correctly deallocate array memory use `net_freeipport()`
516+ * To correctly deallocate array memory use `net_freeipport()`.
517+ *
518+ * @param mem Memory allocator.
519+ * @param node The node parameter identifies the host or service on which to connect.
520+ * @param[out] res An array of IP_Port structures will be allocated into this pointer.
521+ * @param tox_type The type of socket to use (stream or datagram), only relevant for DNS lookups.
522+ * @param dns_enabled If false, DNS resolution is skipped, when passed a hostname, this function will return an error.
516523 *
517524 * @return number of elements in res array.
518525 * @retval 0 if res array empty.
519526 * @retval -1 on error.
520527 */
521528non_null ()
522- int32_t net_getipport (const Memory * mem , const char * node , IP_Port * * res , int tox_type );
529+ int32_t net_getipport (const Memory * mem , const char * node , IP_Port * * res , int tox_type , bool dns_enabled );
523530
524531/** Deallocates memory allocated by net_getipport */
525532non_null (1 ) nullable (2 )
0 commit comments