diff options
author | ewt <devnull@localhost> | 1996-09-29 02:30:43 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1996-09-29 02:30:43 +0000 |
commit | 5c38e242fc27dde2b500afa13ca76b9228e6ff03 (patch) | |
tree | 54840b8700739c8fe25ff1ab5dea82e53147a392 /misc | |
parent | 0a2e302f3a3c62f715a00f4bc860f1831439f4b1 (diff) | |
download | rpm-5c38e242fc27dde2b500afa13ca76b9228e6ff03.tar.gz rpm-5c38e242fc27dde2b500afa13ca76b9228e6ff03.tar.bz2 rpm-5c38e242fc27dde2b500afa13ca76b9228e6ff03.zip |
Initial revision
CVS patchset: 1078
CVS date: 1996/09/29 02:30:43
Diffstat (limited to 'misc')
-rw-r--r-- | misc/inet_aton.c | 21 | ||||
-rw-r--r-- | misc/inet_aton.h | 5 |
2 files changed, 26 insertions, 0 deletions
diff --git a/misc/inet_aton.c b/misc/inet_aton.c new file mode 100644 index 000000000..5dfc5f73f --- /dev/null +++ b/misc/inet_aton.c @@ -0,0 +1,21 @@ +#ifdef HAVE_NETINET_IN_SYSTM_H +# include <sys/types.h> +# include <netinet/in_systm.h> +#endif + +#include <netinet/in.h> +#include <netinet/ip.h> +#include <arpa/inet.h> +#include <string.h> + +#include "inet_aton.h" + +int inet_aton(const char *cp, struct in_addr *inp) { + long addr; + + addr = inet_addr(cp); + if (addr == ((long) -1)) return 0; + + memcpy(inp, &addr, sizeof(addr)); + return 1; +} diff --git a/misc/inet_aton.h b/misc/inet_aton.h new file mode 100644 index 000000000..fddbd1feb --- /dev/null +++ b/misc/inet_aton.h @@ -0,0 +1,5 @@ +#ifndef HAVE_INET_ATON + +int inet_aton(const char *cp, struct in_addr *inp); + +#endif |