"Robert P. J. Day" | 63fc1a9 | 2006-07-02 19:47:05 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 2 | /* |
| 3 | * stolen from net-tools-1.59 and stripped down for busybox by |
Eric Andersen | cb81e64 | 2003-07-14 21:21:08 +0000 | [diff] [blame] | 4 | * Erik Andersen <andersen@codepoet.org> |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 5 | * |
| 6 | * Heavily modified by Manuel Novoa III Mar 12, 2001 |
| 7 | * |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 8 | */ |
Denys Vlasenko | bb1dcc9 | 2010-02-02 12:45:38 +0100 | [diff] [blame] | 9 | #ifndef INET_COMMON_H |
| 10 | #define INET_COMMON_H 1 |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 11 | |
Denys Vlasenko | bb1dcc9 | 2010-02-02 12:45:38 +0100 | [diff] [blame] | 12 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 13 | |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 14 | /* hostfirst!=0 If we expect this to be a hostname, |
| 15 | try hostname database first |
| 16 | */ |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 17 | int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) FAST_FUNC; |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 18 | |
Denis Vlasenko | 7ca3921 | 2006-11-21 20:34:21 +0000 | [diff] [blame] | 19 | /* numeric: & 0x8000: "default" instead of "*", |
Eric Andersen | c223ced | 2001-11-10 12:18:42 +0000 | [diff] [blame] | 20 | * & 0x4000: host instead of net, |
| 21 | * & 0x0fff: don't resolve |
| 22 | */ |
Denis Vlasenko | 1b16bda | 2007-06-19 11:10:02 +0000 | [diff] [blame] | 23 | |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 24 | int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) FAST_FUNC; |
Denis Vlasenko | 6d9ea24 | 2007-06-19 11:12:46 +0000 | [diff] [blame] | 25 | |
| 26 | /* These return malloced string */ |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 27 | char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) FAST_FUNC; |
| 28 | char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) FAST_FUNC; |
Denys Vlasenko | bb1dcc9 | 2010-02-02 12:45:38 +0100 | [diff] [blame] | 29 | |
| 30 | POP_SAVED_FUNCTION_VISIBILITY |
| 31 | |
| 32 | #endif |