blob: 4638aa9ebc51a54c701eea97add025fa6b2f5a99 [file] [log] [blame]
"Robert P. J. Day"63fc1a92006-07-02 19:47:05 +00001/* vi: set sw=4 ts=4: */
Eric Andersenc223ced2001-11-10 12:18:42 +00002/*
3 * stolen from net-tools-1.59 and stripped down for busybox by
Eric Andersencb81e642003-07-14 21:21:08 +00004 * Erik Andersen <andersen@codepoet.org>
Eric Andersenc223ced2001-11-10 12:18:42 +00005 *
6 * Heavily modified by Manuel Novoa III Mar 12, 2001
7 *
Eric Andersenc223ced2001-11-10 12:18:42 +00008 */
Denys Vlasenkobb1dcc92010-02-02 12:45:38 +01009#ifndef INET_COMMON_H
10#define INET_COMMON_H 1
Eric Andersenc223ced2001-11-10 12:18:42 +000011
Denys Vlasenkobb1dcc92010-02-02 12:45:38 +010012PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
Eric Andersenc223ced2001-11-10 12:18:42 +000013
Eric Andersenc223ced2001-11-10 12:18:42 +000014/* hostfirst!=0 If we expect this to be a hostname,
15 try hostname database first
16 */
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000017int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) FAST_FUNC;
Eric Andersenc223ced2001-11-10 12:18:42 +000018
Denis Vlasenko7ca39212006-11-21 20:34:21 +000019/* numeric: & 0x8000: "default" instead of "*",
Eric Andersenc223ced2001-11-10 12:18:42 +000020 * & 0x4000: host instead of net,
21 * & 0x0fff: don't resolve
22 */
Denis Vlasenko1b16bda2007-06-19 11:10:02 +000023
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000024int INET6_resolve(const char *name, struct sockaddr_in6 *sin6) FAST_FUNC;
Denis Vlasenko6d9ea242007-06-19 11:12:46 +000025
26/* These return malloced string */
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +000027char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) FAST_FUNC;
28char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) FAST_FUNC;
Denys Vlasenkobb1dcc92010-02-02 12:45:38 +010029
30POP_SAVED_FUNCTION_VISIBILITY
31
32#endif