]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
export get_hostent_from_name
authorAaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Wed, 7 Apr 2021 01:11:55 +0000 (13:11 +1200)
committerAaron Lipinski <aaron.lipinski@roboticsplus.co.nz>
Thu, 8 Apr 2021 20:36:25 +0000 (08:36 +1200)
ui/mtr.c
ui/mtr.h

index 95867808147362fc6d0150c87ce3fe78c9386856..a044d1ecbf44984b739654a551d2440c5b1f5c8c 100644 (file)
--- a/ui/mtr.c
+++ b/ui/mtr.c
@@ -38,7 +38,6 @@
 #include <sys/limits.h>
 #endif
 
-#include <netdb.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
 #include <ctype.h>
@@ -695,11 +694,12 @@ static void init_rand(
     would be to use gethostbyname().  We'll use getaddrinfo() instead
     to generate the hostent.
 */
-static int get_hostent_from_name(
+int get_hostent_from_name(
     struct mtr_ctl *ctl,
     struct addrinfo **res,
     const char *name)
 {
+    printf("get_hostent_from_name: %x %s\n", ctl->af, name);
     int gai_error;
     struct addrinfo hints;
 
index 92dd8a1ed86d8cabc5f5d743e6bd4dbeccf9092c..5de5d9fd0248eb776d2c94755335a89cbb3db45b 100644 (file)
--- a/ui/mtr.h
+++ b/ui/mtr.h
@@ -23,6 +23,7 @@
 #include "config.h"
 
 #include <stdint.h>
+#include <netdb.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 
@@ -148,4 +149,9 @@ struct mplslen {
 #define running_as_root() (getuid() == 0)
 #endif
 
+int get_hostent_from_name(
+    struct mtr_ctl *ctl,
+    struct addrinfo **res,
+    const char *name);
+
 #endif                          /* MTR_MTR_H */