summaryrefslogtreecommitdiff
path: root/libc/inet
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-12-01 20:43:44 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-12-01 20:43:44 +0000
commit8a0b43005ad9ea011b80d66e32b46fb430ddaffb (patch)
tree418818740042c5dbba244bc1efc760c8d29e47a9 /libc/inet
parent42b161bb716f35948fabd36472fb59cd0a20fa92 (diff)
Hide mostly used functions
Diffstat (limited to 'libc/inet')
-rw-r--r--libc/inet/addr.c3
-rw-r--r--libc/inet/getaddrinfo.c50
-rw-r--r--libc/inet/getnetbynm.c4
-rw-r--r--libc/inet/getproto.c4
-rw-r--r--libc/inet/getservice.c8
-rw-r--r--libc/inet/hostid.c14
-rw-r--r--libc/inet/if_nametoindex.c24
-rw-r--r--libc/inet/ntop.c20
-rw-r--r--libc/inet/resolv.c101
-rw-r--r--libc/inet/rpc/auth_unix.c2
-rw-r--r--libc/inet/rpc/bindresvport.c2
-rw-r--r--libc/inet/rpc/clnt_generic.c10
-rw-r--r--libc/inet/rpc/clnt_perror.c32
-rw-r--r--libc/inet/rpc/clnt_simple.c8
-rw-r--r--libc/inet/rpc/clnt_tcp.c10
-rw-r--r--libc/inet/rpc/clnt_udp.c6
-rw-r--r--libc/inet/rpc/clnt_unix.c10
-rw-r--r--libc/inet/rpc/get_myaddress.c4
-rw-r--r--libc/inet/rpc/getrpcent.c38
-rw-r--r--libc/inet/rpc/getrpcport.c2
-rw-r--r--libc/inet/rpc/pmap_clnt.c8
-rw-r--r--libc/inet/rpc/pmap_getmaps.c2
-rw-r--r--libc/inet/rpc/pmap_getport.c2
-rw-r--r--libc/inet/rpc/pmap_rmt.c5
-rw-r--r--libc/inet/rpc/rcmd.c62
-rw-r--r--libc/inet/rpc/rexec.c34
-rw-r--r--libc/inet/rpc/rpc_callmsg.c8
-rw-r--r--libc/inet/rpc/rtime.c4
-rw-r--r--libc/inet/rpc/ruserpass.c32
-rw-r--r--libc/inet/rpc/svc_auth_unix.c2
-rw-r--r--libc/inet/rpc/svc_simple.c8
-rw-r--r--libc/inet/rpc/svc_tcp.c12
-rw-r--r--libc/inet/rpc/svc_udp.c14
-rw-r--r--libc/inet/rpc/svc_unix.c16
-rw-r--r--libc/inet/rpc/xdr.c2
-rw-r--r--libc/inet/rpc/xdr_array.c2
-rw-r--r--libc/inet/rpc/xdr_mem.c4
-rw-r--r--libc/inet/rpc/xdr_rec.c4
-rw-r--r--libc/inet/rpc/xdr_reference.c2
39 files changed, 289 insertions, 286 deletions
diff --git a/libc/inet/addr.c b/libc/inet/addr.c
index 35b590073..a03b7575b 100644
--- a/libc/inet/addr.c
+++ b/libc/inet/addr.c
@@ -146,7 +146,7 @@ char *inet_ntoa(struct in_addr in)
* Formulate an Internet address from network + host. Used in
* building addresses stored in the ifnet structure.
*/
-struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host)
+struct in_addr attribute_hidden __inet_makeaddr(in_addr_t net, in_addr_t host)
{
in_addr_t addr;
@@ -161,6 +161,7 @@ struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host)
addr = htonl(addr);
return (*(struct in_addr *)&addr);
}
+strong_alias(__inet_makeaddr,inet_makeaddr)
#endif
diff --git a/libc/inet/getaddrinfo.c b/libc/inet/getaddrinfo.c
index 228e04f97..d2d0e151e 100644
--- a/libc/inet/getaddrinfo.c
+++ b/libc/inet/getaddrinfo.c
@@ -44,7 +44,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* This software is Copyright 1996 by Craig Metz, All Rights Reserved. */
+/* strdupa is using these */
+#if 0
#define memcpy __memcpy
+#define strlen __strlen
+#endif
#define _GNU_SOURCE
#define __FORCE_GLIBC
@@ -151,7 +155,7 @@ static int addrconfig (sa_family_t af)
ret = (errno == EMFILE) ? 1 : 0;
else
{
- close(s);
+ __close(s);
ret = 1;
}
__set_errno (saved_errno);
@@ -175,10 +179,10 @@ gaih_local (const char *name, const struct gaih_service *service,
if (name != NULL)
{
- if (strcmp(name, "localhost") &&
- strcmp(name, "local") &&
- strcmp(name, "unix") &&
- strcmp(name, utsname.nodename))
+ if (__strcmp(name, "localhost") &&
+ __strcmp(name, "local") &&
+ __strcmp(name, "unix") &&
+ __strcmp(name, utsname.nodename))
return GAIH_OKIFUNSPEC | -EAI_NONAME;
}
@@ -205,7 +209,7 @@ gaih_local (const char *name, const struct gaih_service *service,
*pai = malloc (sizeof (struct addrinfo) + sizeof (struct sockaddr_un)
+ ((req->ai_flags & AI_CANONNAME)
- ? (strlen(utsname.nodename) + 1): 0));
+ ? (__strlen(utsname.nodename) + 1): 0));
if (*pai == NULL)
return -EAI_MEMORY;
@@ -223,22 +227,22 @@ gaih_local (const char *name, const struct gaih_service *service,
#endif /* SALEN */
((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL;
- memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX);
+ __memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX);
if (service)
{
struct sockaddr_un *sunp = (struct sockaddr_un *) (*pai)->ai_addr;
- if (strchr (service->name, '/') != NULL)
+ if (__strchr (service->name, '/') != NULL)
{
- if (strlen (service->name) >= sizeof (sunp->sun_path))
+ if (__strlen (service->name) >= sizeof (sunp->sun_path))
return GAIH_OKIFUNSPEC | -EAI_SERVICE;
- strcpy (sunp->sun_path, service->name);
+ __strcpy (sunp->sun_path, service->name);
}
else
{
- if (strlen (P_tmpdir "/") + 1 + strlen (service->name) >=
+ if (__strlen (P_tmpdir "/") + 1 + __strlen (service->name) >=
sizeof (sunp->sun_path))
return GAIH_OKIFUNSPEC | -EAI_SERVICE;
@@ -260,7 +264,7 @@ gaih_local (const char *name, const struct gaih_service *service,
}
if (req->ai_flags & AI_CANONNAME)
- (*pai)->ai_canonname = strcpy ((char *) *pai + sizeof (struct addrinfo)
+ (*pai)->ai_canonname = __strcpy ((char *) *pai + sizeof (struct addrinfo)
+ sizeof (struct sockaddr_un),
utsname.nodename);
else
@@ -340,7 +344,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
} \
(*pat)->next = NULL; \
(*pat)->family = _family; \
- memcpy ((*pat)->addr, h->h_addr_list[i], \
+ __memcpy ((*pat)->addr, h->h_addr_list[i], \
sizeof(_type)); \
pat = &((*pat)->next); \
} \
@@ -491,7 +495,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
char *namebuf = strdupa (name);
char *scope_delim;
- scope_delim = strchr (namebuf, SCOPE_DELIMITER);
+ scope_delim = __strchr (namebuf, SCOPE_DELIMITER);
if (scope_delim != NULL)
*scope_delim = '\0';
@@ -574,12 +578,12 @@ gaih_inet (const char *name, const struct gaih_service *service,
{
struct gaih_addrtuple *atr;
atr = at = alloca (sizeof (struct gaih_addrtuple));
- memset (at, '\0', sizeof (struct gaih_addrtuple));
+ __memset (at, '\0', sizeof (struct gaih_addrtuple));
if (req->ai_family == 0)
{
at->next = alloca (sizeof (struct gaih_addrtuple));
- memset (at->next, '\0', sizeof (struct gaih_addrtuple));
+ __memset (at->next, '\0', sizeof (struct gaih_addrtuple));
}
#if __UCLIBC_HAS_IPV6__
@@ -588,7 +592,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
extern const struct in6_addr __in6addr_loopback;
at->family = AF_INET6;
if ((req->ai_flags & AI_PASSIVE) == 0)
- memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr));
+ __memcpy (at->addr, &__in6addr_loopback, sizeof (struct in6_addr));
atr = at->next;
}
#endif
@@ -660,7 +664,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (c == NULL)
return GAIH_OKIFUNSPEC | -EAI_NONAME;
- namelen = strlen (c) + 1;
+ namelen = __strlen (c) + 1;
}
else
namelen = 0;
@@ -704,7 +708,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
sin6p->sin6_flowinfo = 0;
if (at2->family == AF_INET6)
{
- memcpy (&sin6p->sin6_addr,
+ __memcpy (&sin6p->sin6_addr,
at2->addr, sizeof (struct in6_addr));
}
else
@@ -712,7 +716,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
sin6p->sin6_addr.s6_addr32[0] = 0;
sin6p->sin6_addr.s6_addr32[1] = 0;
sin6p->sin6_addr.s6_addr32[2] = htonl(0x0000ffff);
- memcpy(&sin6p->sin6_addr.s6_addr32[3],
+ __memcpy(&sin6p->sin6_addr.s6_addr32[3],
at2->addr, sizeof (sin6p->sin6_addr.s6_addr32[3]));
}
sin6p->sin6_port = st2->port;
@@ -724,17 +728,17 @@ gaih_inet (const char *name, const struct gaih_service *service,
struct sockaddr_in *sinp =
(struct sockaddr_in *) (*pai)->ai_addr;
- memcpy (&sinp->sin_addr,
+ __memcpy (&sinp->sin_addr,
at2->addr, sizeof (struct in_addr));
sinp->sin_port = st2->port;
- memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero));
+ __memset (sinp->sin_zero, '\0', sizeof (sinp->sin_zero));
}
if (c)
{
(*pai)->ai_canonname = ((void *) (*pai) +
sizeof (struct addrinfo) + socklen);
- strcpy ((*pai)->ai_canonname, c);
+ __strcpy ((*pai)->ai_canonname, c);
}
else
(*pai)->ai_canonname = NULL;
diff --git a/libc/inet/getnetbynm.c b/libc/inet/getnetbynm.c
index 456c337c1..5479c654b 100644
--- a/libc/inet/getnetbynm.c
+++ b/libc/inet/getnetbynm.c
@@ -30,10 +30,10 @@ getnetbyname(const char *name)
setnetent(_net_stayopen);
while ((p = getnetent())) {
- if (strcmp(p->n_name, name) == 0)
+ if (__strcmp(p->n_name, name) == 0)
break;
for (cp = p->n_aliases; *cp != 0; cp++)
- if (strcmp(*cp, name) == 0)
+ if (__strcmp(*cp, name) == 0)
goto found;
}
found:
diff --git a/libc/inet/getproto.c b/libc/inet/getproto.c
index 85b9fc26f..e7221f3a2 100644
--- a/libc/inet/getproto.c
+++ b/libc/inet/getproto.c
@@ -213,10 +213,10 @@ int getprotobyname_r(const char *name,
LOCK;
setprotoent(proto_stayopen);
while (!(ret=getprotoent_r(result_buf, buf, buflen, result))) {
- if (strcmp(result_buf->p_name, name) == 0)
+ if (__strcmp(result_buf->p_name, name) == 0)
break;
for (cp = result_buf->p_aliases; *cp != 0; cp++)
- if (strcmp(*cp, name) == 0)
+ if (__strcmp(*cp, name) == 0)
goto found;
}
found:
diff --git a/libc/inet/getservice.c b/libc/inet/getservice.c
index a8279e4db..d5402ba3e 100644
--- a/libc/inet/getservice.c
+++ b/libc/inet/getservice.c
@@ -239,14 +239,14 @@ int getservbyname_r(const char *name, const char *proto,
LOCK;
setservent(serv_stayopen);
while (!(ret=getservent_r(result_buf, buf, buflen, result))) {
- if (strcmp(name, result_buf->s_name) == 0)
+ if (__strcmp(name, result_buf->s_name) == 0)
goto gotname;
for (cp = result_buf->s_aliases; *cp; cp++)
- if (strcmp(name, *cp) == 0)
+ if (__strcmp(name, *cp) == 0)
goto gotname;
continue;
gotname:
- if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0)
+ if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0)
break;
}
if (!serv_stayopen)
@@ -266,7 +266,7 @@ int getservbyport_r(int port, const char *proto,
while (!(ret=getservent_r(result_buf, buf, buflen, result))) {
if (result_buf->s_port != port)
continue;
- if (proto == 0 || strcmp(result_buf->s_proto, proto) == 0)
+ if (proto == 0 || __strcmp(result_buf->s_proto, proto) == 0)
break;
}
if (!serv_stayopen)
diff --git a/libc/inet/hostid.c b/libc/inet/hostid.c
index e90cf256c..be3bacb96 100644
--- a/libc/inet/hostid.c
+++ b/libc/inet/hostid.c
@@ -18,10 +18,10 @@ int sethostid(long int new_id)
int ret;
if (geteuid() || getuid()) return __set_errno(EPERM);
- if ((fd=open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1;
- ret = write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id)
+ if ((fd=__open(HOSTID,O_CREAT|O_WRONLY,0644))<0) return -1;
+ ret = __write(fd,(void *)&new_id,sizeof(new_id)) == sizeof(new_id)
? 0 : -1;
- close (fd);
+ __close (fd);
return ret;
}
@@ -34,12 +34,12 @@ long int gethostid(void)
* It is not an error if we cannot read this file. It is not even an
* error if we cannot read all the bytes, we just carry on trying...
*/
- if ((fd=open(HOSTID,O_RDONLY))>=0 && read(fd,(void *)&id,sizeof(id)))
+ if ((fd=__open(HOSTID,O_RDONLY))>=0 && __read(fd,(void *)&id,sizeof(id)))
{
- close (fd);
+ __close (fd);
return id;
}
- if (fd >= 0) close (fd);
+ if (fd >= 0) __close (fd);
/* Try some methods of returning a unique 32 bit id. Clearly IP
* numbers, if on the internet, will have a unique address. If they
@@ -65,7 +65,7 @@ long int gethostid(void)
*/
return 0;
else {
- memcpy((char *) &in, (char *) hp->h_addr, hp->h_length);
+ __memcpy((char *) &in, (char *) hp->h_addr, hp->h_length);
/* Just so it doesn't look exactly like the IP addr */
return(in.s_addr<<16|in.s_addr>>16);
diff --git a/libc/inet/if_nametoindex.c b/libc/inet/if_nametoindex.c
index 45b319f97..0e556dba8 100644
--- a/libc/inet/if_nametoindex.c
+++ b/libc/inet/if_nametoindex.c
@@ -51,15 +51,15 @@ unsigned int if_nametoindex(const char* ifname)
fd = __opensock();
if (fd < 0)
return 0;
- strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
+ __strncpy (ifr.ifr_name, ifname, sizeof (ifr.ifr_name));
if (ioctl(fd,SIOCGIFINDEX,&ifr) < 0) {
int saved_errno = errno;
- close(fd);
+ __close(fd);
if (saved_errno == EINVAL)
__set_errno(ENOSYS);
return 0;
}
- close(fd);
+ __close(fd);
return ifr.ifr_ifindex;
#endif /* SIOCGIFINDEX */
@@ -103,7 +103,7 @@ struct if_nameindex * if_nameindex (void)
do {
ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len = rq_len);
if (ifc.ifc_buf == NULL || ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
- close(fd);
+ __close(fd);
return NULL;
}
rq_len *= 2;
@@ -113,21 +113,21 @@ struct if_nameindex * if_nameindex (void)
idx = malloc ((nifs + 1) * sizeof(struct if_nameindex));
if (idx == NULL) {
- close(fd);
+ __close(fd);
__set_errno(ENOBUFS);
return NULL;
}
for (i = 0; i < nifs; ++i) {
struct ifreq *ifr = &ifc.ifc_req[i];
- idx[i].if_name = strdup (ifr->ifr_name);
+ idx[i].if_name = __strdup (ifr->ifr_name);
if (idx[i].if_name == NULL || ioctl(fd,SIOCGIFINDEX,ifr) < 0) {
int saved_errno = errno;
unsigned int j;
for (j = 0; j < i; ++j)
free (idx[j].if_name);
free(idx);
- close(fd);
+ __close(fd);
if (saved_errno == EINVAL)
saved_errno = ENOSYS;
else if (saved_errno == ENOMEM)
@@ -141,7 +141,7 @@ struct if_nameindex * if_nameindex (void)
idx[i].if_index = 0;
idx[i].if_name = NULL;
- close(fd);
+ __close(fd);
return idx;
#endif
}
@@ -161,13 +161,13 @@ char * if_indextoname (unsigned int ifindex, char *ifname)
ifr.ifr_ifindex = ifindex;
if (ioctl (fd, SIOCGIFNAME, &ifr) < 0) {
saved_errno = errno;
- close (fd);
+ __close (fd);
__set_errno (saved_errno);
return NULL;
}
- close (fd);
+ __close (fd);
- return strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
+ return __strncpy (ifname, ifr.ifr_name, IFNAMSIZ);
#else
struct if_nameindex *idx;
struct if_nameindex *p;
@@ -177,7 +177,7 @@ char * if_indextoname (unsigned int ifindex, char *ifname)
if (idx != NULL) {
for (p = idx; p->if_index || p->if_name; ++p) {
if (p->if_index == ifindex) {
- result = strncpy (ifname, p->if_name, IFNAMSIZ);
+ result = __strncpy (ifname, p->if_name, IFNAMSIZ);
break;
}
}
diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c
index 3a9f5f477..65ff1842b 100644
--- a/libc/inet/ntop.c
+++ b/libc/inet/ntop.c
@@ -15,8 +15,6 @@
* SOFTWARE.
*/
-#define memmove __memmove
-
#define __FORCE_GLIBC
#include <features.h>
#include <sys/param.h>
@@ -78,12 +76,12 @@ inet_ntop4(const u_char *src, char *dst, size_t size)
}
tmp[i - 1] = '\0';
- if (strlen (tmp) > size) {
+ if (__strlen (tmp) > size) {
__set_errno (ENOSPC);
return (NULL);
}
- return strcpy(dst, tmp);
+ return __strcpy(dst, tmp);
}
@@ -116,7 +114,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
- memset(words, '\0', sizeof words);
+ __memset(words, '\0', sizeof words);
for (i = 0; i < 16; i += 2)
words[i / 2] = (src[i] << 8) | src[i + 1];
best.base = -1;
@@ -162,7 +160,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
(best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
return (NULL);
- tp += strlen(tp);
+ tp += __strlen(tp);
break;
}
tp += sprintf(tp, "%x", words[i]);
@@ -179,7 +177,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
__set_errno (ENOSPC);
return (NULL);
}
- return strcpy(dst, tmp);
+ return __strcpy(dst, tmp);
}
#endif /* __UCLIBC_HAS_IPV6__ */
@@ -226,7 +224,7 @@ inet_pton4(const char *src, u_char *dst)
}
if (octets < 4)
return (0);
- memcpy(dst, tmp, 4);
+ __memcpy(dst, tmp, 4);
return (1);
}
@@ -263,7 +261,7 @@ inet_pton6(const char *src, u_char *dst)
u_int val;
- tp = memset(tmp, '\0', 16);
+ tp = __memset(tmp, '\0', 16);
endp = tp + 16;
colonp = NULL;
/* Leading :: requires some special handling. */
@@ -276,7 +274,7 @@ inet_pton6(const char *src, u_char *dst)
while ((ch = tolower (*src++)) != '\0') {
const char *pch;
- pch = strchr(xdigits, ch);
+ pch = __strchr(xdigits, ch);
if (pch != NULL) {
val <<= 4;
val |= (pch - xdigits);
@@ -335,7 +333,7 @@ inet_pton6(const char *src, u_char *dst)
}
if (tp != endp)
return (0);
- memcpy(dst, tmp, 16);
+ __memcpy(dst, tmp, 16);
return (1);
}
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 0fee6a597..3313bfc85 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -133,7 +133,6 @@
*
*/
-#define memmove __memmove
#define strnlen __strnlen
#define strncat __strncat
#define strstr __strstr
@@ -342,14 +341,14 @@ int attribute_hidden __encode_dotted(const char *dotted, unsigned char *dest, in
int used = 0;
while (dotted && *dotted) {
- char *c = strchr(dotted, '.');
- int l = c ? c - dotted : strlen(dotted);
+ char *c = __strchr(dotted, '.');
+ int l = c ? c - dotted : __strlen(dotted);
if (l >= (maxlen - used - 1))
return -1;
dest[used++] = l;
- memcpy(dest + used, dotted, l);
+ __memcpy(dest + used, dotted, l);
used += l;
if (c)
@@ -397,7 +396,7 @@ int attribute_hidden __decode_dotted(const unsigned char *data, int offset,
if ((used + l + 1) >= maxlen)
return -1;
- memcpy(dest + used, data + offset, l);
+ __memcpy(dest + used, data + offset, l);
offset += l;
used += l;
if (measure)
@@ -482,7 +481,7 @@ int __decode_question(unsigned char *message, int offset,
offset += i;
- q->dotted = strdup(temp);
+ q->dotted = __strdup(temp);
q->qtype = (message[offset + 0] << 8) | message[offset + 1];
q->qclass = (message[offset + 2] << 8) | message[offset + 3];
@@ -528,7 +527,7 @@ int attribute_hidden __encode_answer(struct resolv_answer *a, unsigned char *des
*dest++ = (a->ttl & 0x000000ff) >> 0;
*dest++ = (a->rdlength & 0xff00) >> 8;
*dest++ = (a->rdlength & 0x00ff) >> 0;
- memcpy(dest, a->rdata, a->rdlength);
+ __memcpy(dest, a->rdata, a->rdlength);
return i + RRFIXEDSZ + a->rdlength;
}
@@ -547,7 +546,7 @@ int attribute_hidden __decode_answer(unsigned char *message, int offset,
message += offset + i;
- a->dotted = strdup(temp);
+ a->dotted = __strdup(temp);
a->atype = (message[0] << 8) | message[1];
message += 2;
a->aclass = (message[0] << 8) | message[1];
@@ -638,7 +637,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet,
struct resolv_question q;
int i, j;
- memset(&h, 0, sizeof(h));
+ __memset(&h, 0, sizeof(h));
h.id = id;
h.qdcount = 1;
@@ -714,11 +713,11 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
while (retries < MAX_RETRIES) {
if (fd != -1)
- close(fd);
+ __close(fd);
- memset(packet, 0, PACKETSZ);
+ __memset(packet, 0, PACKETSZ);
- memset(&h, 0, sizeof(h));
+ __memset(&h, 0, sizeof(h));
++local_id;
local_id &= 0xffff;
@@ -734,7 +733,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
if (i < 0)
goto fail;
- strncpy(lookup,name,MAXDNAME);
+ __strncpy(lookup,name,MAXDNAME);
if (variant >= 0) {
BIGLOCK;
if (variant < __searchdomains) {
@@ -865,7 +864,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
ma.buf = a->buf;
ma.buflen = a->buflen;
ma.add_count = a->add_count;
- memcpy(a, &ma, sizeof(ma));
+ __memcpy(a, &ma, sizeof(ma));
if (a->atype != T_SIG && (0 == a->buf || (type != T_A && type != T_AAAA)))
{
break;
@@ -897,7 +896,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
ma.rdlength, a->rdlength);
goto again;
}
- memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength);
+ __memcpy(a->buf + (a->add_count * ma.rdlength), ma.rdata, ma.rdlength);
++a->add_count;
}
}
@@ -905,7 +904,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
DPRINTF("Answer name = |%s|\n", a->dotted);
DPRINTF("Answer type = |%d|\n", a->atype);
- close(fd);
+ __close(fd);
if (outpacket)
*outpacket = packet;
@@ -957,7 +956,7 @@ int attribute_hidden __dns_lookup(const char *name, int type, int nscount, char
fail:
if (fd != -1)
- close(fd);
+ __close(fd);
if (lookup)
free(lookup);
if (packet)
@@ -1022,21 +1021,21 @@ int attribute_hidden __open_nameservers()
*p++ = '\0';
}
- if (strcmp(argv[0], "nameserver") == 0) {
+ if (__strcmp(argv[0], "nameserver") == 0) {
for (i = 1; i < argc && __nameservers < MAX_SERVERS; i++) {
- __nameserver[__nameservers++] = strdup(argv[i]);
+ __nameserver[__nameservers++] = __strdup(argv[i]);
DPRINTF("adding nameserver %s\n", argv[i]);
}
}
/* domain and search are mutually exclusive, the last one wins */
- if (strcmp(argv[0],"domain")==0 || strcmp(argv[0],"search")==0) {
+ if (__strcmp(argv[0],"domain")==0 || __strcmp(argv[0],"search")==0) {
while (__searchdomains > 0) {
free(__searchdomain[--__searchdomains]);
__searchdomain[__searchdomains] = NULL;
}
for (i=1; i < argc && __searchdomains < MAX_SEARCH; i++) {
- __searchdomain[__searchdomains++] = strdup(argv[i]);
+ __searchdomain[__searchdomains++] = __strdup(argv[i]);
DPRINTF("adding search %s\n", argv[i]);
}
}
@@ -1187,7 +1186,7 @@ int res_query(const char *dname, int class, int type,
return(-1);
}
- memset((char *) &a, '\0', sizeof(a));
+ __memset((char *) &a, '\0', sizeof(a));
BIGLOCK;
__nameserversXX=__nameservers;
@@ -1204,7 +1203,7 @@ int res_query(const char *dname, int class, int type,
if (a.atype == type) { /* CNAME*/
int len = MIN(anslen, i);
- memcpy(answer, packet, len);
+ __memcpy(answer, packet, len);
if (packet)
free(packet);
return(len);
@@ -1380,19 +1379,19 @@ int res_querydomain(name, domain, class, type, answer, anslen)
* Check for trailing '.';
* copy without '.' if present.
*/
- n = strlen(name);
+ n = __strlen(name);
if (n + 1 > sizeof(nbuf)) {
h_errno = NO_RECOVERY;
return (-1);
}
if (n > 0 && name[--n] == '.') {
- strncpy(nbuf, name, n);
+ __strncpy(nbuf, name, n);
nbuf[n] = '\0';
} else
longname = name;
} else {
- n = strlen(name);
- d = strlen(domain);
+ n = __strlen(name);
+ d = __strlen(domain);
if (n + 1 + d + 1 > sizeof(nbuf)) {
h_errno = NO_RECOVERY;
return (-1);
@@ -1509,7 +1508,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
*h_errnop=HOST_NOT_FOUND;
while (fgets(buf, buflen, fp)) {
- if ((cp = strchr(buf, '#')))
+ if ((cp = __strchr(buf, '#')))
*cp = '\0';
DPRINTF("Looking at: %s\n", buf);
aliases = 0;
@@ -1534,7 +1533,7 @@ int attribute_hidden __read_etc_hosts_r(FILE * fp, const char * name, int type,
/* Return whatever the next entry happens to be. */
break;
} else if (action==GET_HOSTS_BYADDR) {
- if (strcmp(name, alias[0]) != 0)
+ if (__strcmp(name, alias[0]) != 0)
continue;
} else {
/* GET_HOSTS_BYNAME */
@@ -1765,12 +1764,12 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
&& (getdomainname (domain, sizeof(domain)) == 0)
&& (c = strstr (h->h_name, domain))
&& (c != h->h_name) && (*(--c) == '.')) {
- strncpy (host, h->h_name,
+ __strncpy (host, h->h_name,
min(hostlen, (size_t) (c - h->h_name)));
host[min(hostlen - 1, (size_t) (c - h->h_name))] = '\0';
ok = 1;
} else {
- strncpy (host, h->h_name, hostlen);
+ __strncpy (host, h->h_name, hostlen);
ok = 1;
}
}
@@ -1811,7 +1810,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
if (if_indextoname (scopeid, scopeptr) == NULL)
++ni_numericscope;
else
- scopelen = strlen (scopebuf);
+ scopelen = __strlen (scopebuf);
} else {
++ni_numericscope;
}
@@ -1825,7 +1824,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,
if (real_hostlen + scopelen + 1 > hostlen)
return EAI_SYSTEM;
- memcpy (host + real_hostlen, scopebuf, scopelen + 1);
+ __memcpy (host + real_hostlen, scopebuf, scopelen + 1);
}
#endif
} else
@@ -1848,7 +1847,7 @@ int getnameinfo (const struct sockaddr *sa, socklen_t addrlen, char *host,