Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/net/gethostnamadr.c
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | host_id_func(char *buffer, size_t *buffer_size, va_list ap, void *cache_mdata) | ||||
enum nss_lookup_type lookup_type; | enum nss_lookup_type lookup_type; | ||||
char *p; | char *p; | ||||
int res = NS_UNAVAIL; | int res = NS_UNAVAIL; | ||||
statp = __res_state(); | statp = __res_state(); | ||||
res_options = statp->options & (RES_RECURSE | RES_DEFNAMES | | res_options = statp->options & (RES_RECURSE | RES_DEFNAMES | | ||||
RES_DNSRCH | RES_NOALIASES | RES_USE_INET6); | RES_DNSRCH | RES_NOALIASES | RES_USE_INET6); | ||||
lookup_type = (enum nss_lookup_type)cache_mdata; | lookup_type = (enum nss_lookup_type)(uintptr_t)cache_mdata; | ||||
switch (lookup_type) { | switch (lookup_type) { | ||||
case nss_lt_name: | case nss_lt_name: | ||||
str = va_arg(ap, char *); | str = va_arg(ap, char *); | ||||
type = va_arg(ap, int); | type = va_arg(ap, int); | ||||
size = strlen(str); | size = strlen(str); | ||||
desired_size = sizeof(res_options) + sizeof(int) + | desired_size = sizeof(res_options) + sizeof(int) + | ||||
sizeof(enum nss_lookup_type) + sizeof(int) + size + 1; | sizeof(enum nss_lookup_type) + sizeof(int) + size + 1; | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | host_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap, | ||||
socklen_t len; | socklen_t len; | ||||
int type; | int type; | ||||
struct hostent *ht; | struct hostent *ht; | ||||
struct hostent new_ht; | struct hostent new_ht; | ||||
size_t desired_size, aliases_size, addr_size, size; | size_t desired_size, aliases_size, addr_size, size; | ||||
char *p, **iter; | char *p, **iter; | ||||
switch ((enum nss_lookup_type)cache_mdata) { | switch ((enum nss_lookup_type)(uintptr_t)cache_mdata) { | ||||
case nss_lt_name: | case nss_lt_name: | ||||
str = va_arg(ap, char *); | str = va_arg(ap, char *); | ||||
type = va_arg(ap, int); | type = va_arg(ap, int); | ||||
break; | break; | ||||
case nss_lt_id: | case nss_lt_id: | ||||
addr = va_arg(ap, void *); | addr = va_arg(ap, void *); | ||||
len = va_arg(ap, socklen_t); | len = va_arg(ap, socklen_t); | ||||
type = va_arg(ap, int); | type = va_arg(ap, int); | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | host_unmarshal_func(char *buffer, size_t buffer_size, void *retval, va_list ap, | ||||
int type; | int type; | ||||
struct hostent *ht; | struct hostent *ht; | ||||
char *p; | char *p; | ||||
char **iter; | char **iter; | ||||
char *orig_buf; | char *orig_buf; | ||||
size_t orig_buf_size; | size_t orig_buf_size; | ||||
switch ((enum nss_lookup_type)cache_mdata) { | switch ((enum nss_lookup_type)(uintptr_t)cache_mdata) { | ||||
case nss_lt_name: | case nss_lt_name: | ||||
str = va_arg(ap, char *); | str = va_arg(ap, char *); | ||||
type = va_arg(ap, int); | type = va_arg(ap, int); | ||||
break; | break; | ||||
case nss_lt_id: | case nss_lt_id: | ||||
addr = va_arg(ap, void *); | addr = va_arg(ap, void *); | ||||
len = va_arg(ap, socklen_t); | len = va_arg(ap, socklen_t); | ||||
type = va_arg(ap, int); | type = va_arg(ap, int); | ||||
▲ Show 20 Lines • Show All 343 Lines • Show Last 20 Lines |