summaryrefslogtreecommitdiffstats
path: root/libtar/inet_aton.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtar/inet_aton.c')
-rw-r--r--libtar/inet_aton.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libtar/inet_aton.c b/libtar/inet_aton.c
new file mode 100644
index 000000000..a935d5a6b
--- /dev/null
+++ b/libtar/inet_aton.c
@@ -0,0 +1,27 @@
+/*
+** Copyright 2002 University of Illinois Board of Trustees
+** Copyright 2002 Mark D. Roth
+** All rights reserved.
+**
+** inet_aton.c - inet_aton() function for compatibility library
+**
+** Mark D. Roth <roth@uiuc.edu>
+** Campus Information Technologies and Educational Services
+** University of Illinois at Urbana-Champaign
+*/
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+
+int
+inet_aton(const char *cp, struct in_addr *inp)
+{
+ inp->s_addr = inet_addr(cp);
+ if (inp->s_addr == -1)
+ return 0;
+ return 1;
+}
+
+