Re: [tcpdump-workers] WinDump fails to compile on latest libpcap

2016-10-06 Thread Gisle Vanem
Yang Luo wrote: > Given that WinDump is kind of "official" example to use libpcap/Npcap API, > it's not good that they can't compile. Why do you say that? IMHO, tcpdump/WinDump at: https://github.com/the-tcpdump-group/tcpdump.git is the "official". Works fine for me on Windows. Have you tried

[tcpdump-workers] parse_elements() in print-802_11.c

2014-04-14 Thread Gisle Vanem
The use of function parse_elements() in print-802_11.c looks a bit fishy. E.g. in handle_beacon(): ret = parse_elements(ndo, pbody, p, offset, length); PRINT_SSID(pbody); PRINT_RATES(pbody); Here parse_elements() has set 'pbody.ssid' to a local (on stack) SSID in it's 'struct ssid_t ssid':

[tcpdump-workers] errno.h in the Win32 version

2014-04-04 Thread Gisle Vanem
I note that a local Win32/include/errno.h is shadowing for the real errno.h which is not nice. And shouldn't sys-headers come first in missing/inet_pton.c? #include tcpdump-stdinc.h #include errno.h Since MSVC's errno.h has a 'EAFNOSUPPORT', but MingW+Watcom does not, I think it's cleaner

Re: [tcpdump-workers] print-ahcp.c on MSVC

2014-04-02 Thread Gisle Vanem
Gisle Vanem gva...@yahoo.no wrote: I'm sure my old MSVC v16 has a bit stupid C-preprocessor. At least when expanding this (line 153): Now this C-preprocessor bug got me into problems with print-olsr.c too. A patch: --- Git-Latest/print-olsr.c 2014-04-02 17:02:01 + +++ print-olsr.c

[tcpdump-workers] print-ahcp.c on MSVC

2014-03-11 Thread Gisle Vanem
I'm sure my old MSVC v16 has a bit stupid C-preprocessor. At least when expanding this (line 153): ND_PRINT((ndo, %s%s, sep, #ifdef INET6 ip6addr_string(cp) #else (compiled w/o IPv6) #endif /* INET6 */ into this (all on one line): (*ndo-ndo_printf)(ndo, %s%s, sep,

[tcpdump-workers] [Patch] print-zeromq.c

2014-03-04 Thread Gisle Vanem
The prototype and implementation of 'zmtp1_print_datagram()' is slightly different; the prototype has a 'const u_int len' as the last parameter. Whereas the implementation has no 'const'. Hence I get a warning from MSVC. Hence: diff -u3 Git-Latest/print-zeromq.c ./print-zeromq.c ---

Re: [tcpdump-workers] [Patch] print-zeromq.c

2014-03-04 Thread Gisle Vanem
François-Xavier Le Bail fx.leb...@yahoo.com wrote: Is it not better to add const in the propotype ? Comparing to other print-function with a 'len' as last parameter, I think not. Looking through interface.h for *_print() functions, only these have a 'const u_int' as last arg: openflow_print,

[tcpdump-workers] print-rx.c time format

2014-02-13 Thread Gisle Vanem
Building windump using MingW + gcc 4.7.2, I get: print-rx.c: In function 'fs_print': print-rx.c:929:4: warning: unknown conversion type character 'T' in format [-Wformat] print-rx.c:933:4: warning: unknown conversion type character 'T' in format [-Wformat] This comes from the macro

Re: [tcpdump-workers] RCS/CVS keywords ($Id$, $Header$, $OpenBSD$ etc)

2014-01-02 Thread Gisle Vanem
Guy Harris guy at alum.mit.edu writes: The tcpdump/libpcap RCS/CVS IDs serve no purpose now that libpcap and tcpdump are kept in Git, as far as I can see. Then you (or someone else) can change the WIN32 version stuff: char WDversion[]=current-cvs.tcpdump.org; #if

Re: [tcpdump-workers] capturing packets with identical MAC for source and destination

2013-09-03 Thread Gisle Vanem
Lentes, Bernd bernd.len...@helmholtz-muenchen.de wrote: I'd like to capture all packets which have the same MAC-address for sender and destination. But i don't know the MAC which is causing these messages. So i have to use an universal filter. I tried to use tcpdump 'ether[8:6] =

