Test for inet_aton function.
authordrepper <drepper>
Wed, 29 Apr 1998 16:49:12 +0000 (16:49 +0000)
committerdrepper <drepper>
Wed, 29 Apr 1998 16:49:12 +0000 (16:49 +0000)
resolv/tst-aton.c [new file with mode: 0644]

diff --git a/resolv/tst-aton.c b/resolv/tst-aton.c
new file mode 100644 (file)
index 0000000..818f9ed
--- /dev/null
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+enum { buf_size = 16 };
+static char buf[buf_size] = "323543357756889";
+
+int
+main (int argc, char *argv[])
+{
+  struct in_addr addr;
+  int result = 0;
+
+  if (inet_aton (buf, &addr) != 0)
+    {
+      printf ("%s is seen as a valid IP address\n", buf);
+      result = 1;
+    }
+
+  return result;
+}