summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1995-03-16 17:32:27 +0000
committerwollman <wollman@FreeBSD.org>1995-03-16 17:32:27 +0000
commit8882d76eda0f65db86b70a8641d460198eb851a8 (patch)
tree5c2d441929d3849ef1585bf6a45ffbf8efc7b3b3 /sys/netinet
parent9c613cfeaeb4019f90ec8d3ffdfc4142386b7463 (diff)
downloadFreeBSD-src-8882d76eda0f65db86b70a8641d460198eb851a8.zip
FreeBSD-src-8882d76eda0f65db86b70a8641d460198eb851a8.tar.gz
Add inet_ntoa() and replace ARP's private routine with same.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/if_ether.c30
-rw-r--r--sys/netinet/in.h5
2 files changed, 10 insertions, 25 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index 1de191a..9517a3c 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ether.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ether.c,v 1.10 1994/12/22 22:00:29 wollman Exp $
+ * $Id: if_ether.c,v 1.11 1995/02/20 15:48:40 davidg Exp $
*/
/*
@@ -97,24 +97,6 @@ int arp_proxyall = 1;
#endif
/*
- * Support: format an IP address. There should be a standard kernel routine
- * to do this.
- */
-static char *
-arp_ntoa(struct in_addr *x)
-{
- static char buf[4*sizeof "123"];
- unsigned char *ucp = (unsigned char *)x;
-
- sprintf(buf, "%d.%d.%d.%d",
- ucp[0] & 0xff,
- ucp[1] & 0xff,
- ucp[2] & 0xff,
- ucp[3] & 0xff);
- return buf;
-}
-
-/*
* Timeout routine. Age arp_tab entries periodically.
*/
/* ARGSUSED */
@@ -467,13 +449,13 @@ in_arpinput(m)
sizeof (ea->arp_sha))) {
log(LOG_ERR,
"arp: ether address is broadcast for IP address %s!\n",
- arp_ntoa(&isaddr));
+ inet_ntoa(isaddr));
goto out;
}
if (isaddr.s_addr == myaddr.s_addr) {
log(LOG_ERR,
"duplicate IP address %s! sent from ethernet address: %s\n",
- arp_ntoa(&isaddr), ether_sprintf(ea->arp_sha));
+ inet_ntoa(isaddr), ether_sprintf(ea->arp_sha));
itaddr = myaddr;
goto reply;
}
@@ -482,7 +464,7 @@ in_arpinput(m)
if (sdl->sdl_alen &&
bcmp((caddr_t)ea->arp_sha, LLADDR(sdl), sdl->sdl_alen))
log(LOG_INFO, "arp info overwritten for %s by %s\n",
- arp_ntoa(&isaddr), ether_sprintf(ea->arp_sha));
+ inet_ntoa(isaddr), ether_sprintf(ea->arp_sha));
bcopy((caddr_t)ea->arp_sha, LLADDR(sdl),
sdl->sdl_alen = sizeof(ea->arp_sha));
if (rt->rt_expire)
@@ -539,7 +521,7 @@ reply:
rtfree(rt);
#ifdef DEBUG_PROXY
printf("arp: proxying for %s\n",
- arp_ntoa(&itaddr));
+ inet_ntoa(itaddr));
#endif
#else
goto out;
@@ -617,7 +599,7 @@ arplookup(addr, create, proxy)
if(why && create) {
log(LOG_DEBUG, "arplookup %s failed: %s\n",
- arp_ntoa(&sin.sin_addr), why);
+ inet_ntoa(sin.sin_addr), why);
return 0;
} else if(why) {
return 0;
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index b4fd19f..5c83a2e 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)in.h 8.3 (Berkeley) 1/3/94
- * $Id: in.h,v 1.6 1994/12/21 17:23:59 wollman Exp $
+ * $Id: in.h,v 1.7 1995/02/14 23:04:50 wollman Exp $
*/
#ifndef _NETINET_IN_H_
@@ -244,12 +244,15 @@ struct ip_mreq {
#ifdef KERNEL
+struct ifnet; struct mbuf; /* forward declarations for Standard C */
+
int in_broadcast __P((struct in_addr, struct ifnet *));
int in_canforward __P((struct in_addr));
int in_cksum __P((struct mbuf *, int));
int in_localaddr __P((struct in_addr));
u_long in_netof __P((struct in_addr));
void in_socktrim __P((struct sockaddr_in *));
+char *inet_ntoa __P((struct in_addr)); /* in libkern */
#endif
#endif
OpenPOWER on IntegriCloud