[tcpdump-workers] 'private' in pcap-int.h

2013-08-07 Thread Gisle Vanem
'struct pcap' has a member: void *private; /* private data for methods */ Which doesn't work so well when including pcap-int.h from a C++ program. The file looks to be meant for C++ because of: #ifdef __cplusplus extern C { #endif Can this be renamed to 'priv' or '_private' ? --gv

Re: [tcpdump-workers] [Patch] print-nfs.c

2013-07-11 Thread Gisle Vanem
Denis Ovsienko infrastat...@yandex.ru wrote: 10.07.2013, 15:18, Gisle Vanem gva...@broadpark.no: 'int32_t' isn't 'int' for all targets. Some Windows targets have it defined as 'signed int' in win32/Include/bittypes.h. So print-nfs.c does not compile cleanly; conflicting definition

[tcpdump-workers] [Patch] print-nfs.c

2013-07-10 Thread Gisle Vanem
'int32_t' isn't 'int' for all targets. Some Windows targets have it defined as 'signed int' in win32/Include/bittypes.h. So print-nfs.c does not compile cleanly; conflicting definition of xid_map_find(). A fix: --- Git-Latest/print-nfs.c 2013-07-03 09:24:42 + +++ print-nfs.c 2013-07-04

[tcpdump-workers] Use of critical section on Win32

2013-05-14 Thread Gisle Vanem
I really don't understand the motivation behind the Win32-code for pcap_compile(). In gencode.c: int pcap_compile(pcap_t *p, struct bpf_program *program, const char *buf, int optimize, bpf_u_int32 mask) { int result; EnterCriticalSection(g_PcapCompileCriticalSection); result =

[tcpdump-workers] [Patch] fad-win32.c

2013-04-04 Thread Gisle Vanem
This is a similar patch to the change of pcap-dos.c: https://github.com/mcr/libpcap/commit/73b5f0387199fbaa75130837b931faf770471640 I.e. the '_interfaces' suffix got lost in some other change to the puplic API. (I don't know when). Since 'pcap_findalldevs()' is now a more generic version in

Re: [tcpdump-workers] [Patch] fad-win32.c

2013-04-04 Thread Gisle Vanem
Guy Harris g...@alum.mit.edu wrote: 'NameLength = 0' is just in case 'PacketGetAdapterNames()' fails w/o setting '*NameLength == 0'. It really could do that; ref. Packet32.c in WinPcap. Really? I don't see that. (The first call should *always* fail, in the sense of returning FALSE; if the

[tcpdump-workers] [Patch] pcap-dos.c

2013-03-28 Thread Gisle Vanem
This file has fallen behind since pcap_create() was put in pcap.c long time ago (a more generic create-function). Hence: --- Git-Latest\pcap-dos.c Wed Nov 28 23:41:44 2012 +++ pcap-dos.c Thu Nov 29 00:00:12 2012 @@ -143,7 +143,7 @@ return handle_to_device [fd-1]; } -pcap_t *pcap_create

Re: [tcpdump-workers] -W options to gcc

2013-03-28 Thread Gisle Vanem
Michael Richardson m...@sandelman.ca wrote: If one wants to add -W options to the standard build, I'm wondering what the right autoconf magic is to enable such a thing. fxlb suggested: -Wunused -Wunused-parameter I compile using MingW (gcc 4.7.2) and normally I use -Wall -W. But this gives

[tcpdump-workers] [Patch] print-dhcp6.c

2013-03-26 Thread Gisle Vanem
This file doesn't compile using MSVC v16 (from VC-Express 2010) because it has variable definitions after statements (' problem X' below). tcpdump should be in pure C, not C++ or gcc features. Right? Patch: --- Git-Latest\print-dhcp6.cThu Feb 28 16:10:44 2013 +++ print-dhcp6.c Mon

[tcpdump-workers] Duplicated dirs on Git-hub

2013-02-22 Thread Gisle Vanem
It doesn't matter much for folks with case-insensitive file-systems, but the Git-repo contains these two directories: https://github.com/mcr/tcpdump/tree/master/win32 https://github.com/mcr/tcpdump/tree/master/Win32 Maybe the files under 'Win32' should be moved into 'win32'? PS. I'm trying

Re: [tcpdump-workers] Fwd: New datasource implementation

