Go to the documentation of this file.
21 #ifdef HAVE_GETSERVBYNAME_R
22 # if !defined(GETSERVBYNAME_R_ARGS) || \
23 (GETSERVBYNAME_R_ARGS < 4) || (GETSERVBYNAME_R_ARGS > 6)
24 # error "you MUST specifiy a valid number of arguments for getservbyname_r"
28 #ifdef HAVE_NETINET_IN_H
29 # include <netinet/in.h>
34 #ifdef HAVE_ARPA_INET_H
35 # include <arpa/inet.h>
109 unsigned char *abuf,
int alen);
226 #ifdef HAVE_GETSERVBYNAME_R
241 #ifdef HAVE_GETSERVBYNAME_R
242 memset(&se, 0,
sizeof(se));
244 memset(tmpbuf, 0,
sizeof(tmpbuf));
245 #if GETSERVBYNAME_R_ARGS == 6
246 if (getservbyname_r(
service, proto, &se, (
void *)tmpbuf,
sizeof(tmpbuf),
249 #elif GETSERVBYNAME_R_ARGS == 5
251 getservbyname_r(
service, proto, &se, (
void *)tmpbuf,
sizeof(tmpbuf));
252 #elif GETSERVBYNAME_R_ARGS == 4
253 if (getservbyname_r(
service, proto, &se, (
void *)tmpbuf) != 0)
261 #if (defined(NETWARE) && !defined(__NOVELL_LIBC__))
267 return (
sep ? ntohs((
unsigned short)
sep->s_port) : 0);
289 if (family == AF_INET || family ==
AF_INET6 || family == AF_UNSPEC)
292 int numdots = 0,
valid = 1;
312 if (numdots != 3 || !
valid)
320 family =
addr.sa.sa_family = AF_INET;
322 addrlen =
sizeof(
addr.sa4);
326 if (family ==
AF_INET6 || family == AF_UNSPEC)
332 addrlen =
sizeof(
addr.sa6);
358 if (
addr.sa.sa_family == AF_INET)
408 if (
next->ai_family == AF_INET)
436 const char *path_hosts = NULL;
440 path_hosts =
getenv(
"CARES_HOSTS");
458 if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ,
459 &hkeyHosts) == ERROR_SUCCESS)
461 DWORD dwLength = MAX_PATH;
462 RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)
tmp,
465 RegCloseKey(hkeyHosts);
476 #elif defined(WATT32)
485 fp = fopen(path_hosts,
"r");
497 DEBUGF(fprintf(
stderr,
"Error opening file: %s\n", path_hosts));
536 unsigned char *abuf,
int alen)
586 unsigned short port = 0;
599 if (family != AF_INET &&
671 hquery->
hints = *hints;
688 int is_s_allocated = 0;
758 size_t nname = strlen(hquery->
name);
759 for (
p = hquery->
name; *
p;
p++)
766 if (nname && hquery->
name[nname-1] ==
'.')
struct ares_addrinfo_node * ares__malloc_addrinfo_node()
static unsigned short lookup_service(const char *service, int flags)
CARES_EXTERN int ares_inet_pton(int af, const char *src, void *dst)
ares_socklen_t ai_addrlen
struct ares_addrinfo_hints hints
return memset(p, 0, total)
CARES_EXTERN void ares_query(ares_channel channel, const char *name, int dnsclass, int type, ares_callback callback, void *arg)
struct ares_addrinfo_cname * ares__malloc_addrinfo_cname()
void ares__addrinfo_cat_cnames(struct ares_addrinfo_cname **head, struct ares_addrinfo_cname *tail)
char * ares_strdup(const char *s1)
static int next_dns_lookup(struct host_query *hquery)
static void end_hquery(struct host_query *hquery, int status)
void(* ares_addrinfo_callback)(void *arg, int status, int timeouts, struct ares_addrinfo *res)
struct sockaddr * ai_addr
struct ares_addrinfo_node * ares__append_addrinfo_node(struct ares_addrinfo_node **head)
struct ares_addrinfo * ai
int ares__is_onion_domain(const char *name)
static const struct ares_addrinfo empty_addrinfo
#define ARES_AI_CANONNAME
struct ares_addrinfo_cname * ares__append_addrinfo_cname(struct ares_addrinfo_cname **head)
static const struct ares_addrinfo_node empty_addrinfo_node
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
const char * remaining_lookups
#define ARES_AI_NUMERICSERV
wrapped_grpc_channel * channel
void *(* ares_malloc)(size_t size)=default_malloc
#define CARES_INADDR_CAST(type, var)
static const struct ares_addrinfo_cname empty_addrinfo_cname
static void host_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
static void callback(void *arg, int status, int timeouts, struct hostent *host)
int ares__parse_into_addrinfo(const unsigned char *abuf, int alen, struct ares_addrinfo *ai)
void ares_getaddrinfo(ares_channel channel, const char *name, const char *service, const struct ares_addrinfo_hints *hints, ares_addrinfo_callback callback, void *arg)
struct ares_addrinfo * ares__malloc_addrinfo()
#define ARES_ECONNREFUSED
void ares__addrinfo_cat_nodes(struct ares_addrinfo_node **head, struct ares_addrinfo_node *tail)
struct ares_addrinfo_cname * next
static int fake_addrinfo(const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai, ares_addrinfo_callback callback, void *arg)
struct ares_addrinfo_node * nodes
struct ares_addrinfo_cname * cnames
static int as_is_first(const struct host_query *hquery)
CARES_EXTERN void ares_freeaddrinfo(struct ares_addrinfo *ai)
AllocList * next[kMaxLevel]
struct ares_addrinfo_node * ai_next
void(* ares_free)(void *ptr)=default_free
__attribute__((deprecated("Please use GRPCProtoMethod."))) @interface ProtoMethod NSString * service
ares_addrinfo_callback callback
int ares__cat_domain(const char *name, const char *domain, char **s)
int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *list_sentinel)
#define ARES_EDESTRUCTION
static int file_lookup(struct host_query *hquery)
static void next_lookup(struct host_query *hquery, int status)
int ares__readaddrinfo(FILE *fp, const char *name, unsigned short port, const struct ares_addrinfo_hints *hints, struct ares_addrinfo *ai)
static const struct ares_addrinfo_hints default_hints
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:43