dect
/
libpcap
Archived
13
0
Fork 0

replace bzero with memset

This commit is contained in:
assar 2000-07-29 08:03:56 +00:00
parent 6019517c9b
commit 6dc5bf2601
5 changed files with 15 additions and 15 deletions

View File

@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.38 2000-07-14 06:25:49 guy Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.39 2000-07-29 08:03:56 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -176,7 +176,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
pcap_strerror(errno));
return (NULL);
}
bzero(p, sizeof(*p));
memset(p, 0, sizeof(*p));
fd = bpf_open(p, ebuf);
if (fd < 0)
goto bad;

View File

@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.35 2000-07-11 00:37:06 assar Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-nit.c,v 1.36 2000-07-29 08:03:56 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -161,7 +161,7 @@ nit_setflags(int fd, int promisc, int to_ms, char *ebuf)
{
struct nit_ioc nioc;
bzero((char *)&nioc, sizeof(nioc));
memset(&nioc, 0, sizeof(nioc));
nioc.nioc_bufspace = BUFSPACE;
nioc.nioc_chunksize = CHUNKSIZE;
nioc.nioc_typetomatch = NT_ALLTYPES;
@ -204,7 +204,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
*/
snaplen = 96;
bzero(p, sizeof(*p));
memset(p, 0, sizeof(*p));
p->fd = fd = socket(AF_NIT, SOCK_RAW, NITPROTO_RAW);
if (fd < 0) {
snprintf(ebuf, PCAP_ERRBUF_SIZE,

View File

@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/pcap-pf.c,v 1.58 2000-07-11 00:37:06 assar Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-pf.c,v 1.59 2000-07-29 08:03:57 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -216,7 +216,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
"pcap_open_live: %s", pcap_strerror(errno));
return (0);
}
bzero((char *)p, sizeof(*p));
memset(p, 0, sizeof(*p));
p->fd = pfopen(device, O_RDONLY);
if (p->fd < 0) {
snprintf(ebuf, PCAP_ERRBUF_SIZE, "pf open: %s: %s\n\
@ -294,7 +294,7 @@ your system may not be properly configured; see \"man packetfilter(4)\"\n",
}
p->snapshot = snaplen;
/* accept all packets */
bzero((char *)&Filter, sizeof(Filter));
memset(&Filter, 0, sizeof(Filter));
Filter.enf_Priority = 37; /* anything > 2 */
Filter.enf_FilterLen = 0; /* means "always true" */
if (ioctl(p->fd, EIOCSETF, (caddr_t)&Filter) < 0) {

View File

@ -25,7 +25,7 @@
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.50 2000-07-11 00:37:07 assar Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-snit.c,v 1.51 2000-07-29 08:03:57 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -223,7 +223,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
*/
snaplen = 96;
bzero(p, sizeof(*p));
memset(p, 0, sizeof(*p));
p->fd = fd = open(dev, O_RDONLY);
if (fd < 0) {
snprintf(ebuf, PCAP_ERRBUF_SIZE, "%s: %s", dev,

View File

@ -20,7 +20,7 @@
*/
#ifndef lint
static const char rcsid[] =
"@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.26 2000-07-11 00:37:07 assar Exp $ (LBL)";
"@(#) $Header: /tcpdump/master/libpcap/pcap-snoop.c,v 1.27 2000-07-29 08:03:57 assar Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@ -108,7 +108,7 @@ pcap_stats(pcap_t *p, struct pcap_stat *ps)
struct rawstats rawstats;
rs = &rawstats;
bzero((char *)rs, sizeof(*rs));
memset(rs, 0, sizeof(*rs));
if (ioctl(p->fd, SIOCRAWSTATS, (char *)rs) < 0) {
snprintf(p->errbuf, sizeof(p->errbuf),
"SIOCRAWSTATS: %s", pcap_strerror(errno));
@ -142,7 +142,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
pcap_strerror(errno));
return (NULL);
}
bzero((char *)p, sizeof(*p));
memset(p, 0, sizeof(*p));
fd = socket(PF_RAW, SOCK_RAW, RAWPROTO_SNOOP);
if (fd < 0) {
snprintf(ebuf, PCAP_ERRBUF_SIZE, "snoop socket: %s",
@ -150,7 +150,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
goto bad;
}
p->fd = fd;
bzero((char *)&sr, sizeof(sr));
memset(&sr, 0, sizeof(sr));
sr.sr_family = AF_RAW;
(void)strncpy(sr.sr_ifname, device, sizeof(sr.sr_ifname));
if (bind(fd, (struct sockaddr *)&sr, sizeof(sr))) {
@ -158,7 +158,7 @@ pcap_open_live(char *device, int snaplen, int promisc, int to_ms, char *ebuf)
pcap_strerror(errno));
goto bad;
}
bzero((char *)&sf, sizeof(sf));
memset(&sf, 0, sizeof(sf));
if (ioctl(fd, SIOCADDSNOOP, &sf) < 0) {
snprintf(ebuf, PCAP_ERRBUF_SIZE, "SIOCADDSNOOP: %s",
pcap_strerror(errno));