2011-12-22 Thread Gisle Vanem
Guy Harris g...@alum.mit.edu wrote: Send us a patch, submit it on SourceForge, or do whatever the shiny new Git magic is for that (Michael, how do people do that?). This is what I do (and what the sourceforge page [1] states). 1st time checkout: git clone git://bpf.tcpdump.org/libpcap

[tcpdump-workers] [Patch] findalldevtest.c

2009-02-28 Thread Gisle Vanem
A small patch to make this file compile on Windows: --- Git-latest/findalldevstest.c Tue Feb 17 16:55:35 2009 +++ findalldevstest.c Wed Feb 18 12:45:00 2009 @@ -4,10 +4,13 @@ #include stdlib.h #include sys/types.h + +#ifndef WIN32 #include sys/socket.h #include netinet/in.h #include arpa/inet.h

[tcpdump-workers] [Patch] libpcap, pcap-stdinc.h

2009-02-12 Thread Gisle Vanem
* Added header-guard. * Include IP6_misc.h unconditionally (why treat MingW specially?) --gv --- CVS-Latest/pcap-stdinc.h Mon Oct 06 14:27:32 2008 +++ pcap-stdinc.hThu Feb 12 21:25:34 2009 @@ -30,6 +30,8 @@ * * @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.11 2008-10-06

[tcpdump-workers] [Patch] libpcap, nametoaddr.c

2009-02-12 Thread Gisle Vanem
* nametoaddr.c with DECNETLIB defined needs netdnet/dnetdb.h included. And which again needs sys/types.h. * Remove IP6_misc.h since it's already included in pcap-stdinc.h (ref. my patch to this file). --gv --- CVS-Latest/nametoaddr.cWed Feb 06 09:21:30 2008 +++ nametoaddr.c Mon

[tcpdump-workers] [Patch] signature.c

2008-09-22 Thread Gisle Vanem
bzero() and bcopy() are not universally available. But memset() and memcpy() are AFAICS. Attached diffs-5.txt. --gv --- CVS-Latest/signature.c Sat Aug 16 10:36:20 2008 +++ signature.c Mon Sep 22 16:58:20 2008 @@ -83,10 +83,10 @@ */ /* start out by storing key in pads */ -

[tcpdump-workers] CVS access

2008-08-13 Thread Gisle Vanem
What's up with the cvs access? I'm getting this error now: no such user tcpdump in CVSROOT/passwd when logging in with the command cvs -d :pserver:[EMAIL PROTECTED]:/tcpdump/master login --gv - This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.

Re: [tcpdump-workers] [Patch] pcap-dos.c

2008-04-25 Thread Gisle Vanem
Guy Harris [EMAIL PROTECTED] wrote: So what *is* this case? The error message is Cannot use different devices simultaneously; does that mean that you can have multiple instances of the same device open at the same time, but you can't have instances of more than one device open at the same

Re: [tcpdump-workers] [Patch] pcap-dos.c

2008-04-22 Thread Gisle Vanem
dot hew at gmail dot com Gianluca Varennivarenni at netgroup-serv dot polito dot it Gilbert Hoyek gil_hoyek at hotmail dot com - Gisle Vanem giva at bgnett dot no + Gisle Vanem gvanem at broadpark dot

[tcpdump-workers] [Patch] msdos/pktdrvr.c

2008-04-22 Thread Gisle Vanem
* gnuc.c not needed. * sys/pack*.h was renamed in a recent Watt-32 distro. --- msdos/pktdrvr.c.orig Sat Dec 18 07:52:14 2004 +++ msdos/pktdrvr.c Wed Dec 13 15:55:00 2006 @@ -21,7 +21,6 @@ #include string.h #include dos.h -#include gnuc.h #include pcap-dos.h #include pcap-int.h #include

[tcpdump-workers] [Patch] pcap-dos.c

2008-04-19 Thread Gisle Vanem
The recent change for pcap_activate() broke the DOS-port. Here's a small fix: --- pcap-dos.c.orig Mon Apr 14 19:40:58 2008 +++ pcap-doc.cThu Apr 17 15:33:00 2008 @@ -97,10 +97,10 @@ static struct device *handle_to_device [20]; -static void pcap_activate_dos (pcap_t *p); +static int

Re: [tcpdump-workers] [Patch] pcap-dos.c

