summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/ether_addr.c15
-rw-r--r--lib/libc/net/gethostbydns.c6
-rw-r--r--lib/libc/net/gethostbyht.c10
-rw-r--r--lib/libc/net/gethostbynis.c5
-rw-r--r--lib/libc/net/gethostnamadr.c9
-rw-r--r--lib/libc/net/getnetbydns.c3
-rw-r--r--lib/libc/net/getnetbyht.c4
-rw-r--r--lib/libc/net/getnetnamadr.c11
-rw-r--r--lib/libc/net/getproto.c2
-rw-r--r--lib/libc/net/getprotoname.c2
-rw-r--r--lib/libc/net/getservbyname.c2
-rw-r--r--lib/libc/net/getservbyport.c2
-rw-r--r--lib/libc/net/getservent.c2
-rw-r--r--lib/libc/net/inet_network.c2
-rw-r--r--lib/libc/net/rcmd.c2
-rw-r--r--lib/libc/net/res_comp.c6
-rw-r--r--lib/libc/net/res_debug.c10
-rw-r--r--lib/libc/net/res_send.c4
18 files changed, 62 insertions, 35 deletions
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c
index 934a76b..2d2101d 100644
--- a/lib/libc/net/ether_addr.c
+++ b/lib/libc/net/ether_addr.c
@@ -35,7 +35,7 @@
* Center for Telecommunications Research
* Columbia University, New York City
*
- * $Id: ether_addr.c,v 1.2 1995/08/07 03:42:14 wpaul Exp $
+ * $Id: ether_addr.c,v 1.3 1996/03/16 21:25:59 wpaul Exp $
*/
@@ -90,11 +90,20 @@ struct ether_addr *ether_aton(a)
{
int i;
static struct ether_addr o;
+ unsigned int o0, o1, o2, o3, o4, o5;
+
+ i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2],
- o.octet[3], o.octet[4], o.octet[5]);
if (i != 6)
return (NULL);
+
+ o.octet[0]=o0;
+ o.octet[1]=o1;
+ o.octet[2]=o2;
+ o.octet[3]=o3;
+ o.octet[4]=o4;
+ o.octet[5]=o5;
+
return ((struct ether_addr *)&o);
}
diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c
index 46213f8..e7e09ab 100644
--- a/lib/libc/net/gethostbydns.c
+++ b/lib/libc/net/gethostbydns.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $";
+static char rcsid[] = "$Id: gethostbydns.c,v 1.8 1996/01/13 09:03:40 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -73,6 +73,8 @@ static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $";
#include "res_config.h"
+extern void _res_close __P((void));
+
#define MAXALIASES 35
#define MAXADDRS 35
@@ -85,8 +87,6 @@ static struct hostent host;
static char *host_aliases[MAXALIASES];
static char hostbuf[8*1024];
static struct in_addr host_addr;
-static FILE *hostf = NULL;
-static int stayopen = 0;
#ifdef RESOLVSORT
static void addrsort __P((char **, int));
diff --git a/lib/libc/net/gethostbyht.c b/lib/libc/net/gethostbyht.c
index 9f1fa4c..a4b2203 100644
--- a/lib/libc/net/gethostbyht.c
+++ b/lib/libc/net/gethostbyht.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: gethostbyht.c,v 1.2 1995/05/30 05:40:44 rgrimes Exp $";
+static char rcsid[] = "$Id: gethostbyht.c,v 1.3 1996/01/13 09:03:45 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -135,7 +135,7 @@ again:
cp++;
host.h_name = cp;
q = host.h_aliases = host_aliases;
- if (cp = strpbrk(cp, " \t"))
+ if ( (cp = strpbrk(cp, " \t")) )
*cp++ = '\0';
while (cp && *cp) {
if (*cp == ' ' || *cp == '\t') {
@@ -144,7 +144,7 @@ again:
}
if (q < &host_aliases[MAXALIASES - 1])
*q++ = cp;
- if (cp = strpbrk(cp, " \t"))
+ if ( (cp = strpbrk(cp, " \t")) )
*cp++ = '\0';
}
*q = NULL;
@@ -160,7 +160,7 @@ _gethostbyhtname(name)
register char **cp;
sethostent(0);
- while (p = gethostent()) {
+ while ( (p = gethostent()) ) {
if (strcasecmp(p->h_name, name) == 0)
break;
for (cp = p->h_aliases; *cp != 0; cp++)
@@ -180,7 +180,7 @@ _gethostbyhtaddr(addr, len, type)
register struct hostent *p;
sethostent(0);
- while (p = gethostent())
+ while ( (p = gethostent()) )
if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len))
break;
endhostent();
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c
index f01f105..2f012b8 100644
--- a/lib/libc/net/gethostbynis.c
+++ b/lib/libc/net/gethostbynis.c
@@ -24,8 +24,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
-static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
+static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $";
+static char rcsid[] = "$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -34,6 +34,7 @@ static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 54f78d0..fff18cb 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -24,8 +24,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $";
-static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $";
+static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $";
+static char rcsid[] = "$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -38,6 +38,11 @@ static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $
#include <errno.h>
#include <string.h>
+extern void _sethosthtent __P(( int ));
+extern void _endhosthtent __P(( void ));
+extern void _sethostdnsent __P(( int ));
+extern void _endhostdnsent __P(( void ));
+
extern struct hostent * _gethostbyhtname __P((const char *));
extern struct hostent * _gethostbydnsname __P((const char *));
extern struct hostent * _gethostbynisname __P((const char *));
diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c
index 4464fed..14fe5d6 100644
--- a/lib/libc/net/getnetbydns.c
+++ b/lib/libc/net/getnetbydns.c
@@ -60,7 +60,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $";
+static char rcsid[] = "$Id: getnetbydns.c,v 1.5 1996/01/13 09:03:51 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -80,6 +80,7 @@ static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $";
#include "res_config.h"
+extern void _res_close __P((void));
extern int h_errno;
#define BYADDR 0
diff --git a/lib/libc/net/getnetbyht.c b/lib/libc/net/getnetbyht.c
index 24ca2ed..a9707df 100644
--- a/lib/libc/net/getnetbyht.c
+++ b/lib/libc/net/getnetbyht.c
@@ -141,7 +141,7 @@ _getnetbyhtname(name)
register char **cp;
setnetent(_net_stayopen);
- while (p = getnetent()) {
+ while ( (p = getnetent()) ) {
if (strcasecmp(p->n_name, name) == 0)
break;
for (cp = p->n_aliases; *cp != 0; cp++)
@@ -162,7 +162,7 @@ _getnetbyhtaddr(net, type)
register struct netent *p;
setnetent(_net_stayopen);
- while (p = getnetent())
+ while ( (p = getnetent()) )
if (p->n_addrtype == type && p->n_net == net)
break;
if (!_net_stayopen)
diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c
index 5d99c8f..b522d75 100644
--- a/lib/libc/net/getnetnamadr.c
+++ b/lib/libc/net/getnetnamadr.c
@@ -24,8 +24,8 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $";
-static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $";
+static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $";
+static char rcsid[] = "$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -38,6 +38,13 @@ static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"
#include <errno.h>
#include <string.h>
+extern void _setnetent __P(( int ));
+extern void _endnetent __P(( void ));
+extern void _setnethtent __P(( int ));
+extern void _endnethtent __P(( void ));
+extern void _setnetdnsent __P(( int ));
+extern void _endnetdnsent __P(( void ));
+
extern struct netent * _getnetbyhtname __P((const char *));
extern struct netent * _getnetbydnsname __P((const char *));
extern struct netent * _getnetbynisname __P((const char *));
diff --git a/lib/libc/net/getproto.c b/lib/libc/net/getproto.c
index 92f562b..46f46d3 100644
--- a/lib/libc/net/getproto.c
+++ b/lib/libc/net/getproto.c
@@ -46,7 +46,7 @@ getprotobynumber(proto)
register struct protoent *p;
setprotoent(_proto_stayopen);
- while (p = getprotoent())
+ while ( (p = getprotoent()) )
if (p->p_proto == proto)
break;
if (!_proto_stayopen)
diff --git a/lib/libc/net/getprotoname.c b/lib/libc/net/getprotoname.c
index 3ee6754..0832acf 100644
--- a/lib/libc/net/getprotoname.c
+++ b/lib/libc/net/getprotoname.c
@@ -48,7 +48,7 @@ getprotobyname(name)
register char **cp;
setprotoent(_proto_stayopen);
- while (p = getprotoent()) {
+ while ( (p = getprotoent()) ) {
if (strcmp(p->p_name, name) == 0)
break;
for (cp = p->p_aliases; *cp != 0; cp++)
diff --git a/lib/libc/net/getservbyname.c b/lib/libc/net/getservbyname.c
index fcff7cf..124f5ac 100644
--- a/lib/libc/net/getservbyname.c
+++ b/lib/libc/net/getservbyname.c
@@ -56,7 +56,7 @@ getservbyname(name, proto)
#endif
setservent(_serv_stayopen);
- while (p = getservent()) {
+ while ( (p = getservent()) ) {
if (strcmp(name, p->s_name) == 0)
goto gotname;
for (cp = p->s_aliases; *cp; cp++)
diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c
index a24f8df..ef9a2e8 100644
--- a/lib/libc/net/getservbyport.c
+++ b/lib/libc/net/getservbyport.c
@@ -56,7 +56,7 @@ getservbyport(port, proto)
#endif
setservent(_serv_stayopen);
- while (p = getservent()) {
+ while ( (p = getservent()) ) {
if (p->s_port != port)
continue;
if (proto == 0 || strcmp(p->s_proto, proto) == 0)
diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c
index 6797b5a..d28f40c 100644
--- a/lib/libc/net/getservent.c
+++ b/lib/libc/net/getservent.c
@@ -48,6 +48,8 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
static int serv_stepping_yp = 0;
#endif
+extern int _yp_check __P(( char ** ));
+
#define MAXALIASES 35
static FILE *servf = NULL;
diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c
index c3a96a6..6da2e8b 100644
--- a/lib/libc/net/inet_network.c
+++ b/lib/libc/net/inet_network.c
@@ -60,7 +60,7 @@ again:
base = 8, cp++;
if (*cp == 'x' || *cp == 'X')
base = 16, cp++;
- while (c = *cp) {
+ while ( (c = *cp) ) {
if (isdigit(c)) {
val = (val * base) + (c - '0');
cp++;
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c
index 3d6c649..7e396c0 100644
--- a/lib/libc/net/rcmd.c
+++ b/lib/libc/net/rcmd.c
@@ -57,6 +57,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
#include <rpcsvc/ypclnt.h>
#endif
+extern int innetgr __P(( const char *, const char *, const char *, const char * ));
+
#define max(a, b) ((a > b) ? a : b)
int __ivaliduser __P((FILE *, u_long, const char *, const char *));
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index fbe5e95..523aa19 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_comp.c,v 1.3 1995/05/30 05:40:54 rgrimes Exp $";
+static char rcsid[] = "$Id: res_comp.c,v 1.4 1996/01/07 09:14:54 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -95,7 +95,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
/*
* fetch next label in domain name
*/
- while (n = *cp++) {
+ while ( (n = *cp++) ) {
/*
* Check for indirection
*/
@@ -298,7 +298,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
dn = exp_dn;
sp = cp = *cpp;
- while (n = *cp++) {
+ while ( (n = *cp++) ) {
/*
* check for indirection
*/
diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c
index fdcb1b8..ad65fc7 100644
--- a/lib/libc/net/res_debug.c
+++ b/lib/libc/net/res_debug.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_debug.c,v 1.6 1996/01/07 09:14:55 peter Exp $";
+static char rcsid[] = "$Id: res_debug.c,v 1.7 1996/02/06 20:35:48 wollman Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -171,7 +171,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs)
* Print answer records.
*/
sflag = (_res.pfcode & pflag);
- if (n = ntohs(cnt)) {
+ if ( (n = ntohs(cnt)) ) {
if ((!_res.pfcode) ||
((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
fprintf(file, hs);
@@ -286,7 +286,7 @@ __fp_nquery(msg, len, file)
/*
* Print question records.
*/
- if (n = ntohs(hp->qdcount)) {
+ if ( (n = ntohs(hp->qdcount)) ) {
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
fprintf(file, ";; QUESTIONS:\n");
while (--n >= 0) {
@@ -490,7 +490,7 @@ __p_rr(cp, msg, file)
case T_HINFO:
case T_ISDN:
cp2 = cp + dlen;
- if (n = *cp++) {
+ if ( (n = *cp++) ) {
fprintf(file, "\t%.*s", n, cp);
cp += n;
}
@@ -549,7 +549,7 @@ __p_rr(cp, msg, file)
(void) fputs("\t\"", file);
cp2 = cp1 + dlen;
while (cp < cp2) {
- if (n = (unsigned char) *cp++) {
+ if ( (n = (unsigned char) *cp++) ) {
for (c = n; c > 0 && cp < cp2; c--)
if ((*cp == '\n') || (*cp == '"')) {
(void) putc('\\', file);
diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c
index 88df305..eb1b321 100644
--- a/lib/libc/net/res_send.c
+++ b/lib/libc/net/res_send.c
@@ -53,7 +53,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static char rcsid[] = "$Id: res_send.c,v 1.6 1995/08/21 09:15:40 bde Exp $";
+static char rcsid[] = "$Id: res_send.c,v 1.7 1996/01/07 09:15:02 peter Exp $";
#endif /* LIBC_SCCS and not lint */
/* change this to "0"
@@ -716,7 +716,7 @@ res_send(buf, buflen, ans, anssiz)
* This routine is not expected to be user visible.
*/
void
-_res_close()
+_res_close(void)
{
if (s >= 0) {
(void) close(s);
OpenPOWER on IntegriCloud