[riot-notifications] [RIOT-OS/RIOT] netutils: add netutil_parse_hostname() (#16634)

Martine Lenders notifications at github.com
Tue Jul 13 10:03:20 CEST 2021


@miri64 requested changes on this pull request.



> +#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief   Parse an IP address / hostname string.
+ *          If the @ref net_sock_dns module is used, this will
+ *          attempt to resolve hostnames via DNS.
+ *
+ * @param[in]   hostname    IP address string or hostname
+ * @param[out]  addr        IP address of the host
+ * @param[out]  netif       Interface if address is link-local
+ *
+ * @return  0 on success, error otherwise
+ */
+int netutil_parse_hostname(const char *hostname, ipv6_addr_t *addr, netif_t **netif);

Consistency ;-).

```suggestion
int netutils_parse_hostname(const char *hostname, ipv6_addr_t *addr, netif_t **netif);
```

> @@ -260,6 +260,7 @@ ifneq (,$(filter gnrc_icmpv6_echo,$(USEMODULE)))
   USEMODULE += gnrc_icmpv6
   USEMODULE += gnrc_ipv6_hdr
   USEMODULE += gnrc_netif_hdr
+  USEMODULE += netutils

Not really a dependency of `gnrc_icmpv6_echo`, but the shell command. One way to resolve that dependency would be how I resolved the dependency of the shell command to `xtimer` (only include the when `netutils` is available).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16634#pullrequestreview-704478519
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210713/899515cc/attachment.htm>


More information about the notifications mailing list