summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/addrtoname.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2001-04-03 07:50:46 +0000
committerfenner <fenner@FreeBSD.org>2001-04-03 07:50:46 +0000
commit2877f5b6133ecd5a0574b61880855776ec518278 (patch)
tree133b57ac128ee361805e9c2bedbcb790324dac62 /contrib/tcpdump/addrtoname.c
parentf7d9a5e270bfcbb075a637a52416185441d33d8d (diff)
downloadFreeBSD-src-2877f5b6133ecd5a0574b61880855776ec518278.zip
FreeBSD-src-2877f5b6133ecd5a0574b61880855776ec518278.tar.gz
Merge tcpdump 3.6.2
Diffstat (limited to 'contrib/tcpdump/addrtoname.c')
-rw-r--r--contrib/tcpdump/addrtoname.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/contrib/tcpdump/addrtoname.c b/contrib/tcpdump/addrtoname.c
index c1f2208..e53f41e 100644
--- a/contrib/tcpdump/addrtoname.c
+++ b/contrib/tcpdump/addrtoname.c
@@ -25,7 +25,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.64 1999/11/21 09:36:44 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/addrtoname.c,v 1.69.2.1 2001/01/17 18:29:58 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -36,17 +36,13 @@ static const char rcsid[] =
#include <sys/socket.h>
#include <sys/time.h>
-#if __STDC__
struct mbuf;
struct rtentry;
-#endif
#include <net/if.h>
#include <netinet/in.h>
-#include <net/ethernet.h>
-
-#ifdef INET6
-#include <netinet/ip6.h>
+#ifdef HAVE_NETINET_IF_ETHER_H
+#include <netinet/if_ether.h>
#endif
#include <arpa/inet.h>
@@ -55,12 +51,6 @@ struct rtentry;
#include <netdb.h>
#include <pcap.h>
#include <pcap-namedb.h>
-#ifdef HAVE_MALLOC_H
-#include <malloc.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
#include <signal.h>
#include <stdio.h>
#include <string.h>
@@ -497,7 +487,6 @@ protoid_string(register const u_char *pi)
char *
llcsap_string(u_char sap)
{
- register char *cp;
register struct hnamemem *tp;
register u_int32_t i = sap;
char buf[sizeof("sap 00")];
@@ -509,12 +498,7 @@ llcsap_string(u_char sap)
tp->addr = i;
tp->nxt = newhnamemem();
- cp = buf;
- (void)strcpy(cp, "sap ");
- cp += strlen(cp);
- *cp++ = hex[sap >> 4 & 0xf];
- *cp++ = hex[sap & 0xf];
- *cp++ = '\0';
+ snprintf(buf, sizeof(buf), "sap %02x", sap & 0xff);
tp->name = savestr(buf);
return (tp->name);
}
OpenPOWER on IntegriCloud