2008-04-19 Thread Gisle Vanem
Guy Harris [EMAIL PROTECTED] wrote: @@ -201,7 +202,7 @@ Cannot use different devices simultaneously (`%s' vs. `%s'), active_dev-name, pcap-md.device); free (pcap); -err = PCAP_ERROR; +err = PCAP_ERROR_ACTIVATED; PCAP_ERROR_ACTIVATED means you've called

[tcpdump-workers] typo in pcap.c

2007-11-06 Thread Gisle Vanem
--- CVS-Latest/pcap.c Wed Oct 17 17:52:41 2007 +++ pcap.c Tue Nov 06 15:04:27 2007 @@ -789,7 +789,7 @@ int pcap_setmintocopy(pcap_t *p, int size) { - return p-setintocopy_op(p, size); + return p-setmintocopy_op(p, size); } static int --gv - This is the tcpdump-workers list.

[tcpdump-workers] Unknown Ntddndis.h values

2006-08-19 Thread Gisle Vanem
The recent pcap-win32.c adds these link types: NdisMediumBare80211 NdisMediumRadio80211 Searching MS and Google came up blank on these. What values should these have? IMHO, something like this should be added to the top of pcap-win32.c: #ifndef NdisMediumBare80211 #define NdisMediumBare80211

Re: [tcpdump-workers] Missing af.h

2006-02-26 Thread Gisle Vanem
Guy Harris [EMAIL PROTECTED] wrote: No - it, and af.c, should probably be generated from the stuff removed from print-bgp.c. I've checked in versions of af.c and af.h generated that way. netdissect.h isn't atomic; it needs stdint.h ahead of it (from tcpdump-stdinc.h). Hence: ---

[tcpdump-workers] Missing af.h

2006-02-25 Thread Gisle Vanem
This file is needed by print-bgp.c, print-ldp.c and print-rip.c, but missing from the tar-ball. Should it be generated by configure? And the FILES list af.c as well. That's missing too. BTW. addrtoname.c on Win32 is missing ETHER_ADDR_LEN. A fix: --- tcpdump-2006.02.25\addrtoname.c Sat Feb

[tcpdump-workers] gettimeofday() on Win32

2005-12-03 Thread Gisle Vanem
The recent (?) -G option requires gettimeofday() which isn't available on Win32. Attached is a patch to util.c which adds this function. --gv --- tcpdump-2005.12.03/util.c Thu Jun 16 00:19:38 2005 +++ util.c Sat Dec 03 17:01:05 2005 @@ -526,3 +526,44 @@ else

[tcpdump-workers] Watcom/Digital Mars patches

2004-11-02 Thread Gisle Vanem
I've compiled tcpdump okay with these compilers and some small changes. Digital Mars doesn't allow conversion between unsigned and signed without a cast. So this is needed: --- tcpdump-2004.11.02/print-802_11.c Thu Sep 23 23:57:25 2004 +++ ./print-802_11.c Fri Oct 29 14:48:11 2004 @@ -964,7 +964,7

Re: [tcpdump-workers] savefile.c patch

2004-05-27 Thread Gisle Vanem
Guy Harris [EMAIL PROTECTED] said: Also, should we save the mode returned by setmode() and restore it when we close a pcap_t or pcap_dumper_t that refers to the standard input or output? Since pcap_dump_close() doesn't have a pcap_t argument, where should the oldmode come from? Can we have

[tcpdump-workers] savefile.c patch

2004-05-26 Thread Gisle Vanem
I feel it's high time we cleanup some of the sources. I'd start with savefile.c. Currently it doesn't work for offline data from stdin. --gv --- libpcap-2004.05.20/savefile.c Tue Mar 23 21:18:08 2004 +++ savefile.c Wed Mar 24 16:29:06 2004 @@ -52,6 +52,12 @@ #define TCPDUMP_MAGIC

Re: [tcpdump-workers] tok2str() patch

2004-04-28 Thread Gisle Vanem
I've had problem replying to the list, so this is just a test. BTW. tok2str() is still vulnerable. - Original Message - From: Gisle Vanem [EMAIL PROTECTED] To: tcpdump-workers [EMAIL PROTECTED] Sent: Wednesday, March 24, 2004 9:26 PM Subject: [tcpdump-workers] tok2str() patch tok2str