CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sat Apr 4 21:00:03 UTC 2020 Modified Files: src/external/bsd/libpcap/dist: pcap-int.h Log Message: Always include the sampling member so that the struct size is consistent. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/bsd/libpcap/dist/pcap-int.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-int.h diff -u src/external/bsd/libpcap/dist/pcap-int.h:1.6 src/external/bsd/libpcap/dist/pcap-int.h:1.7 --- src/external/bsd/libpcap/dist/pcap-int.h:1.6 Tue Oct 1 12:02:12 2019 +++ src/external/bsd/libpcap/dist/pcap-int.h Sat Apr 4 17:00:03 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pcap-int.h,v 1.6 2019/10/01 16:02:12 christos Exp $ */ +/* $NetBSD: pcap-int.h,v 1.7 2020/04/04 21:00:03 christos Exp $ */ /* * Copyright (c) 1994, 1995, 1996 @@ -182,9 +182,9 @@ struct pcap { void *priv; /* private data for methods */ -#ifdef ENABLE_REMOTE +// #ifdef ENABLE_REMOTE struct pcap_samp rmt_samp; /* parameters related to the sampling process. */ -#endif +// #endif int swapped; FILE *rfile; /* null if live capture, non-null if savefile */
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Mar 29 19:50:23 UTC 2020 Modified Files: src/external/bsd/libpcap/dist: pcap-rpcap-unix.c Log Message: make the patch compile on NetBSD To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/bsd/libpcap/dist/pcap-rpcap-unix.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-rpcap-unix.c diff -u src/external/bsd/libpcap/dist/pcap-rpcap-unix.c:1.1 src/external/bsd/libpcap/dist/pcap-rpcap-unix.c:1.2 --- src/external/bsd/libpcap/dist/pcap-rpcap-unix.c:1.1 Sun Mar 29 15:49:26 2020 +++ src/external/bsd/libpcap/dist/pcap-rpcap-unix.c Sun Mar 29 15:50:23 2020 @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include "pcap-rpcap-unix.h" @@ -113,17 +113,17 @@ put32(unsigned char *buf, unsigned int v } static int -rpcap_recv_pkt(pcap_t *p, int fd, char *recv_buf, unsigned int buflen) +rpcap_recv_pkt(pcap_t *p, int fd, unsigned char *recv_buf, unsigned int buflen) { - static char discard[1024]; + static unsigned char discard[1024]; size_t mlen; int ret; - char *buf; + unsigned char *buf; unsigned int len; unsigned int pkt_len; - char hdr[8]; + unsigned char hdr[8]; int pkt_type; /* read header loop */ @@ -162,7 +162,7 @@ rpcap_recv_pkt(pcap_t *p, int fd, char * pkt_len = get32([4]); if (pkt_type == RPCAP_MSG_ERROR) { - recv_buf = p->errbuf; + recv_buf = (unsigned char *)p->errbuf; buflen = PCAP_ERRBUF_SIZE-1; } @@ -216,10 +216,8 @@ rpcap_recv_pkt(pcap_t *p, int fd, char * } static int -rpcap_send_pkt(pcap_t *p, const char *send_buf, unsigned int len) +rpcap_send_pkt(pcap_t *p, const unsigned char *send_buf, unsigned int len) { - char *buf; - size_t mlen; int ret; @@ -252,7 +250,7 @@ rpcap_send_pkt(pcap_t *p, const char *se } static int -rpcap_send_request(pcap_t *p, char type, char *buf, unsigned int payload_len) +rpcap_send_request(pcap_t *p, char type, unsigned char *buf, unsigned int payload_len) { buf[0] = RPCAP_VERSION_EXPERIMENTAL; buf[1] = type; @@ -265,14 +263,13 @@ rpcap_send_request(pcap_t *p, char type, static int rpcap_send_request_auth(pcap_t *p, const char *username, const char *password) { - int res; if (username || password) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: auth not supported (yet!)"); return -1; } else { - static const char login_null_pkt[16] = { + static const unsigned char login_null_pkt[16] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_AUTH_REQ, 0, 0, @@ -293,14 +290,14 @@ rpcap_send_request_open(pcap_t *p, const { const size_t interface_len = strlen(interface); - char buf_open[8+255] = { + unsigned char buf_open[8+255] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_OPEN_REQ, 0, 0, 0, 0, 0, interface_len }; - char reply_buf[8]; + unsigned char reply_buf[8]; int reply_len; if (interface_len > 255) { @@ -328,7 +325,7 @@ rpcap_send_request_open(pcap_t *p, const static int rpcap_send_request_start(pcap_t *p, struct in_addr *server_ip) { - char buf_start[8+12+8+8] = { + unsigned char buf_start[8+12+8+8] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_STARTCAP_REQ, 0, 0, @@ -350,15 +347,14 @@ rpcap_send_request_start(pcap_t *p, stru }; struct sockaddr_in sin; - char reply_buf[8]; + unsigned char reply_buf[8]; int reply_len; int fd; - unsigned int buf_size; unsigned short portdata; put32(_start[8], p->snapshot); /* snaplen */ - put32(_start[12], p->md.timeout/2); /* read_timeout */ + put32(_start[12], p->opt.timeout/2); /* read_timeout */ if (rpcap_send_pkt(p, buf_start, sizeof(buf_start))) return -1; @@ -370,7 +366,7 @@ rpcap_send_request_start(pcap_t *p, stru return -1; } - buf_size = get32(_buf[0]); + get32(_buf[0]); portdata = get16(_buf[4]); fd = socket(AF_INET, SOCK_STREAM, 0); @@ -405,14 +401,14 @@ rpcap_inject_common(pcap_t *handle, cons static int rpcap_stats_common(pcap_t *handle, struct pcap_stat *stats) { - static const char buf_stats[8] = { + static const unsigned char buf_stats[8] = { RPCAP_VERSION_EXPERIMENTAL, RPCAP_MSG_STATS_REQ, 0, 0, 0, 0, 0, 0 }; - char reply_buf[16]; + unsigned char reply_buf[16]; int reply_len; /* local */ @@ -442,7 +438,7 @@ rpcap_stats_common(pcap_t *handle, struc static int rpcap_setfilter_common(pcap_t *handle, struct bpf_program *prog) { - char *buf_setfilter; + unsigned char *buf_setfilter; /* update local filter */ if (install_bpf_program(handle, prog) == -1) @@ -451,9 +447,9 @@ rpcap_setfilter_common(pcap_t *handle, s /* update remote filter */ if (prog->bf_len < 0xf) { unsigned int data_size = 8 + 8 * prog->bf_len; - char *buf_filter; - char *buf_insn; - int i; + unsigned char *buf_filter; + unsigned char *buf_insn; + size_t i; buf_setfilter = malloc(8 + data_size); if
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Mar 29 19:49:26 UTC 2020 Modified Files: src/external/bsd/libpcap/dist: pcap.c Added Files: src/external/bsd/libpcap/dist: pcap-rpcap-unix.c pcap-rpcap-unix.h Log Message: Use http://sourceforge.net/p/libpcap/patches/_discuss/thread/fc8f43a0/ad35/\ attachment/rpcap3.patch to provide rpcap support. To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/dist/pcap-rpcap-unix.c \ src/external/bsd/libpcap/dist/pcap-rpcap-unix.h cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libpcap/dist/pcap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap.c diff -u src/external/bsd/libpcap/dist/pcap.c:1.9 src/external/bsd/libpcap/dist/pcap.c:1.10 --- src/external/bsd/libpcap/dist/pcap.c:1.9 Tue Oct 1 12:02:12 2019 +++ src/external/bsd/libpcap/dist/pcap.c Sun Mar 29 15:49:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pcap.c,v 1.9 2019/10/01 16:02:12 christos Exp $ */ +/* $NetBSD: pcap.c,v 1.10 2020/03/29 19:49:26 christos Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998 @@ -34,7 +34,7 @@ */ #include -__RCSID("$NetBSD: pcap.c,v 1.9 2019/10/01 16:02:12 christos Exp $"); +__RCSID("$NetBSD: pcap.c,v 1.10 2020/03/29 19:49:26 christos Exp $"); #ifdef HAVE_CONFIG_H #include @@ -125,6 +125,10 @@ struct rtentry; /* declarations in +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "pcap-rpcap-unix.h" + +#define RPCAP_IFACE "rpcap://" + +/* default */ +#define RPCAP_DEFAULT_NETPORT 2002 + +/* version */ +#define RPCAP_VERSION_EXPERIMENTAL 0 + +/* packets */ +#define RPCAP_MSG_ERROR 1/*!< Message that keeps an error notification */ +#define RPCAP_MSG_OPEN_REQ 3 /*!< Request to open a remote device */ +#define RPCAP_MSG_STARTCAP_REQ 4 /*!< Request to start a capture on a remote device */ +#define RPCAP_MSG_UPDATEFILTER_REQ 5 /*!< Send a compiled filter into the remote device */ +#define RPCAP_MSG_PACKET 7/*!< This is a 'data' message, which carries a network packet */ +#define RPCAP_MSG_AUTH_REQ 8 /*!< Message that keeps the authentication parameters */ +#define RPCAP_MSG_STATS_REQ 9 /*!< It requires to have network statistics */ + +#define RPCAP_UPDATEFILTER_BPF 1 /*!< This code tells us that the filter is encoded with the BPF/NPF syntax */ + +static unsigned short +get16(const unsigned char *buf) +{ + unsigned short val; + + val = buf[0]; + val = val << 8 | buf[1]; + return val; +} + +static void +put16(unsigned char *buf, unsigned int val) +{ + buf[0] = val >> 8; + buf[1] = val >> 0; +} + +static unsigned int +get32(const unsigned char *buf) +{ + unsigned int val; + + val = buf[0]; + val = val << 8 | buf[1]; + val = val << 8 | buf[2]; + val = val << 8 | buf[3]; + return val; +} + +static void +put32(unsigned char *buf, unsigned int val) +{ + buf[0] = val >> 24; + buf[1] = val >> 16; + buf[2] = val >> 8; + buf[3] = val >> 0; +} + +static int +rpcap_recv_pkt(pcap_t *p, int fd, char *recv_buf, unsigned int buflen) +{ + static char discard[1024]; + + size_t mlen; + int ret; + char *buf; + unsigned int len; + unsigned int pkt_len; + + char hdr[8]; + int pkt_type; + +/* read header loop */ + buf = hdr; + len = 8; + + ret = 0; + do { + buf += ret; + len -= ret; + + do { + ret = read(fd, buf, len); + if (p->break_loop) { +snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "break-loop"); +p->break_loop = 0; +return -2; + } + } while (ret == -1 && errno == EINTR); + } while (ret > 0 && len-ret); + + if (ret <= 0) { + if (!ret) + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection closed"); + else + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection error (%s)", strerror(errno)); + return -1; + } + + if (hdr[0] != RPCAP_VERSION_EXPERIMENTAL) { + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: incorrect reply version (%.2x)", hdr[0]); + return -1; + } + + pkt_type = (unsigned char) hdr[1]; + pkt_len = get32([4]); + + if (pkt_type == RPCAP_MSG_ERROR) { + recv_buf = p->errbuf; + buflen = PCAP_ERRBUF_SIZE-1; + } + + buf = recv_buf; + +/* read payload loop */ + if (pkt_len) { + ret = 0; + len = pkt_len; + do { + buf += ret; + buflen -= ret; + len -= ret; + + if (!buflen) { +buf = discard; +buflen = sizeof(discard); + } + + mlen = (len < 0x7fff) ? len : 0x7fff; + + if (mlen > buflen) +mlen = buflen; + + do { +ret = read(fd, buf, mlen); +if (p->break_loop) { + p->break_loop = 0; + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "break-loop"); + return -2; +} + } while (ret == -1 && errno == EINTR); + } while (ret > 0 && len-ret); + + if (ret <= 0) { + if (!ret) +snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection closed"); + else +snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "rpcap: connection error (%s)", strerror(errno)); +
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Wed Sep 5 17:10:07 UTC 2018 Modified Files: src/external/bsd/libpcap/dist: bpf_filter.c Log Message: make sure we don't accidentally compile this file. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libpcap/dist/bpf_filter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/bpf_filter.c diff -u src/external/bsd/libpcap/dist/bpf_filter.c:1.2 src/external/bsd/libpcap/dist/bpf_filter.c:1.3 --- src/external/bsd/libpcap/dist/bpf_filter.c:1.2 Mon Sep 3 11:26:43 2018 +++ src/external/bsd/libpcap/dist/bpf_filter.c Wed Sep 5 13:10:07 2018 @@ -38,6 +38,8 @@ * @(#)bpf.c 7.5 (Berkeley) 7/15/91 */ +#error "We are using the kernel version of this file" + #ifdef HAVE_CONFIG_H #include #endif
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: ginsbach Date: Sat Aug 12 00:43:25 UTC 2017 Modified Files: src/external/bsd/libpcap/dist: gencode.c Log Message: PR lib/51952: Brad Harder: Apply upstream ada959c9 [From upstream tcpdump] In pcap_compile(), first check whether the pcap_t is activated. Before we allocate or otherwise set up anything, check whether the pcap_t is activated, and set the error message string and return -1 if it's not. That way, we don't go through the cleanup code in that code path - there's nothing to clean up. Fixes the issue in GitHub pull request #552. XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libpcap/dist/gencode.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/gencode.c diff -u src/external/bsd/libpcap/dist/gencode.c:1.9 src/external/bsd/libpcap/dist/gencode.c:1.10 --- src/external/bsd/libpcap/dist/gencode.c:1.9 Tue Jan 24 22:29:28 2017 +++ src/external/bsd/libpcap/dist/gencode.c Sat Aug 12 00:43:25 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: gencode.c,v 1.9 2017/01/24 22:29:28 christos Exp $ */ +/* $NetBSD: gencode.c,v 1.10 2017/08/12 00:43:25 ginsbach Exp $ */ /*#define CHASE_CHAIN*/ /* @@ -23,7 +23,7 @@ */ #include -__RCSID("$NetBSD: gencode.c,v 1.9 2017/01/24 22:29:28 christos Exp $"); +__RCSID("$NetBSD: gencode.c,v 1.10 2017/08/12 00:43:25 ginsbach Exp $"); #ifdef HAVE_CONFIG_H #include "config.h" @@ -669,6 +669,9 @@ int pcap_compile(pcap_t *p, struct bpf_program *program, const char *buf, int optimize, bpf_u_int32 mask) { +#ifdef _WIN32 + static int done = 0; +#endif compiler_state_t cstate; const char * volatile xbuf = buf; yyscan_t scanner = NULL; @@ -676,14 +679,6 @@ pcap_compile(pcap_t *p, struct bpf_progr u_int len; int rc; -#ifdef _WIN32 - static int done = 0; - - if (!done) - pcap_wsockinit(); - done = 1; -#endif - /* * If this pcap_t hasn't been activated, it doesn't have a * link-layer type, so we can't use it. @@ -691,9 +686,14 @@ pcap_compile(pcap_t *p, struct bpf_progr if (!p->activated) { pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "not-yet-activated pcap_t passed to pcap_compile"); - rc = -1; - goto quit; + return -1; } + +#ifdef _WIN32 + if (!done) + pcap_wsockinit(); + done = 1; +#endif initchunks(); cstate.no_optimize = 0; cstate.ai = NULL;
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Fri Jan 27 15:52:21 UTC 2017 Modified Files: src/external/bsd/libpcap/dist: gencode.h Log Message: propagate deadness. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/libpcap/dist/gencode.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/gencode.h diff -u src/external/bsd/libpcap/dist/gencode.h:1.4 src/external/bsd/libpcap/dist/gencode.h:1.5 --- src/external/bsd/libpcap/dist/gencode.h:1.4 Tue Jan 24 17:29:28 2017 +++ src/external/bsd/libpcap/dist/gencode.h Fri Jan 27 10:52:21 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: gencode.h,v 1.4 2017/01/24 22:29:28 christos Exp $ */ +/* $NetBSD: gencode.h,v 1.5 2017/01/27 15:52:21 christos Exp $ */ /* * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996 @@ -368,7 +368,8 @@ struct icode { }; void bpf_optimize(compiler_state_t *, struct icode *ic); -void bpf_syntax_error(compiler_state_t *, const char *); +void bpf_syntax_error(compiler_state_t *, const char *) +__attribute__((noreturn)); void bpf_error(compiler_state_t *, const char *, ...) __attribute__((noreturn)) #ifdef __ATTRIBUTE___FORMAT_OK
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: joerg Date: Fri Aug 28 11:20:55 UTC 2015 Modified Files: src/external/bsd/libpcap/dist: pcap-common.c Log Message: Simplify to avoid negation-only-applies-to-LHS warning. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libpcap/dist/pcap-common.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-common.c diff -u src/external/bsd/libpcap/dist/pcap-common.c:1.3 src/external/bsd/libpcap/dist/pcap-common.c:1.4 --- src/external/bsd/libpcap/dist/pcap-common.c:1.3 Tue Mar 31 21:39:42 2015 +++ src/external/bsd/libpcap/dist/pcap-common.c Fri Aug 28 11:20:55 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: pcap-common.c,v 1.3 2015/03/31 21:39:42 christos Exp $ */ +/* $NetBSD: pcap-common.c,v 1.4 2015/08/28 11:20:55 joerg Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996, 1997 @@ -24,7 +24,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: pcap-common.c,v 1.3 2015/03/31 21:39:42 christos Exp $); +__RCSID($NetBSD: pcap-common.c,v 1.4 2015/08/28 11:20:55 joerg Exp $); #ifdef HAVE_CONFIG_H #include config.h @@ -1326,7 +1326,7 @@ swap_nflog_header(const struct pcap_pkth return; } - if (!(nfhdr-nflog_version) == 0) { + if (nfhdr-nflog_version != 0) { /* Unknown NFLOG version */ return; }
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Apr 5 22:36:36 UTC 2015 Modified Files: src/external/bsd/libpcap/dist: scanner.l Log Message: don't forget to include config.h otherwise it thinks we don't have vnsnprintf and fortify compiles fail. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libpcap/dist/scanner.l Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/scanner.l diff -u src/external/bsd/libpcap/dist/scanner.l:1.7 src/external/bsd/libpcap/dist/scanner.l:1.8 --- src/external/bsd/libpcap/dist/scanner.l:1.7 Tue Mar 31 17:39:42 2015 +++ src/external/bsd/libpcap/dist/scanner.l Sun Apr 5 18:36:36 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: scanner.l,v 1.7 2015/03/31 21:39:42 christos Exp $ */ +/* $NetBSD: scanner.l,v 1.8 2015/04/05 22:36:36 christos Exp $ */ %{ /* @@ -22,8 +22,9 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include sys/cdefs.h -__RCSID($NetBSD: scanner.l,v 1.7 2015/03/31 21:39:42 christos Exp $); +__RCSID($NetBSD: scanner.l,v 1.8 2015/04/05 22:36:36 christos Exp $); +#include config.h #ifdef WIN32 #include pcap-stdinc.h #else /* WIN32 */
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sat Apr 6 15:58:00 UTC 2013 Update of /cvsroot/src/external/bsd/libpcap/dist In directory ivanova.netbsd.org:/tmp/cvs-serv2202 Log Message: import 1.3.0 Status: Vendor Tag: TCPDUMP Release Tags: libpcap-1_3_0 U src/external/bsd/libpcap/dist/pcap-sita.html U src/external/bsd/libpcap/dist/sf-pcap-ng.h U src/external/bsd/libpcap/dist/pcap-dlpi.c U src/external/bsd/libpcap/dist/pcap-dag.c C src/external/bsd/libpcap/dist/pcap-bpf.c N src/external/bsd/libpcap/dist/pcap_list_tstamp_types.3pcap.in U src/external/bsd/libpcap/dist/configure U src/external/bsd/libpcap/dist/mkdep U src/external/bsd/libpcap/dist/pcap_can_set_rfmon.3pcap U src/external/bsd/libpcap/dist/pcap_breakloop.3pcap U src/external/bsd/libpcap/dist/savefile.c N src/external/bsd/libpcap/dist/pcap_set_tstamp_type.3pcap.in U src/external/bsd/libpcap/dist/pcap-filter.manmisc.in U src/external/bsd/libpcap/dist/pcap-libdlpi.c C src/external/bsd/libpcap/dist/sf-pcap.c N src/external/bsd/libpcap/dist/pcap-canusb-linux.h U src/external/bsd/libpcap/dist/fad-sita.c U src/external/bsd/libpcap/dist/README.aix U src/external/bsd/libpcap/dist/config.sub U src/external/bsd/libpcap/dist/pcap_strerror.3pcap C src/external/bsd/libpcap/dist/pcap.3pcap.in U src/external/bsd/libpcap/dist/pcap_set_promisc.3pcap U src/external/bsd/libpcap/dist/pcap-can-linux.h U src/external/bsd/libpcap/dist/pcap_datalink_name_to_val.3pcap C src/external/bsd/libpcap/dist/sf-pcap-ng.c U src/external/bsd/libpcap/dist/pcap-snf.c U src/external/bsd/libpcap/dist/ppp.h U src/external/bsd/libpcap/dist/pcap_list_datalinks.3pcap.in C src/external/bsd/libpcap/dist/grammar.y U src/external/bsd/libpcap/dist/pcap-linktype.manmisc.in U src/external/bsd/libpcap/dist/pcap_inject.3pcap U src/external/bsd/libpcap/dist/README.Win32 C src/external/bsd/libpcap/dist/optimize.c U src/external/bsd/libpcap/dist/pcap-int.h C src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in U src/external/bsd/libpcap/dist/fad-null.c C src/external/bsd/libpcap/dist/pcap.h N src/external/bsd/libpcap/dist/pcap-netfilter-linux.c U src/external/bsd/libpcap/dist/pcap_lookupnet.3pcap U src/external/bsd/libpcap/dist/pcap_geterr.3pcap U src/external/bsd/libpcap/dist/pcap-win32.c U src/external/bsd/libpcap/dist/pcap-snf.h U src/external/bsd/libpcap/dist/pcap_is_swapped.3pcap U src/external/bsd/libpcap/dist/pcap_next_ex.3pcap U src/external/bsd/libpcap/dist/pcap-snoop.c U src/external/bsd/libpcap/dist/pcap-usb-linux.h U src/external/bsd/libpcap/dist/dlpisubs.c C src/external/bsd/libpcap/dist/pcap-namedb.h U src/external/bsd/libpcap/dist/pcap_datalink.3pcap.in C src/external/bsd/libpcap/dist/pcap-config.1 U src/external/bsd/libpcap/dist/pcap-septel.h U src/external/bsd/libpcap/dist/sf-pcap.h U src/external/bsd/libpcap/dist/pcap-nit.c U src/external/bsd/libpcap/dist/pcap_file.3pcap U src/external/bsd/libpcap/dist/pcap-dos.c N src/external/bsd/libpcap/dist/pcap-canusb-linux.c U src/external/bsd/libpcap/dist/README.dag U src/external/bsd/libpcap/dist/llc.h U src/external/bsd/libpcap/dist/pcap-common.h N src/external/bsd/libpcap/dist/pcap-tstamp.manmisc.in U src/external/bsd/libpcap/dist/pcap_major_version.3pcap U src/external/bsd/libpcap/dist/chmod_bpf U src/external/bsd/libpcap/dist/pcap-snit.c U src/external/bsd/libpcap/dist/pcap_set_timeout.3pcap U src/external/bsd/libpcap/dist/pcap_open_live.3pcap U src/external/bsd/libpcap/dist/pcap_offline_filter.3pcap U src/external/bsd/libpcap/dist/pcap_setfilter.3pcap U src/external/bsd/libpcap/dist/runlex.sh U src/external/bsd/libpcap/dist/nametoaddr.c U src/external/bsd/libpcap/dist/pcap_set_buffer_size.3pcap U src/external/bsd/libpcap/dist/pcap_statustostr.3pcap U src/external/bsd/libpcap/dist/dlpisubs.h U src/external/bsd/libpcap/dist/pcap-septel.c U src/external/bsd/libpcap/dist/pcap_dump_close.3pcap U src/external/bsd/libpcap/dist/sunatmpos.h U src/external/bsd/libpcap/dist/bpf_dump.c U src/external/bsd/libpcap/dist/VERSION U src/external/bsd/libpcap/dist/INSTALL.txt U src/external/bsd/libpcap/dist/TODO U src/external/bsd/libpcap/dist/pcap_get_selectable_fd.3pcap U src/external/bsd/libpcap/dist/pcap_lookupdev.3pcap U src/external/bsd/libpcap/dist/pcap_dump_ftell.3pcap U src/external/bsd/libpcap/dist/pcap-bt-linux.c U src/external/bsd/libpcap/dist/pcap-stdinc.h U src/external/bsd/libpcap/dist/README.hpux U src/external/bsd/libpcap/dist/org.tcpdump.chmod_bpf.plist U src/external/bsd/libpcap/dist/pcap_open_dead.3pcap.in U src/external/bsd/libpcap/dist/pcap_findalldevs.3pcap U src/external/bsd/libpcap/dist/pcap_close.3pcap U src/external/bsd/libpcap/dist/aclocal.m4 N src/external/bsd/libpcap/dist/pcap_tstamp_type_name_to_val.3pcap U src/external/bsd/libpcap/dist/pcap_dump_file.3pcap U src/external/bsd/libpcap/dist/fad-win32.c U src/external/bsd/libpcap/dist/pcap-common.c U src/external/bsd/libpcap/dist/inet.c U src/external/bsd/libpcap/dist/pcap-savefile.manfile.in N
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sat Apr 6 17:50:33 UTC 2013 Removed Files: src/external/bsd/libpcap/dist: libpcap2netbsd Log Message: moved script out To generate a diff of this commit: cvs rdiff -u -r1.2 -r0 src/external/bsd/libpcap/dist/libpcap2netbsd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: joerg Date: Fri Sep 16 16:09:25 UTC 2011 Modified Files: src/external/bsd/libpcap/dist: gencode.c grammar.y Log Message: Use __dead To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libpcap/dist/gencode.c cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libpcap/dist/grammar.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/gencode.c diff -u src/external/bsd/libpcap/dist/gencode.c:1.2 src/external/bsd/libpcap/dist/gencode.c:1.3 --- src/external/bsd/libpcap/dist/gencode.c:1.2 Sun Dec 5 01:45:46 2010 +++ src/external/bsd/libpcap/dist/gencode.c Fri Sep 16 16:09:25 2011 @@ -378,8 +378,8 @@ return b; } -static inline void -syntax() +__dead static inline void +syntax(void) { bpf_error(syntax error in filter expression); } Index: src/external/bsd/libpcap/dist/grammar.y diff -u src/external/bsd/libpcap/dist/grammar.y:1.1.1.2 src/external/bsd/libpcap/dist/grammar.y:1.2 --- src/external/bsd/libpcap/dist/grammar.y:1.1.1.2 Sun Dec 5 01:27:06 2010 +++ src/external/bsd/libpcap/dist/grammar.y Fri Sep 16 16:09:25 2011 @@ -159,7 +159,7 @@ static struct qual qerr = { Q_UNDEF, Q_UNDEF, Q_UNDEF, Q_UNDEF }; -static void +__dead static void yyerror(const char *msg) { ++n_errors;
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Aug 21 08:45:20 UTC 2011 Modified Files: src/external/bsd/libpcap/dist: optimize.c Log Message: use static const char[] for format. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libpcap/dist/optimize.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/optimize.c diff -u src/external/bsd/libpcap/dist/optimize.c:1.3 src/external/bsd/libpcap/dist/optimize.c:1.4 --- src/external/bsd/libpcap/dist/optimize.c:1.3 Tue Aug 16 06:34:22 2011 +++ src/external/bsd/libpcap/dist/optimize.c Sun Aug 21 04:45:20 2011 @@ -2153,7 +2153,7 @@ { u_int i; int jt, jf; -#define ljerr %s for block-local relative jump: off=%d +static const char ljerr[] = %s for block-local relative jump: off=%d; #if 0 printf(code=%x off=%d %x %x\n, src-s.code,
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: mrg Date: Tue Jun 21 09:34:55 UTC 2011 Modified Files: src/external/bsd/libpcap/dist: scanner.l Log Message: this needs %option noinput. thanks to martin. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libpcap/dist/scanner.l Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/scanner.l diff -u src/external/bsd/libpcap/dist/scanner.l:1.2 src/external/bsd/libpcap/dist/scanner.l:1.3 --- src/external/bsd/libpcap/dist/scanner.l:1.2 Sun Dec 5 01:45:46 2010 +++ src/external/bsd/libpcap/dist/scanner.l Tue Jun 21 09:34:54 2011 @@ -185,6 +185,7 @@ %option nounput +%option noinput %% dst return DST;
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: wiz Date: Thu Mar 10 17:11:17 UTC 2011 Modified Files: src/external/bsd/libpcap/dist: pcap.3pcap.in pcap_dump_open.3pcap.in pcap_open_offline.3pcap.in Log Message: It's tcpdump(8), not (1). From Anon Ymous. To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libpcap/dist/pcap.3pcap.in \ src/external/bsd/libpcap/dist/pcap_dump_open.3pcap.in \ src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap.3pcap.in diff -u src/external/bsd/libpcap/dist/pcap.3pcap.in:1.1.1.2 src/external/bsd/libpcap/dist/pcap.3pcap.in:1.2 --- src/external/bsd/libpcap/dist/pcap.3pcap.in:1.1.1.2 Sun Dec 5 01:27:19 2010 +++ src/external/bsd/libpcap/dist/pcap.3pcap.in Thu Mar 10 17:11:17 2011 @@ -363,7 +363,7 @@ script or some other configuration script to check whether the libpcap 1.0 APIs are available and use them only if they are. .SH SEE ALSO -autoconf(1), tcpdump(1), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8), +autoconf(1), tcpdump(8), tcpslice(1), pcap-filter(@MAN_MISC_INFO@), pfconfig(8), usermod(1M) .SH AUTHORS The original authors of libpcap are: Index: src/external/bsd/libpcap/dist/pcap_dump_open.3pcap.in diff -u src/external/bsd/libpcap/dist/pcap_dump_open.3pcap.in:1.1.1.2 src/external/bsd/libpcap/dist/pcap_dump_open.3pcap.in:1.2 --- src/external/bsd/libpcap/dist/pcap_dump_open.3pcap.in:1.1.1.2 Sun Dec 5 01:27:21 2010 +++ src/external/bsd/libpcap/dist/pcap_dump_open.3pcap.in Thu Mar 10 17:11:17 2011 @@ -40,7 +40,7 @@ .I fname specifies the name of the file to open. The file will have the same format as those used by -.BR tcpdump (1) +.BR tcpdump (8) and .BR tcpslice (1). The name - in a synonym Index: src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in diff -u src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in:1.1.1.2 src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in:1.2 --- src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in:1.1.1.2 Sun Dec 5 01:27:22 2010 +++ src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in Thu Mar 10 17:11:17 2011 @@ -47,7 +47,7 @@ format as described in .BR pcap-savefile (@MAN_FILE_FORMATS@), which is the file format used by, among other programs, -.BR tcpdump (1) +.BR tcpdump (8) and .BR tcpslice (1), or can have the pcap-ng file format, although not all pcap-ng files can
CVS commit: src/external/bsd/libpcap/dist/bpf/net
Module Name:src Committed By: christos Date: Mon Dec 6 01:08:03 UTC 2010 Modified Files: src/external/bsd/libpcap/dist/bpf/net: bpf_filter.c Log Message: propagate the fixes from /usr/src/sys/net/bpf_filter.c here, so that we don't merge backwards again. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c diff -u src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c:1.2 src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c:1.3 --- src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c:1.2 Sat Dec 4 22:02:41 2010 +++ src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c Sun Dec 5 20:08:02 2010 @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors *may be used to endorse or promote products derived from this software *without specific prior written permission. * @@ -35,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)bpf.c 7.5 (Berkeley) 7/15/91 + * @(#)bpf_filter.c 8.1 (Berkeley) 6/10/93 */ #if !(defined(lint) || defined(KERNEL) || defined(_KERNEL)) @@ -138,15 +134,17 @@ } \ } +static int m_xword (const struct mbuf *, uint32_t, int *); +static int m_xhalf (const struct mbuf *, uint32_t, int *); + static int -m_xword(m, k, err) - register struct mbuf *m; - register int k, *err; +m_xword(const struct mbuf *m, uint32_t k, int *err) { - register int len; - register u_char *cp, *np; - register struct mbuf *m0; + int len; + u_char *cp, *np; + struct mbuf *m0; + *err = 1; MINDEX(len, m, k); cp = mtod(m, u_char *) + k; if (len - k = 4) { @@ -155,7 +153,7 @@ } m0 = m-m_next; if (m0 == 0 || MLEN(m0) + len - k 4) - goto bad; + return 0; *err = 0; np = mtod(m0, u_char *); switch (len - k) { @@ -169,20 +167,16 @@ default: return (cp[0] 24) | (cp[1] 16) | (cp[2] 8) | np[0]; } -bad: - *err = 1; - return 0; } static int -m_xhalf(m, k, err) - register struct mbuf *m; - register int k, *err; +m_xhalf(const struct mbuf *m, uint32_t k, int *err) { - register int len; - register u_char *cp; - register struct mbuf *m0; + int len; + u_char *cp; + struct mbuf *m0; + *err = 1; MINDEX(len, m, k); cp = mtod(m, u_char *) + k; if (len - k = 2) { @@ -191,12 +185,9 @@ } m0 = m-m_next; if (m0 == 0) - goto bad; + return 0; *err = 0; return (cp[0] 8) | mtod(m0, u_char *)[0]; - bad: - *err = 1; - return 0; } #endif @@ -208,14 +199,10 @@ * in all other cases, p is a pointer to a buffer and buflen is its size. */ u_int -bpf_filter(pc, p, wirelen, buflen) - register const struct bpf_insn *pc; - register const u_char *p; - u_int wirelen; - register u_int buflen; +bpf_filter(const struct bpf_insn *pc, const u_char *p, u_int wirelen, +u_int buflen) { - register u_int32 A, X; - register int k; + u_int32 A, X, k; int32 mem[BPF_MEMWORDS]; #if defined(KERNEL) || defined(_KERNEL) struct mbuf *m, *n; @@ -237,6 +224,7 @@ A = 0; X = 0; --pc; + /* CONSTCOND */ while (1) { ++pc; switch (pc-code) { @@ -533,13 +521,12 @@ * Otherwise, a bogus program could easily crash the system. */ int -bpf_validate(f, len) - const struct bpf_insn *f; - int len; +bpf_validate(const struct bpf_insn *f, int signed_len) { - u_int i, from; + u_int i, from, len; const struct bpf_insn *p; + len = (u_int)signed_len; if (len 1) return 0; /* @@ -550,7 +537,7 @@ return 0; #endif - for (i = 0; i (u_int)len; ++i) { + for (i = 0; i len; ++i) { p = f[i]; switch (BPF_CLASS(p-code)) { /* @@ -559,11 +546,7 @@ case BPF_LD: case BPF_LDX: switch (BPF_MODE(p-code)) { - case BPF_IMM: -break; - case BPF_ABS: - case BPF_IND: - case BPF_MSH: + case BPF_MEM: /* * There's no maximum packet data size * in userland. The runtime packet length @@ -574,10 +557,14 @@ * More strict check with actual packet length * is done runtime. */ -if (p-k = bpf_maxbufsize) +if (p-k = BPF_MEMWORDS) return 0; #endif break; + case BPF_ABS: + case BPF_IND: + case BPF_MSH: + case BPF_IMM: case BPF_MEM: if (p-k = BPF_MEMWORDS) return 0; @@ -608,7 +595,7 @@ /* *
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Dec 5 01:20:59 UTC 2010 Update of /cvsroot/src/external/bsd/libpcap/dist In directory ivanova.netbsd.org:/tmp/cvs-serv13553 Log Message: Import libpcap-1.1.1 Status: Vendor Tag: TCPDUMP Release Tags: libpcap-1_1_1 N src/external/bsd/libpcap/dist/pcap-dlpi.c N src/external/bsd/libpcap/dist/pcap_dump_ftell.3pcap N src/external/bsd/libpcap/dist/pcap-common.h N src/external/bsd/libpcap/dist/pcap_findalldevs.3pcap N src/external/bsd/libpcap/dist/pcap-snf.c N src/external/bsd/libpcap/dist/pcap-sita.html N src/external/bsd/libpcap/dist/pcap_dump.3pcap N src/external/bsd/libpcap/dist/README.Win32 N src/external/bsd/libpcap/dist/README.sita N src/external/bsd/libpcap/dist/pcap_stats.3pcap N src/external/bsd/libpcap/dist/README.linux N src/external/bsd/libpcap/dist/pcap_open_offline.3pcap.in N src/external/bsd/libpcap/dist/pcap_setdirection.3pcap N src/external/bsd/libpcap/dist/fad-win32.c N src/external/bsd/libpcap/dist/pcap-dos.c N src/external/bsd/libpcap/dist/gencode.c N src/external/bsd/libpcap/dist/LICENSE N src/external/bsd/libpcap/dist/pcap_set_promisc.3pcap N src/external/bsd/libpcap/dist/pcap-libdlpi.c N src/external/bsd/libpcap/dist/pcap-can-linux.h N src/external/bsd/libpcap/dist/fad-sita.c N src/external/bsd/libpcap/dist/nlpid.h N src/external/bsd/libpcap/dist/pcap-int.h N src/external/bsd/libpcap/dist/pcap.c N src/external/bsd/libpcap/dist/pcap_dump_file.3pcap N src/external/bsd/libpcap/dist/pcap-nit.c N src/external/bsd/libpcap/dist/pcap_create.3pcap N src/external/bsd/libpcap/dist/pcap_dump_close.3pcap N src/external/bsd/libpcap/dist/pcap_is_swapped.3pcap N src/external/bsd/libpcap/dist/config.h.in N src/external/bsd/libpcap/dist/pcap_freealldevs.3pcap N src/external/bsd/libpcap/dist/pcap_file.3pcap N src/external/bsd/libpcap/dist/bpf_image.c N src/external/bsd/libpcap/dist/gencode.h N src/external/bsd/libpcap/dist/pcap_freecode.3pcap N src/external/bsd/libpcap/dist/pcap_inject.3pcap N src/external/bsd/libpcap/dist/sf-pcap.h N src/external/bsd/libpcap/dist/grammar.y N src/external/bsd/libpcap/dist/config.sub N src/external/bsd/libpcap/dist/pcap_set_snaplen.3pcap N src/external/bsd/libpcap/dist/pcap_get_selectable_fd.3pcap N src/external/bsd/libpcap/dist/pcap-snf.h N src/external/bsd/libpcap/dist/pcap-filter.manmisc.in N src/external/bsd/libpcap/dist/pcap-savefile.manfile.in N src/external/bsd/libpcap/dist/scanner.l N src/external/bsd/libpcap/dist/README.septel N src/external/bsd/libpcap/dist/dlpisubs.h N src/external/bsd/libpcap/dist/fad-getad.c N src/external/bsd/libpcap/dist/sf-pcap-ng.h N src/external/bsd/libpcap/dist/pcap-bt-linux.h N src/external/bsd/libpcap/dist/pcap_setnonblock.3pcap N src/external/bsd/libpcap/dist/pcap_close.3pcap N src/external/bsd/libpcap/dist/pcap_geterr.3pcap N src/external/bsd/libpcap/dist/pcap_breakloop.3pcap N src/external/bsd/libpcap/dist/pcap.h N src/external/bsd/libpcap/dist/CHANGES N src/external/bsd/libpcap/dist/pcap-usb-linux.c N src/external/bsd/libpcap/dist/pcap-dag.c N src/external/bsd/libpcap/dist/pcap-sita.h N src/external/bsd/libpcap/dist/chmod_bpf N src/external/bsd/libpcap/dist/Makefile.in N src/external/bsd/libpcap/dist/opentest.c N src/external/bsd/libpcap/dist/pcap_statustostr.3pcap N src/external/bsd/libpcap/dist/pcap_next_ex.3pcap N src/external/bsd/libpcap/dist/pcap_free_datalinks.3pcap N src/external/bsd/libpcap/dist/nametoaddr.c N src/external/bsd/libpcap/dist/ppp.h N src/external/bsd/libpcap/dist/README.dag N src/external/bsd/libpcap/dist/TODO N src/external/bsd/libpcap/dist/pcap_activate.3pcap N src/external/bsd/libpcap/dist/runlex.sh N src/external/bsd/libpcap/dist/mkdep N src/external/bsd/libpcap/dist/pcap_datalink_name_to_val.3pcap N src/external/bsd/libpcap/dist/pcap_set_buffer_size.3pcap N src/external/bsd/libpcap/dist/pcap-dag.h N src/external/bsd/libpcap/dist/pcap-snoop.c N src/external/bsd/libpcap/dist/fad-null.c N src/external/bsd/libpcap/dist/README.hpux N src/external/bsd/libpcap/dist/README N src/external/bsd/libpcap/dist/pcap_compile.3pcap.in N src/external/bsd/libpcap/dist/findalldevstest.c N src/external/bsd/libpcap/dist/etherent.c N src/external/bsd/libpcap/dist/pcap-namedb.h N src/external/bsd/libpcap/dist/aclocal.m4 N src/external/bsd/libpcap/dist/pcap_strerror.3pcap N src/external/bsd/libpcap/dist/pcap-config.in N src/external/bsd/libpcap/dist/pcap-dos.h N src/external/bsd/libpcap/dist/pcap-bt-linux.c N src/external/bsd/libpcap/dist/pcap-null.c N src/external/bsd/libpcap/dist/configure N src/external/bsd/libpcap/dist/pcap-bpf.c N src/external/bsd/libpcap/dist/sf-pcap-ng.c N src/external/bsd/libpcap/dist/fad-glifc.c N src/external/bsd/libpcap/dist/filtertest.c N src/external/bsd/libpcap/dist/llc.h N src/external/bsd/libpcap/dist/pcap_lookupnet.3pcap N src/external/bsd/libpcap/dist/pcap_setfilter.3pcap N src/external/bsd/libpcap/dist/pcap-sita.c N src/external/bsd/libpcap/dist/sunatmpos.h N
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Dec 5 01:27:35 UTC 2010 Update of /cvsroot/src/external/bsd/libpcap/dist In directory ivanova.netbsd.org:/tmp/cvs-serv29503 Log Message: try again fixing RCS keywords Status: Vendor Tag: TCPDUMP Release Tags: libpcap-1_1_1 U src/external/bsd/libpcap/dist/CHANGES U src/external/bsd/libpcap/dist/CREDITS U src/external/bsd/libpcap/dist/README.macosx U src/external/bsd/libpcap/dist/INSTALL.txt U src/external/bsd/libpcap/dist/LICENSE U src/external/bsd/libpcap/dist/Makefile.in U src/external/bsd/libpcap/dist/README U src/external/bsd/libpcap/dist/README.Win32 U src/external/bsd/libpcap/dist/README.aix U src/external/bsd/libpcap/dist/README.dag U src/external/bsd/libpcap/dist/README.hpux U src/external/bsd/libpcap/dist/README.linux U src/external/bsd/libpcap/dist/TODO U src/external/bsd/libpcap/dist/README.septel U src/external/bsd/libpcap/dist/README.sita U src/external/bsd/libpcap/dist/README.tru64 U src/external/bsd/libpcap/dist/VERSION U src/external/bsd/libpcap/dist/aclocal.m4 U src/external/bsd/libpcap/dist/arcnet.h U src/external/bsd/libpcap/dist/atmuni31.h U src/external/bsd/libpcap/dist/findalldevstest.c U src/external/bsd/libpcap/dist/bpf_dump.c U src/external/bsd/libpcap/dist/bpf_image.c U src/external/bsd/libpcap/dist/chmod_bpf U src/external/bsd/libpcap/dist/config.guess U src/external/bsd/libpcap/dist/config.h.in U src/external/bsd/libpcap/dist/config.sub U src/external/bsd/libpcap/dist/configure U src/external/bsd/libpcap/dist/configure.in U src/external/bsd/libpcap/dist/dlpisubs.c U src/external/bsd/libpcap/dist/dlpisubs.h U src/external/bsd/libpcap/dist/etherent.c U src/external/bsd/libpcap/dist/ethertype.h U src/external/bsd/libpcap/dist/fad-getad.c U src/external/bsd/libpcap/dist/fad-gifc.c U src/external/bsd/libpcap/dist/fad-glifc.c U src/external/bsd/libpcap/dist/fad-null.c U src/external/bsd/libpcap/dist/fad-sita.c U src/external/bsd/libpcap/dist/fad-win32.c U src/external/bsd/libpcap/dist/filtertest.c U src/external/bsd/libpcap/dist/install-sh U src/external/bsd/libpcap/dist/gencode.c U src/external/bsd/libpcap/dist/gencode.h U src/external/bsd/libpcap/dist/grammar.y U src/external/bsd/libpcap/dist/ieee80211.h U src/external/bsd/libpcap/dist/inet.c U src/external/bsd/libpcap/dist/mkdep U src/external/bsd/libpcap/dist/llc.h U src/external/bsd/libpcap/dist/nametoaddr.c U src/external/bsd/libpcap/dist/nlpid.h U src/external/bsd/libpcap/dist/opentest.c U src/external/bsd/libpcap/dist/optimize.c U src/external/bsd/libpcap/dist/pcap-bt-linux.c U src/external/bsd/libpcap/dist/org.tcpdump.chmod_bpf.plist U src/external/bsd/libpcap/dist/pcap-bpf.c U src/external/bsd/libpcap/dist/pcap-bpf.h U src/external/bsd/libpcap/dist/pcap-filter.manmisc.in U src/external/bsd/libpcap/dist/pcap-bt-linux.h U src/external/bsd/libpcap/dist/pcap-can-linux.c U src/external/bsd/libpcap/dist/pcap-can-linux.h U src/external/bsd/libpcap/dist/pcap-common.c U src/external/bsd/libpcap/dist/pcap-common.h U src/external/bsd/libpcap/dist/pcap-config.1 U src/external/bsd/libpcap/dist/pcap-config.in U src/external/bsd/libpcap/dist/pcap-dag.c U src/external/bsd/libpcap/dist/pcap-dag.h U src/external/bsd/libpcap/dist/pcap-dlpi.c U src/external/bsd/libpcap/dist/pcap-dos.c U src/external/bsd/libpcap/dist/pcap-dos.h U src/external/bsd/libpcap/dist/pcap-enet.c U src/external/bsd/libpcap/dist/pcap-libdlpi.c U src/external/bsd/libpcap/dist/pcap-int.h U src/external/bsd/libpcap/dist/pcap_activate.3pcap U src/external/bsd/libpcap/dist/pcap-linktype.manmisc.in U src/external/bsd/libpcap/dist/pcap-linux.c U src/external/bsd/libpcap/dist/pcap-namedb.h U src/external/bsd/libpcap/dist/pcap-nit.c U src/external/bsd/libpcap/dist/pcap-null.c U src/external/bsd/libpcap/dist/pcap-pf.c U src/external/bsd/libpcap/dist/pcap-savefile.manfile.in U src/external/bsd/libpcap/dist/pcap-septel.c U src/external/bsd/libpcap/dist/pcap-septel.h U src/external/bsd/libpcap/dist/pcap-sita.c U src/external/bsd/libpcap/dist/pcap-sita.h U src/external/bsd/libpcap/dist/pcap-sita.html U src/external/bsd/libpcap/dist/pcap-snf.c U src/external/bsd/libpcap/dist/pcap-snf.h U src/external/bsd/libpcap/dist/pcap-snit.c U src/external/bsd/libpcap/dist/pcap-snoop.c U src/external/bsd/libpcap/dist/pcap-stdinc.h U src/external/bsd/libpcap/dist/pcap-usb-linux.c U src/external/bsd/libpcap/dist/pcap-usb-linux.h U src/external/bsd/libpcap/dist/pcap-win32.c U src/external/bsd/libpcap/dist/pcap.3pcap.in U src/external/bsd/libpcap/dist/pcap.c U src/external/bsd/libpcap/dist/pcap.h U src/external/bsd/libpcap/dist/pcap_can_set_rfmon.3pcap U src/external/bsd/libpcap/dist/pcap_breakloop.3pcap U src/external/bsd/libpcap/dist/pcap_compile.3pcap.in U src/external/bsd/libpcap/dist/pcap_close.3pcap U src/external/bsd/libpcap/dist/pcap_datalink.3pcap.in U src/external/bsd/libpcap/dist/pcap_create.3pcap U src/external/bsd/libpcap/dist/pcap_dump_close.3pcap U src/external/bsd/libpcap/dist/pcap_dump.3pcap U
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Dec 5 01:28:28 UTC 2010 Added Files: src/external/bsd/libpcap/dist: libpcap2netbsd Log Message: add rcs keyword cleaner To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/bsd/libpcap/dist/libpcap2netbsd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/bsd/libpcap/dist/libpcap2netbsd diff -u /dev/null src/external/bsd/libpcap/dist/libpcap2netbsd:1.1 --- /dev/null Sat Dec 4 20:28:28 2010 +++ src/external/bsd/libpcap/dist/libpcap2netbsd Sat Dec 4 20:28:28 2010 @@ -0,0 +1,102 @@ +#! /bin/sh +# +# $NetBSD: libpcap2netbsd,v 1.1 2010/12/05 01:28:28 christos Exp $ +# +# Copyright (c) 2000 The NetBSD Foundation, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +#notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +#notice, this list of conditions and the following disclaimer in the +#documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# amd2netbsd: convert an amd source tree into a +# netbsd amd source tree, under src/dist, +# based on bind2netbsd by Bernd Ernesti and changes by Simon Burge +# +# Rough instructions for importing new amd release: +# +# $ cd /some/where/temporary +# $ tar xpfz /new/amd/release/tar/file +# $ sh /usr/src/external/bsd/libpcap/dist/libpcap2netbsd libpcap-1.1.1 `pwd` +# $ cd src/dist/am-utils +# $ cvs -d cvs.netbsd.org:/cvsroot import -m Import libpcap 1.1.1 src/external/bsd/libpcap/dist TCPDUMP libpcap-1_1_1 +# $ cd ../../../libpcap-1.1.1 +# $ run ./configure +# copy newly generated config.h with /usr/src/external/bsd/libpcap/include/config.h +# - check makefiles to see if any extra sources have been added. +# - update distrib/sets if necessary. + +if [ $# -ne 2 ]; then echo libpcap2netbsd src dest; exit 1; fi + +r=$1 +d=$2/src/external/bsd/libpcap/dist + +case $d in + /*) + ;; + *) + d=`/bin/pwd`/$d + ;; +esac + +case $r in + /*) + ;; + *) + r=`/bin/pwd`/$r + ;; +esac + +echo preparing directory $d +rm -rf $d +mkdir -p $d + +### Copy the files and directories +echo copying $r to $d +cd $r +pax -rw * $d + +### Remove the $'s around RCS tags +find $d -type f -print | xargs egrep -l '\$(Id|Created|Header)' | while read f; do + sed -e 's/\$\(Id.*\) \$/\1/' \ + -e 's/\$\(Created.*\) \$/\1/' \ + -e 's/\$\(Header.*\) \$/\1/' \ + $f /tmp/amd1f$$ mv /tmp/amd1f$$ $f \ + echo removed \$RCS tag from $f +done + +### Clean up any CVS directories that might be around. +echo cleaning up CVS residue. +( + cd $d + find . -type d -name CVS -print | xargs rm -r +) +echo done + +### Fixing file and directory permissions. +echo Fixing file/directory permissions. +( + cd $d + find . -type f -print | xargs chmod u+rw,go+r + find . -type d -print | xargs chmod u+rwx,go+rx +) +echo done + +exit 0
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Dec 5 03:01:40 UTC 2010 Modified Files: src/external/bsd/libpcap/dist: pcap-config.in Log Message: don't print -L/usr/lib and -I/usr/include for no reason. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libpcap/dist/pcap-config.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-config.in diff -u src/external/bsd/libpcap/dist/pcap-config.in:1.1.1.1 src/external/bsd/libpcap/dist/pcap-config.in:1.2 --- src/external/bsd/libpcap/dist/pcap-config.in:1.1.1.1 Sat Dec 4 20:20:34 2010 +++ src/external/bsd/libpcap/dist/pcap-config.in Sat Dec 4 22:01:39 2010 @@ -39,6 +39,19 @@ rpa...@v_rpath_opt@@libdir@ fi fi +if [ @includedir@ != /usr/include ] +then + i=-...@includedir@ +fi +if [ @libdir@ != /usr/lib ] +then + l=-...@libdir@ +fi +if [ -n @LIBS@ ] +then + L=@LIBS@ +fi + if [ $static = 1 ] then # @@ -47,19 +60,19 @@ # if [ $show_cflags = 1 -a $show_libs = 1 ] then - echo -...@includedir@ -...@libdir@ -lpcap @LIBS@ + echo $i $l -lpcap $L elif [ $show_cflags = 1 -a $show_additional_libs = 1 ] then - echo -...@includedir@ -...@libdir@ @LIBS@ + echo $i $l $L elif [ $show_cflags = 1 ] then - echo -...@includedir@ + echo $i elif [ $show_libs = 1 ] then - echo -...@libdir@ -lpcap @LIBS@ + echo $l -lpcap $L elif [ $show_additional_libs = 1 ] then - echo @LIBS@ + echo $L fi else # @@ -68,15 +81,15 @@ # if [ $show_cflags = 1 -a $show_libs = 1 ] then - echo -...@includedir@ -...@libdir@ $RPATH -lpcap + echo $l $RPATH -lpcap elif [ $show_cflags = 1 -a $show_additional_libs = 1 ] then - echo -...@includedir@ + echo $i elif [ $show_cflags = 1 ] then - echo -...@includedir@ + echo $i elif [ $show_libs = 1 ] then - echo -...@libdir@ $RPATH -lpcap + echo $l $RPATH -lpcap fi fi
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Dec 5 03:02:42 UTC 2010 Modified Files: src/external/bsd/libpcap/dist: sf-pcap-ng.c sf-pcap.c src/external/bsd/libpcap/dist/bpf/net: bpf_filter.c Log Message: more sign-compare fixes. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/libpcap/dist/sf-pcap-ng.c \ src/external/bsd/libpcap/dist/sf-pcap.c cvs rdiff -u -r1.1.1.2 -r1.2 \ src/external/bsd/libpcap/dist/bpf/net/bpf_filter.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/sf-pcap-ng.c diff -u src/external/bsd/libpcap/dist/sf-pcap-ng.c:1.1.1.1 src/external/bsd/libpcap/dist/sf-pcap-ng.c:1.2 --- src/external/bsd/libpcap/dist/sf-pcap-ng.c:1.1.1.1 Sat Dec 4 20:20:42 2010 +++ src/external/bsd/libpcap/dist/sf-pcap-ng.c Sat Dec 4 22:02:41 2010 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] _U_ = -@(#) $Header: /cvsroot/src/external/bsd/libpcap/dist/sf-pcap-ng.c,v 1.1.1.1 2010/12/05 01:20:42 christos Exp $ (LBL); +@(#) $Header: /cvsroot/src/external/bsd/libpcap/dist/sf-pcap-ng.c,v 1.2 2010/12/05 03:02:41 christos Exp $ (LBL); #endif #ifdef HAVE_CONFIG_H @@ -274,7 +274,7 @@ /* * Is the buffer big enough? */ - if (p-bufsize bhdr.total_length) { + if (p-bufsize (int)bhdr.total_length) { /* * No - make it big enough. */ @@ -348,7 +348,7 @@ */ if (p-sf.swapped) { opthdr-option_code = SWAPSHORT(opthdr-option_code); - opthdr-option_length = SWAPSHORT(opthdr-option_length); + opthdr-option_length = SWAPSHORT((uint32_t)opthdr-option_length); } return (opthdr); @@ -482,7 +482,7 @@ saw_tsoffset = 1; memcpy(tsoffset, optvalue, sizeof(*tsoffset)); if (p-sf.swapped) -*tsoffset = SWAPLL(*tsoffset); +*tsoffset = (uint64_t)SWAPLL(*tsoffset); break; default: @@ -604,7 +604,7 @@ * If we find a bigger block, we reallocate the buffer. */ p-bufsize = 2048; - if (p-bufsize total_length) + if (p-bufsize (int)total_length) p-bufsize = total_length; p-buffer = malloc(p-bufsize); if (p-buffer == NULL) { @@ -616,8 +616,8 @@ * Copy the stuff we've read to the buffer, and read the rest * of the SHB. */ - bhdrp = (struct block_header *)p-buffer; - shbp = (struct section_header_block *)(p-buffer + sizeof(struct block_header)); + bhdrp = (struct block_header *)(void *)p-buffer; + shbp = (struct section_header_block *)(void *)(p-buffer + sizeof(struct block_header)); bhdrp-block_type = magic; bhdrp-total_length = total_length; shbp-byte_order_magic = byte_order_magic; @@ -631,8 +631,8 @@ /* * Byte-swap the fields we've read. */ - shbp-major_version = SWAPSHORT(shbp-major_version); - shbp-minor_version = SWAPSHORT(shbp-minor_version); + shbp-major_version = SWAPSHORT((uint32_t)shbp-major_version); + shbp-minor_version = SWAPSHORT((uint32_t)shbp-minor_version); /* * XXX - we don't care about the section length. @@ -686,7 +686,7 @@ * Byte-swap it if necessary. */ if (p-sf.swapped) { -idbp-linktype = SWAPSHORT(idbp-linktype); +idbp-linktype = SWAPSHORT((uint16_t)idbp-linktype); idbp-snaplen = SWAPLONG(idbp-snaplen); } @@ -823,7 +823,6 @@ t = ((u_int64_t)epbp-timestamp_high) 32 | epbp-timestamp_low; } - pblock_len = sizeof(*epbp); goto found; case BT_SPB: @@ -857,7 +856,7 @@ * and the packet length. */ hdr-caplen = hdr-len; - if (hdr-caplen p-snapshot) + if ((int)hdr-caplen p-snapshot) hdr-caplen = p-snapshot; t = 0; /* no time stamps */ pblock_len = sizeof(*spbp); @@ -878,7 +877,7 @@ */ if (p-sf.swapped) { /* these were written in opposite byte order */ -interface_id = SWAPSHORT(pbp-interface_id); +interface_id = SWAPSHORT((uint32_t)pbp-interface_id); hdr-caplen = SWAPLONG(pbp-caplen); hdr-len = SWAPLONG(pbp-len); t = ((u_int64_t)SWAPLONG(pbp-timestamp_high)) 32 | @@ -907,7 +906,7 @@ * Byte-swap it if necessary. */ if (p-sf.swapped) { -idbp-linktype = SWAPSHORT(idbp-linktype); +idbp-linktype = SWAPSHORT((uint32_t)idbp-linktype); idbp-snaplen = SWAPLONG(idbp-snaplen); } @@ -925,7 +924,7 @@ idbp-linktype); return (-1); } - if (p-snapshot != idbp-snaplen) { + if (p-snapshot != (int)idbp-snaplen) { snprintf(p-errbuf, PCAP_ERRBUF_SIZE, an interface has a snapshot length %u different from the type of the first interface, idbp-snaplen); @@ -985,7 +984,7 @@ shbp-byte_order_magic = SWAPLONG(shbp-byte_order_magic); shbp-major_version = -SWAPSHORT(shbp-major_version); +SWAPSHORT((uint32_t)shbp-major_version); } /* @@ -1082,7 +1081,7 @@ frac *= p-sf.tsscale; } hdr-ts.tv_sec = sec; - hdr-ts.tv_usec = frac; + hdr-ts.tv_usec = (suseconds_t)frac; /* * Get
CVS commit: src/external/bsd/libpcap/dist
Module Name:src Committed By: christos Date: Sun Dec 5 05:40:15 UTC 2010 Modified Files: src/external/bsd/libpcap/dist: pcap-config.1 Log Message: we don't have a 3PCAP section To generate a diff of this commit: cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/libpcap/dist/pcap-config.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/libpcap/dist/pcap-config.1 diff -u src/external/bsd/libpcap/dist/pcap-config.1:1.1.1.2 src/external/bsd/libpcap/dist/pcap-config.1:1.2 --- src/external/bsd/libpcap/dist/pcap-config.1:1.1.1.2 Sat Dec 4 20:27:11 2010 +++ src/external/bsd/libpcap/dist/pcap-config.1 Sun Dec 5 00:40:14 2010 @@ -71,4 +71,4 @@ flag causes it to write flags appropriate for compiling with a statically-linked version of libpcap. .SH SEE ALSO -pcap(3PCAP) +pcap(3)