bigbiff bigbiff | 9c75405 | 2013-01-09 09:09:08 -0500 | [diff] [blame] | 1 | /* |
| 2 | ** Copyright 2002 University of Illinois Board of Trustees |
| 3 | ** Copyright 2002 Mark D. Roth |
| 4 | ** All rights reserved. |
| 5 | ** |
| 6 | ** inet_aton.c - inet_aton() function for compatibility library |
| 7 | ** |
| 8 | ** Mark D. Roth <roth@uiuc.edu> |
| 9 | ** Campus Information Technologies and Educational Services |
| 10 | ** University of Illinois at Urbana-Champaign |
| 11 | */ |
| 12 | |
| 13 | #include <sys/socket.h> |
| 14 | #include <netinet/in.h> |
| 15 | #include <arpa/inet.h> |
| 16 | |
| 17 | |
| 18 | int |
| 19 | inet_aton(const char *cp, struct in_addr *inp) |
| 20 | { |
| 21 | inp->s_addr = inet_addr(cp); |
| 22 | if (inp->s_addr == -1) |
| 23 | return 0; |
| 24 | return 1; |
| 25 | } |
| 26 | |
| 27 | |