]> The Tcpdump Group git mirrors - libpcap/commitdiff
Delete trailing spaces/tabs
authorFrancois-Xavier Le Bail <[email protected]>
Sun, 8 Mar 2015 20:39:43 +0000 (21:39 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 8 Mar 2015 20:39:43 +0000 (21:39 +0100)
79 files changed:
CREDITS
INSTALL.txt
LICENSE
README
README.Win32
README.aix
README.hpux
README.linux
README.septel
README.tru64
TODO
Win32/Include/addrinfo.h
Win32/Include/arpa/nameser.h
Win32/Include/bittypes.h
Win32/Include/cdecl_ext.h
Win32/Include/net/if.h
Win32/Include/sockstorage.h
Win32/Prj/libpcap.dsp
Win32/Src/gai_strerror.c
Win32/Src/getaddrinfo.c
Win32/Src/getnetent.c
Win32/Src/inet_aton.c
Win32/Src/inet_pton.c
aclocal.m4
doc/pcap.html
doc/pcap.xml
fad-gifc.c
fad-win32.c
gencode.c
gencode.h
grammar.y
install-sh
lbl/os-osf4.h
lbl/os-osf5.h
msdos/makefile.dj
msdos/readme.dos
pcap-bpf.c
pcap-bpf.h
pcap-bt-linux.c
pcap-bt-linux.h
pcap-canusb-linux.c
pcap-common.c
pcap-dag.c
pcap-dbus.c
pcap-dlpi.c
pcap-dos.c
pcap-dos.h
pcap-filter.manmisc.in
pcap-linux.c
pcap-netfilter-linux.c
pcap-netfilter-linux.h
pcap-nit.c
pcap-pf.c
pcap-savefile.manfile.in
pcap-septel.c
pcap-sita.c
pcap-snf.c
pcap-snit.c
pcap-snoop.c
pcap-tstamp.manmisc.in
pcap-usb-linux.c
pcap-usb-linux.h
pcap-win32.c
pcap.3pcap.in
pcap/bluetooth.h
pcap/bpf.h
pcap/usb.h
pcap_breakloop.3pcap
pcap_dump.3pcap
pcap_list_datalinks.3pcap.in
pcap_setdirection.3pcap
runlex.sh
savefile.c
sf-pcap-ng.c
sf-pcap.c
tests/BPF/4.txt
tests/pcap_compile_test.c
tests/valgrindtest.c
tests/visopts.py

diff --git a/CREDITS b/CREDITS
index 2c6ed958855d4af40512dec1a4e4f4882b03d981..b40152f5e54bbb9aa9bb81da3d8380a1588dc7b3 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -46,7 +46,7 @@ Additional people who have contributed patches:
     David Young                   <dyoung at ojctech dot com>
     Dean Gaudet                   <dean at arctic dot org>
     dhruv                         <rsrivat at sourceforge dot net>
-    Don Ebright                   <Don dot Ebright at compuware dot com> 
+    Don Ebright                   <Don dot Ebright at compuware dot com>
     Dug Song                      <dugsong at monkey dot org>
     Dustin Spicuzza               <dustin at virtualroadside dot com>
     dzejarczech                   <dzejarczech at sourceforge dot net>
index 12f19ccd91bd5d7eeb4c1a0c333e176862fd1e42..18b489aa84e04125b00ef14817385f42237554ec 100644 (file)
@@ -178,14 +178,14 @@ packet timestamps aren't very good.  This appears to be due to haphazard
 handling of the timestamp in the kernel.
 
 Note well: there is rumoured to be a version of tcpdump floating around
-called 3.0.3 that includes libpcap and is supposed to support Linux. 
+called 3.0.3 that includes libpcap and is supposed to support Linux.
 You should be advised that neither the Network Research Group at LBNL
-nor the Tcpdump Group ever generated a release with this version number. 
+nor the Tcpdump Group ever generated a release with this version number.
 The LBNL Network Research Group notes with interest that a standard
 cracker trick to get people to install trojans is to distribute bogus
-packages that have a version number higher than the current release. 
+packages that have a version number higher than the current release.
 They also noted with annoyance that 90% of the Linux related bug reports
-they got are due to changes made to unofficial versions of their page. 
+they got are due to changes made to unofficial versions of their page.
 If you are having trouble but aren't using a version that came from
 tcpdump.org, please try that before submitting a bug report!
 
diff --git a/LICENSE b/LICENSE
index dea5f7d54d6b1d7898f8b7bdad3e11f7e93cee4a..a10474d54aeba7d28f59436331aee1f389d46c32 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,9 +1,9 @@
 License: BSD
+
 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
@@ -13,7 +13,7 @@ are met:
   3. The names of the authors may not be used to endorse or promote
      products derived from this software without specific prior
      written permission.
-  
+
 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/README b/README
index 46fcc5689e708e2405e499c5b665c4b51e114fa0..9f65948d4ef2e44a2fdaf72af8278bfc693abeeb 100644 (file)
--- a/README
+++ b/README
@@ -76,15 +76,15 @@ information on configuring that option.
 
 Note to Linux distributions and *BSD systems that include libpcap:
 
-There's now a rule to make a shared library, which should work on Linux 
+There's now a rule to make a shared library, which should work on Linux
 and *BSD, among other platforms.
 
-It sets the soname of the library to "libpcap.so.1"; this is what it 
-should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as 
+It sets the soname of the library to "libpcap.so.1"; this is what it
+should be, *NOT* libpcap.so.1.x or libpcap.so.1.x.y or something such as
 that.
 
-We've been maintaining binary compatibility between libpcap releases for 
-quite a while; there's no reason to tie a binary linked with libpcap to 
+We've been maintaining binary compatibility between libpcap releases for
+quite a while; there's no reason to tie a binary linked with libpcap to
 a particular release of libpcap.
 
 Problems, bugs, questions, desirable enhancements, etc. should be sent
index 503836e341f1ae20aade058fbf7eac43bc561831..0a42dab93d4bd3b6d48d9d20b72289ccbb54d120 100644 (file)
@@ -1,9 +1,9 @@
-Under Win32, libpcap is integrated in the WinPcap packet capture system. 
-WinPcap provides a framework that allows libpcap to capture the packets 
-under Windows 95, Windows 98, Windows ME, Windows NT 4, Windows 2000 
+Under Win32, libpcap is integrated in the WinPcap packet capture system.
+WinPcap provides a framework that allows libpcap to capture the packets
+under Windows 95, Windows 98, Windows ME, Windows NT 4, Windows 2000
 and Windows XP.
-WinPcap binaries and source code can be found at http://winpcap.polito.it: 
-they include also a developer's pack with all the necessary to compile 
+WinPcap binaries and source code can be found at http://winpcap.polito.it:
+they include also a developer's pack with all the necessary to compile
 libpcap-based applications under Windows.
 
 How to compile libpcap with Visual Studio
@@ -12,35 +12,35 @@ How to compile libpcap with Visual Studio
 In order to compile libpcap you will need:
 
 - version 6 (or higher) of Microsoft Visual Studio
-- The November 2001 (or later) edition of Microsoft Platform 
-Software Development Kit (SDK), that contains some necessary includes 
+- The November 2001 (or later) edition of Microsoft Platform
+Software Development Kit (SDK), that contains some necessary includes
 for IPv6 support. You can download it from http://www.microsoft.com/sdk
-- the latest WinPcap sources from http://winpcap.polito.it/install 
+- the latest WinPcap sources from http://winpcap.polito.it/install
 
-The WinPcap source code already contains a recent (usually the latest 
-stable) version of libpcap. If you need to compile a different one, 
-simply download it from www.tcpdump.org and copy the sources in the 
+The WinPcap source code already contains a recent (usually the latest
+stable) version of libpcap. If you need to compile a different one,
+simply download it from www.tcpdump.org and copy the sources in the
 winpcap\wpcap\libpcap folder of the WinPcap distribution. If you want to
-compile a libpcap source retrieved from the tcpdump.org Git, you will 
-have to create the scanner and the grammar by hand (with lex and yacc) 
+compile a libpcap source retrieved from the tcpdump.org Git, you will
+have to create the scanner and the grammar by hand (with lex and yacc)
 or with the cygnus makefile, since The Visual Studio project is not able
 to build them.
 
-Open the project file winpcap\wpcap\prj\wpcap.dsw with Visual Studio and 
-build wpcap.dll. wpcap.lib, the library file to link with the applications, 
-will be generated in winpcap\wpcap\lib\. wpcap.dll will be generated in 
-winpcap\wpcap\prj\release or winpcap\wpcap\prj\debug depending on the type 
+Open the project file winpcap\wpcap\prj\wpcap.dsw with Visual Studio and
+build wpcap.dll. wpcap.lib, the library file to link with the applications,
+will be generated in winpcap\wpcap\lib\. wpcap.dll will be generated in
+winpcap\wpcap\prj\release or winpcap\wpcap\prj\debug depending on the type
 of binary that is being created.
 
 How to compile libpcap with Cygnus
 ----------------------------------
 
-To build wpcap.dll, cd to the directory WPCAP/PRJ of the WinPcap source code 
-distribution and type "make". libwpcap.a, the library file to link with the 
-applications, will be generated in winpcap\wpcap\lib\. wpcap.dll will be 
+To build wpcap.dll, cd to the directory WPCAP/PRJ of the WinPcap source code
+distribution and type "make". libwpcap.a, the library file to link with the
+applications, will be generated in winpcap\wpcap\lib\. wpcap.dll will be
 generated in winpcap\wpcap\prj.
 
-Remember, you CANNOT use the MSVC-generated .lib files with gcc, use 
+Remember, you CANNOT use the MSVC-generated .lib files with gcc, use
 libwpcap.a instead.
 
 "make install" installs wpcap.dll in the Windows system folder.
index f457df3217024df00a43b901eee8ba1c6ec30784..92e513ff741389e2a9560f1e78737fde7c70a031 100644 (file)
@@ -76,8 +76,8 @@ If you use DLPI:
     Then you need to type:
 
            strload -f /etc/dlpi.conf
-    Check again with strload -q -d dlpi that the dlpi driver is loaded.  
+
+    Check again with strload -q -d dlpi that the dlpi driver is loaded.
 
     Alternatively, you can uncomment the lines for DLPI in
     /etc/pse.conf and reboot the machine; this way DLPI will always
index 88c27f8a2581540a68bea93127567745f62069b8..65ecff97c2498bbd078871d80648f7c726ac42af 100644 (file)
@@ -5,14 +5,14 @@ HP-UX and cannot upgrade, please continue reading.
 HP-UX patches to fix packet capture problems
 
 Note that packet-capture programs such as tcpdump may, on HP-UX, not be
-able to see packets sent from the machine on which they're running. 
+able to see packets sent from the machine on which they're running.
 Some articles on groups.google.com discussing this are:
 
        http://groups.google.com/groups?selm=82ld3v%2480i%241%40mamenchi.zrz.TU-Berlin.DE
 
 which says:
 
-  Newsgroups: comp.sys.hp.hpux 
+  Newsgroups: comp.sys.hp.hpux
   Subject:  Re: Did someone made tcpdump working on 10.20 ?
   Date: 12/08/1999
   From: Lutz Jaenicke <[email protected]>
@@ -27,14 +27,14 @@ which says:
    >must me "patched" (poked) in order to see outbound data in promiscuous mode.
    >Many things to do .... So the question is : did someone has already this
    >"ready to use" PHNE_**** patch ?
-  
+
    Two things:
    1. You do need a late "LAN products cumulative patch" (e.g.  PHNE_18173
   for   s700/10.20).
    2. You must use
 echo 'lanc_outbound_promisc_flag/W1' | /usr/bin/adb -w /stand/vmunix /dev/kmem
      You can insert this e.g. into /sbin/init.d/lan
-  
+
    Best regards,
    Lutz
 
@@ -44,7 +44,7 @@ and
 
 which says:
 
-  Newsgroups: comp.sys.hp.hpux 
+  Newsgroups: comp.sys.hp.hpux
   Subject: Re: tcpdump only shows incoming packets
   Date: 02/15/2000
   From: Rick Jones <[email protected]>
@@ -56,12 +56,12 @@ which says:
   > outgoing. I have tried tcpflow-0.12 which also uses libpcap and the
   > same thing happens.  Could someone please give me a hint on how to
   > get this right?
-  
+
   Search/Read the archives ?-)
-  
+
   What you are seeing is expected, un-patched, behaviour for an HP-UX
   system.  On 11.00, you need to install the latest lancommon/DLPI
-  patches, and then the latest driver patch for the interface(s) in use. 
+  patches, and then the latest driver patch for the interface(s) in use.
   At that point, a miracle happens and you should start seeing outbound
   traffic.
 
@@ -79,7 +79,7 @@ which says:
   From: Harald Skotnes <[email protected]>
 
   Rick Jones wrote:
-  
+
        ...
 
   > What you are seeing is expected, un-patched, behaviour for an HP-UX
@@ -87,7 +87,7 @@ which says:
   > patches, and then the latest driver patch for the interface(s) in
   > use. At that point, a miracle happens and you should start seeing
   > outbound traffic.
-  
+
   Thanks a lot.  I have this problem on several machines running HPUX
   10.20 and 11.00.  The machines where patched up before y2k so did not
   know what to think.  Anyway I have now installed PHNE_19766,
@@ -101,7 +101,7 @@ And another message to [email protected], from Rick Jones:
 
   Date: Mon, 29 Apr 2002 15:59:55 -0700
   From: Rick Jones
-  To: [email protected] 
   Subject: Re: [tcpdump-workers] I Can't Capture the Outbound Traffic
 
        ...
@@ -130,21 +130,21 @@ captures on HP-UX 9.x:
 
   Dave Barr ([email protected]) wrote:
   : Has anyone ported tcpdump (or something similar) to HP/UX 9.x?
-  
+
   I'm reasonably confident that any port of tcpdump to 9.X would require
   the (then optional) STREAMS product.  This would bring DLPI, which is
   what one uses to access interfaces in promiscuous mode.
-  
+
   I'm not sure that HP even sells the 9.X STREAMS product any longer,
   since HP-UX 9.X is off the pricelist (well, maybe 9.10 for the old 68K
-  devices). 
-  
+  devices).
+
   Your best bet is to be up on 10.20 or better if that is at all
-  possible.  If your hardware is supported by it, I'd go with HP-UX 11. 
+  possible.  If your hardware is supported by it, I'd go with HP-UX 11.
   If you want to see the system's own outbound traffic, you'll never get
   that functionality on 9.X, but it might happen at some point for 10.20
-  and 11.X. 
-  
+  and 11.X.
+
   rick jones
 
 (as per other messages cited here, the ability to see the system's own
@@ -178,12 +178,12 @@ An additional note, from Jost Martin, for HP-UX 10.20:
        (thanks to [email protected] (Ralf Hildebrandt) who
        posted the security-part some time ago)
 
-                <<hack_ip_stack>> 
+                <<hack_ip_stack>>
 
                (Don't switch IP-forwarding off, if you need it !)
                Install the hack as /sbin/init.d/hacl_ip_stack (adjust
        permissions !) and make a sequencing-symlink
-       /sbin/rc2.d/S350hack_ip_stack pointing to this script. 
+       /sbin/rc2.d/S350hack_ip_stack pointing to this script.
                Now all this is done on every reboot.
 
 According to Rick Jones, the global promiscuous switch also has to be
index f92cd22b9e915a831d6703c740fe2e9ae8fd9602..ffcb9288ca13642b36ffa504da8be1ee97dccd8b 100644 (file)
@@ -19,13 +19,13 @@ the 2.0[.x] kernel:
          The Packet protocol is used by applications which communicate
          directly with network devices without an intermediate network
          protocol implemented in the kernel, e.g. tcpdump. If you want them
-         to work, choose Y. 
+         to work, choose Y.
 
          This driver is also available as a module called af_packet.o ( =
          code which can be inserted in and removed from the running kernel
          whenever you want). If you want to compile it as a module, say M
          here and read Documentation/modules.txt; if you use modprobe or
-         kmod, you may also want to add "alias net-pf-17 af_packet" to 
+         kmod, you may also want to add "alias net-pf-17 af_packet" to
          /etc/modules.conf.
 
 and the note for the 2.2[.x] kernel says:
@@ -47,7 +47,7 @@ In addition, there is an option that, in 2.2 and later kernels, will
 allow packet capture filters specified to programs such as tcpdump to be
 executed in the kernel, so that packets that don't pass the filter won't
 be copied from the kernel to the program, rather than having all packets
-copied to the program and libpcap doing the filtering in user mode. 
+copied to the program and libpcap doing the filtering in user mode.
 
 Copying packets from the kernel to the program consumes a significant
 amount of CPU, so filtering in the kernel can reduce the overhead of
index fbc88df38af4df60fe184ebdff95b2f54df3cf6f..483de6a7f969fdcb7663d32d413b3bd100021e77 100644 (file)
@@ -14,7 +14,7 @@ where DIR is the root of the Septel software distribution, for example
 /var/src/septel.
 
 By default (if you write only ./configure --with-septel) it takes
-./../septel as argument for DIR. 
+./../septel as argument for DIR.
 
 If the Septel software is correctly detected 'configure' will
 report:
index 7fe1ef07b5306d670ad213c0c0a1d011d5a06dc5..2420d9e12180203eafb85ba9f84b4b46c71cfc88 100644 (file)
@@ -1,4 +1,4 @@
-The following instructions are applicable to Tru64 UNIX 
+The following instructions are applicable to Tru64 UNIX
 (formerly Digital UNIX (formerly DEC OSF/1)) version 4.0, and
 probably to later versions as well; at least some options apply to
 Digital UNIX 3.2 - perhaps all do.
diff --git a/TODO b/TODO
index 73325e1965dd50804c17eaf5de8c4e0a58131c0a..aae24c22d25174c874fc6be684b347906295d79e 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,11 +6,11 @@ Important stuff (to be done before the next release)
 
 General
 
-- configure should not be in Git. Most open source projects have an 
-  autogen.sh script to run autoconf etc. after checkout. I think we 
-  should stick to the standard. 
+- configure should not be in Git. Most open source projects have an
+  autogen.sh script to run autoconf etc. after checkout. I think we
+  should stick to the standard.
 
-- The source files should be better documented. There is no official 
+- The source files should be better documented. There is no official
   design guideline for what is done where. There should be a common coding
   style (okay, you can guess that by looking at the code) and a guide for
   what needs to be documented.
@@ -18,7 +18,7 @@ General
 Less urgent items
 -----------------
 
-- Better documentation and cleanup of the interface. I am seeing a few  
+- Better documentation and cleanup of the interface. I am seeing a few
   problems at the first glance which needs fixing:
   + pcap_lookupnet makes little to no sense with protocols != IPv4
   + not very well suited for interactive programs (think ethereal). There
index 4db7384af2054f24491783dbd2a0c98a5ecafe32..ac4fcce10c827af078bcafcab4864d3cfab9eb22 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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
@@ -92,13 +92,13 @@ extern const char *inet_ntop (int, const void *, char *, size_t);
 
 #ifndef EAI_BADHINTS
 #define EAI_BADHINTS   12
-#endif 
+#endif
 
-#ifndef EAI_PROTOCOL   
+#ifndef EAI_PROTOCOL
 #define EAI_PROTOCOL   13
 #endif
 
-#ifndef EAI_MAX        
+#ifndef EAI_MAX
 #define EAI_MAX                14
 #endif
 
index 18f185cf5b34a4df2002d17565728120db704d9c..b20dc1e3f15222e580fb649e374ac8cb29764a7c 100644 (file)
@@ -3,7 +3,7 @@
  * -
  * Copyright (c) 1983, 1989, 1993
  *    The Regents of the University of California.  All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -19,7 +19,7 @@
  * 4. 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.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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
  * SUCH DAMAGE.
  * -
  * Portions Copyright (c) 1993 by Digital Equipment Corporation.
- * 
+ *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
  * copyright notice and this permission notice appear in all copies, and that
  * the name of Digital Equipment Corporation not be used in advertising or
  * publicity pertaining to distribution of the document or software without
  * specific, written prior permission.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
  * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
@@ -69,7 +69,7 @@
 # include <sys/types.h>
 #endif
 #include <sys/cdefs.h>
-#else 
+#else
 #include <pcap-stdinc.h>
 #define __LITTLE_ENDIAN 1
 #define __BYTE_ORDER __LITTLE_ENDIAN
index 7c0cbdeb5f3bd3bc995ae5f41008615b7126c5c4..95aa9faa6bfdbf6e6d86600305f2b1669a206aec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1999 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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
@@ -34,7 +34,7 @@ typedef unsigned char u_int8_t;
 typedef signed char int8_t;
 #endif /* HAVE_U_INT8_T */
 
-#ifndef HAVE_U_INT16_T 
+#ifndef HAVE_U_INT16_T
 typedef unsigned short u_int16_t;
 typedef signed short int16_t;
 #endif /* HAVE_U_INT16_T */
index 9591db26457420f3c3acadccb2d3bd0dfbeacb48..9d40b84cb6a03290708be9ffb6d7a62b2c903976 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1999 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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
index bf926b6ef5171d33fb8232361b151886219011fa..58d3c16e0d856e1585ff013f8f8091785a169a8c 100644 (file)
@@ -36,7 +36,7 @@
 
 #ifndef _NET_IF_H_
 #define        _NET_IF_H_
+
 /*
  * <net/if.h> does not depend on <sys/time.h> on most other systems.  This
  * helps userland compatability.  (struct timeval ifi_lastchange)
index 557eb4df0aff97f172db091f39c1635d4c9e88c7..cbad1900412a7a43f5e3af3822f1ba844dad1a19 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1999 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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
index 17e5a7037d41cc0ecd006cf5c19e73a4b4b98e27..7082122cc327175aa04410c7f9854e3e06776856 100644 (file)
@@ -7,19 +7,19 @@
 CFG=libpcap - Win32 Debug
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
 !MESSAGE use the Export Makefile command and run
-!MESSAGE 
+!MESSAGE
 !MESSAGE NMAKE /f "libpcap.mak".
-!MESSAGE 
+!MESSAGE
 !MESSAGE You can specify a configuration when running NMAKE
 !MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
+!MESSAGE
 !MESSAGE NMAKE /f "libpcap.mak" CFG="libpcap - Win32 Debug"
-!MESSAGE 
+!MESSAGE
 !MESSAGE Possible choices for configuration are:
-!MESSAGE 
+!MESSAGE
 !MESSAGE "libpcap - Win32 Release" (based on "Win32 (x86) Static Library")
 !MESSAGE "libpcap - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE 
+!MESSAGE
 
 # Begin Project
 # PROP AllowPerConfigDependencies 0
@@ -74,7 +74,7 @@ LIB32=link.exe -lib
 # ADD BASE LIB32 /nologo
 # ADD LIB32 /nologo
 
-!ENDIF 
+!ENDIF
 
 # Begin Target
 
index edd970b927c7652eb33f587de74c003aba5edb85..a36c35d8f5ea7d826b12d01fe6b27f47956445b5 100644 (file)
@@ -67,7 +67,7 @@ static char *ai_errlist[] = {
 #define EAI_MAX (sizeof(ai_errlist)/sizeof(ai_errlist[0]))
 #endif
 
-/* on MingW, gai_strerror is available. 
+/* on MingW, gai_strerror is available.
    We need to compile gai_strerrorA only for Cygwin
  */
 #ifndef gai_strerror
index 19ffa68a8a8aae3b32fdaadc0d518d19f4d52bd2..d3ebda085f632da0e3f664665b146f8d7deff65e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -13,7 +13,7 @@
  * 3. Neither the name of the project nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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
  * Mingw64 has its own implementation of getaddrinfo, mingw32 no
  */
 #ifndef __MINGW64__
+
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif 
+#endif
 
 #include <pcap-stdinc.h>
 #if 0
 
 #ifndef HAVE_PORTABLE_PROTOTYPE
 #include "cdecl_ext.h"
-#endif 
+#endif
 
 #ifndef HAVE_U_INT32_T
 #include "bittypes.h"
-#endif 
+#endif
 
 #ifndef HAVE_SOCKADDR_STORAGE
 #ifndef __MINGW32__
 #include "sockstorage.h"
 #endif
-#endif 
+#endif
 
 #ifdef NEED_ADDRINFO_H
 #include "addrinfo.h"
@@ -109,7 +109,7 @@ static const char in_addrany[] = { 0, 0, 0, 0 };
 static const char in6_addrany[] = {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-static const char in_loopback[] = { 127, 0, 0, 1 }; 
+static const char in_loopback[] = { 127, 0, 0, 1 };
 static const char in6_loopback[] = {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
 };
@@ -127,7 +127,7 @@ static const struct afd {
        int a_socklen;
        int a_off;
        const char *a_addrany;
-       const char *a_loopback; 
+       const char *a_loopback;
        int a_scoped;
 } afdl [] = {
 #ifdef INET6
@@ -330,7 +330,7 @@ getaddrinfo(hostname, servname, hints, res)
        pai->ai_canonname = NULL;
        pai->ai_addr = NULL;
        pai->ai_next = NULL;
-       
+
        if (hostname == NULL && servname == NULL)
                return EAI_NONAME;
        if (hints) {
@@ -820,7 +820,7 @@ explore_numeric(pai, hostname, servname, res)
                        }
                        while (cur && cur->ai_next)
                                cur = cur->ai_next;
-               } else 
+               } else
                        ERR(EAI_FAMILY);        /*xxx*/
        }
 
@@ -955,7 +955,7 @@ get_name(addr, afd, res, numaddr, pai, servname)
                GET_AI(cur, afd, numaddr);
                GET_PORT(cur, servname);
        }
-       
+
 #ifdef USE_GETIPNODEBY
        if (hp)
                freehostent(hp);
index d4cceb3343806e31d9bacd7bd9441938a3eea4d9..95281a548b3cccd31f03ba1121f4d67a7beb00dd 100644 (file)
@@ -85,7 +85,7 @@ again:
        net.n_net = inet_network(cp);
        net.n_addrtype = AF_INET;
        q = net.n_aliases = net_aliases;
-       if (p != NULL) 
+       if (p != NULL)
                cp = p;
        while (cp && *cp) {
                if (*cp == ' ' || *cp == '\t') {
index cbd43619164b0cad4001605b601beb2d9d3be732..db97bceae244e854eb801749167beba29110573b 100644 (file)
@@ -2,27 +2,27 @@
  * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden).
  * 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.
- * 
+ *
  * 3. All advertising materials mentioning features or use of this software
  *    must display the following acknowledgement:
  *      This product includes software developed by the Kungliga Tekniska
  *      Högskolan and its contributors.
- * 
+ *
  * 4. Neither the name of the Institute nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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
index fe89bb59f3c394f4bb30733193412473c942007e..7fe3813a0c8b698c407a32e72e25362a9977e85b 100644 (file)
@@ -2,27 +2,27 @@
  * Copyright (c) 1999 Kungliga Tekniska Högskolan
  * (Royal Institute of Technology, Stockholm, Sweden).
  * 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.
- * 
+ *
  * 3. All advertising materials mentioning features or use of this software
  *    must display the following acknowledgement:
  *      This product includes software developed by the Kungliga Tekniska
  *      Högskolan and its contributors.
- * 
+ *
  * 4. Neither the name of the Institute nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE 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
index 31a18e10fc4751877a12b8df1569c773e02a3006..02502b27fe0ad11453c2986700d107f9bce0922a 100644 (file)
@@ -231,7 +231,7 @@ AC_DEFUN(AC_LBL_CHECK_UNKNOWN_WARNING_OPTION_ERROR,
                # We're assuming this is clang, where
                # -Werror=unknown-warning-option is the appropriate
                # option to force the compiler to fail.
-               # 
+               #
                ac_lbl_unknown_warning_option_error="-Werror=unknown-warning-option"
            ],
            [
@@ -1274,7 +1274,7 @@ dnl
 dnl    AC_LBL_DL_PASSIVE_REQ_T
 dnl
 dnl results:
-dnl 
+dnl
 dnl    HAVE_DLPI_PASSIVE (defined)
 dnl
 AC_DEFUN(AC_LBL_DL_PASSIVE_REQ_T,
index 94e351400ff00699f6468332b3f1b50d1246c470..cb6abe55134a47ce3f6aa56effe8e7a9a96304de 100644 (file)
@@ -16,7 +16,7 @@
         font-weight: bold; text-align: right;
         font-family: helvetica, arial, sans-serif;
         background-color: transparent; }
-    td.rfcbug { background-color: #000000 ; width: 30px ; height: 30px ; 
+    td.rfcbug { background-color: #000000 ; width: 30px ; height: 30px ;
         text-align: justify; vertical-align: middle ; padding-top: 2px ; }
     td.rfcbug span.RFC { color: #666666; font-weight: bold; text-decoration: none;
         background-color: #000000 ;
@@ -205,8 +205,8 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatblock"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Block Type                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -287,13 +287,13 @@ Intellectual Property and Copyright Statements<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | SHB v1.0  |                      Data                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   Typical configuration with a single Section Header Block 
+   Typical configuration with a single Section Header Block
 
 
    |--   1st Section   --|--   2nd Section   --|--  3rd Section  --|
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   | SHB v1.0  |  Data   | SHB V1.1  |  Data   | SHB V1.0  |  Data |  
+   | SHB v1.0  |  Data   | SHB V1.1  |  Data   | SHB V1.0  |  Data |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    Configuration with three different Section Header Blocks
 </pre>
@@ -321,16 +321,16 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatSHB"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            Magic                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Major            |             Minor             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 </pre>
 <table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Section Header Block format.&nbsp;</b></font><br /></td></tr></table><hr size="1" shade="0">
@@ -386,16 +386,16 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatidb"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Interface ID         |           LinkType            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            SnapLen                            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </pre>
 <table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Interface Description Block format.&nbsp;</b></font><br /></td></tr></table><hr size="1" shade="0">
@@ -495,8 +495,8 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatpb"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |         Interface ID          |          Drops Count          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -514,9 +514,9 @@ Intellectual Property and Copyright Statements<br />
    |              /* variable length, byte-aligned */              |
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 </pre>
 <table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Packet Block format.&nbsp;</b></font><br /></td></tr></table><hr size="1" shade="0">
@@ -555,8 +555,8 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatpbs"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Packet Len                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -589,10 +589,10 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatnrb"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |      Record Type              |         Record Length         | 
+   |      Record Type              |         Record Length         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Record Value                            |
    |              /* variable length, byte-aligned */              |
@@ -602,9 +602,9 @@ Intellectual Property and Copyright Statements<br />
              . . . other records . . .
    |  Record Type == end_of_recs   |  Record Length == 00          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </pre>
 <table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Name Resolution Block format.&nbsp;</b></font><br /></td></tr></table><hr size="1" shade="0">
@@ -666,8 +666,8 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatisb"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         IfRecv                                |
    |                          (high + low)                         |
@@ -686,9 +686,9 @@ Intellectual Property and Copyright Statements<br />
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Interface ID         |           Reserved            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </pre>
 <table border="0" cellpadding="0" cellspacing="2" align="center"><tr><td align="center"><font face="monaco, MS Sans Serif" size="1"><b>&nbsp;Interface Statistics Block format.&nbsp;</b></font><br /></td></tr></table><hr size="1" shade="0">
@@ -759,10 +759,10 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatopt"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |      Option Code              |         Option Length         | 
+   |      Option Code              |         Option Length         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Option Value                            |
    |              /* variable length, byte-aligned */              |
@@ -814,8 +814,8 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formatcb"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |  Compr. Type  |                                               |
    +-+-+-+-+-+-+-+-+                                               |
@@ -842,8 +842,8 @@ Intellectual Property and Copyright Statements<br />
 </p><br /><hr />
 <a name="formateb"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Encr. Type  |                                               |
    +-+-+-+-+-+-+-+-+                                               |
@@ -871,8 +871,8 @@ A Fixed Length Block stores records with constant size. It contains a set of Blo
 </p><br /><hr />
 <a name="formatflm"></a>
 <pre>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Cell Size            |                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
index ebbf3217fd592015513e1b1afbd9339baf4716c0..1fb0eb71214a19a11c8d7d2eeb663e8e676c1b99 100644 (file)
@@ -72,8 +72,8 @@
 
 <figure anchor="formatblock" title="Basic block structure.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Block Type                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    | SHB v1.0  |                      Data                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   Typical configuration with a single Section Header Block 
+   Typical configuration with a single Section Header Block
 
 
    |--   1st Section   --|--   2nd Section   --|--  3rd Section  --|
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   | SHB v1.0  |  Data   | SHB V1.1  |  Data   | SHB V1.0  |  Data |  
+   | SHB v1.0  |  Data   | SHB V1.1  |  Data   | SHB V1.0  |  Data |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    Configuration with three different Section Header Blocks
 </artwork>
 <t>The Section Header Block is mandatory. It identifies the beginning of a section of the capture dump file. Its format is shown in <xref target="formatSHB"/>.</t>
 <figure anchor="formatSHB" title="Section Header Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            Magic                              |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              Major            |             Minor             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 </artwork>
 </figure>
 
 <figure anchor="formatidb" title="Interface Description Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Interface ID         |           LinkType            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                            SnapLen                            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </artwork>
 </figure>
   <c>9</c>
   <c>4</c>
   <c>Time zone for GMT support (TODO: specify better).</c>
-  
+
   <c>if_flags</c>
   <c>10</c>
   <c>4</c>
 
 <figure anchor="formatpb" title="Packet Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |         Interface ID          |          Drops Count          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              /* variable length, byte-aligned */              |
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 </artwork>
 </figure>
 
 <figure anchor="formatpbs" title="Simple Packet Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                          Packet Len                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 <figure anchor="formatnrb" title="Name Resolution Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |      Record Type              |         Record Length         | 
+   |      Record Type              |         Record Length         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Record Value                            |
    |              /* variable length, byte-aligned */              |
              . . . other records . . .
    |  Record Type == end_of_recs   |  Record Length == 00          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </artwork>
 </figure>
 
 <figure anchor="formatisb" title="Interface Statistics Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         IfRecv                                |
    |                          (high + low)                         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Interface ID         |           Reserved            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   /                                                               / 
-   /                      Options (variable)                       / 
-   /                                                               / 
+   /                                                               /
+   /                      Options (variable)                       /
+   /                                                               /
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  </artwork>
 </figure>
 
 <figure anchor="formatopt" title="Options format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-   |      Option Code              |         Option Length         | 
+   |      Option Code              |         Option Length         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Option Value                            |
    |              /* variable length, byte-aligned */              |
 
 <figure anchor="formatcb" title="Compression Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |  Compr. Type  |                                               |
    +-+-+-+-+-+-+-+-+                                               |
 
 <figure anchor="formateb" title="Encryption Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Encr. Type  |                                               |
    +-+-+-+-+-+-+-+-+                                               |
@@ -673,8 +673,8 @@ A Fixed Length Block stores records with constant size. It contains a set of Blo
 
 <figure anchor="formatflm" title="Fixed Length Block format.">
 <artwork>
-    0                   1                   2                   3   
-    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
+    0                   1                   2                   3
+    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |          Cell Size            |                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |
index 5c3357c7cea02ce7c39b934d7da4232f88cd3b60..b0a4105a838191cb1c0d15176b85163b9682db09 100644 (file)
@@ -217,12 +217,12 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
                /*
                 * XXX - The 32-bit compatibility layer for Linux on IA-64
                 * is slightly broken. It correctly converts the structures
-                * to and from kernel land from 64 bit to 32 bit but 
-                * doesn't update ifc.ifc_len, leaving it larger than the 
-                * amount really used. This means we read off the end 
-                * of the buffer and encounter an interface with an 
-                * "empty" name. Since this is highly unlikely to ever 
-                * occur in a valid case we can just finish looking for 
+                * to and from kernel land from 64 bit to 32 bit but
+                * doesn't update ifc.ifc_len, leaving it larger than the
+                * amount really used. This means we read off the end
+                * of the buffer and encounter an interface with an
+                * "empty" name. Since this is highly unlikely to ever
+                * occur in a valid case we can just finish looking for
                 * interfaces if we see an empty name.
                 */
                if (!(*ifrp->ifr_name))
index 0de893ef54877c3a15f7bd1831e650b0afde017b..0c856b183f052bca9bf6943d1f608585d84ed2a1 100644 (file)
@@ -12,9 +12,9 @@
  * 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. Neither the name of the Politecnico di Torino, CACE Technologies 
- * nor the names of its contributors may be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies
+ * nor the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -127,7 +127,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
        char *AdaptersName;
        ULONG NameLength;
        char *name;
-       
+
        /*
         * Find out how big a buffer we need.
         *
@@ -170,7 +170,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
        {
                snprintf(errbuf, PCAP_ERRBUF_SIZE, "Cannot allocate enough memory to list the adapters.");
                return (-1);
-       }                       
+       }
 
        if (!PacketGetAdapterNames(AdaptersName, &NameLength)) {
                snprintf(errbuf, PCAP_ERRBUF_SIZE,
@@ -179,7 +179,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
                free(AdaptersName);
                return (-1);
        }
-       
+
        /*
         * "PacketGetAdapterNames()" returned a list of
         * null-terminated ASCII interface name strings,
@@ -195,7 +195,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
        desc = &AdaptersName[0];
        while (*desc != '\0' || *(desc + 1) != '\0')
                desc++;
-       
+
        /*
         * Found it - "desc" points to the first of the two
         * nulls at the end of the list of names, so the
@@ -203,7 +203,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
         * after it.
         */
        desc += 2;
-       
+
        /*
         * Loop over the elements in the first list.
         */
@@ -231,7 +231,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
                if (pcap_platform_finddevs(&devlist, errbuf) < 0)
                        ret = -1;
        }
-       
+
        if (ret == -1) {
                /*
                 * We had an error; free the list we've been constructing.
@@ -241,7 +241,7 @@ pcap_findalldevs_interfaces(pcap_if_t **alldevsp, char *errbuf)
                        devlist = NULL;
                }
        }
-       
+
        *alldevsp = devlist;
        free(AdaptersName);
        return (ret);
index 33e7ee9c04a1c30ded7ff173cfc6d3833ec1dd65..ad938d478a671732ce96b0e9d9f3c33365b03d95 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -8284,7 +8284,7 @@ gen_geneve_offsets(void)
        s = new_stmt(BPF_ALU|BPF_ADD|BPF_K);
        s->s.k = off_linkpl.constant_part + off_nl + 8;
 
-       /* Stash this in X since we'll need it later. */ 
+       /* Stash this in X since we'll need it later. */
        s1 = new_stmt(BPF_MISC|BPF_TAX);
        sappend(s, s1);
 
index 6c05b3935662106644152ac20f84fc28a53703e9..67ed0dc076bbad49369957903239f2b7bbf2bc25 100644 (file)
--- a/gencode.h
+++ b/gencode.h
 #define A_CONNECTACK   44      /* Connect Ack message */
 #define A_RELEASE      45      /* Release message */
 #define A_RELEASE_DONE 46      /* Release message */
+
 /* ATM field types */
 #define A_VPI          51
 #define A_VCI          52
index ad98964648e8aedb46dffe7a7fc9b8812df9d7c0..995a514e3edb2c0732f87e0503edb2b864e14b11 100644 (file)
--- a/grammar.y
+++ b/grammar.y
@@ -300,7 +300,7 @@ pfaction_to_num(const char *action)
 %token  IPV6 ICMPV6 AH ESP
 %token VLAN MPLS
 %token PPPOED PPPOES GENEVE
-%token  ISO ESIS CLNP ISIS L1 L2 IIH LSP SNP CSNP PSNP 
+%token  ISO ESIS CLNP ISIS L1 L2 IIH LSP SNP CSNP PSNP
 %token  STP
 %token  IPX
 %token  NETBEUI
@@ -310,7 +310,7 @@ pfaction_to_num(const char *action)
 %token RADIO
 %token FISU LSSU MSU HFISU HLSSU HMSU
 %token SIO OPC DPC SLS HSIO HOPC HDPC HSLS
+
 
 %type  <s> ID
 %type  <e> EID
@@ -386,7 +386,7 @@ nid:          ID                    { $$.b = gen_scode($1, $$.q = $<blk>0.q); }
                                        "in this configuration");
 #endif /*INET6*/
                                }
-       | EID                   { 
+       | EID                   {
                                  $$.b = gen_ecode($1, $$.q = $<blk>0.q);
                                  /*
                                   * $1 was allocated by "pcap_ether_aton()",
index ebc66913e94018bd82ce82789525e7f67ff340b8..058b26c82d24335834ad0472109d0cbc1c829084 100755 (executable)
@@ -115,7 +115,7 @@ fi
 if [ x"$dir_arg" != x ]; then
        dst=$src
        src=""
-       
+
        if [ -d $dst ]; then
                instcmd=:
        else
@@ -124,7 +124,7 @@ if [ x"$dir_arg" != x ]; then
 else
 
 # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
+# might cause directories to be created, which would be especially bad
 # if $src (and thus $dsttmp) contains '*'.
 
        if [ -f $src -o -d $src ]
@@ -134,7 +134,7 @@ else
                echo "install:  $src does not exist"
                exit 1
        fi
-       
+
        if [ x"$dst" = x ]
        then
                echo "install:  no destination specified"
@@ -162,7 +162,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
 
 # Skip lots of stat calls in the usual case.
 if [ ! -d "$dstdir" ]; then
-defaultIFS='   
+defaultIFS='
 '
 IFS="${IFS-${defaultIFS}}"
 
@@ -201,17 +201,17 @@ else
 
 # If we're going to rename the final executable, determine the name now.
 
-       if [ x"$transformarg" = x ] 
+       if [ x"$transformarg" = x ]
        then
                dstfile=`basename $dst`
        else
-               dstfile=`basename $dst $transformbasename | 
+               dstfile=`basename $dst $transformbasename |
                        sed $transformarg`$transformbasename
        fi
 
 # don't allow the sed command to completely eliminate the filename
 
-       if [ x"$dstfile" = x ] 
+       if [ x"$dstfile" = x ]
        then
                dstfile=`basename $dst`
        else
@@ -242,7 +242,7 @@ else
 # Now rename the file to the real destination.
 
        $doit $rmcmd -f $dstdir/$dstfile &&
-       $doit $mvcmd $dsttmp $dstdir/$dstfile 
+       $doit $mvcmd $dsttmp $dstdir/$dstfile
 
 fi &&
 
index 6b87bc055c294bebeb41bfcbfdde45e971bab3f6..f461eeaff5e61de26af17d7efd3fa3fa91c92cbe 100644 (file)
@@ -23,4 +23,4 @@
 int    snprintf(char *, size_t, const char *, ...);
 int    vsnprintf(char *, size_t, const char *, va_list);
 int    pfopen(char *, int);
-   
+
index 4c73c69f4a71c2ce6afec999248c0775a7ae0bd4..52ab1750e1fd18b349dfcd3c1b2dd9745d3c07da 100644 (file)
@@ -27,4 +27,4 @@
 int    snprintf(char *, size_t, const char *, ...);
 int    vsnprintf(char *, size_t, const char *, va_list);
 int    pfopen(char *, int);
-   
+
index 28e3f2d711201a23a12df8e4cff1a1924786ed7b..ae20ada3d6b41df62a6d0ece33bcb9ff4a225afb 100644 (file)
@@ -104,7 +104,7 @@ depend: $(PREREQUISITES)
 
 #
 # Manually generated dependencies
-#             
+#
 msdos/pktdrvr.c: msdos/pkt_stub.inc
 scanner.c: scanner.l
 grammar.c tokdefs.h: grammar.y
index 913c4e6970426793dec2fa473549c4c70879d86f..353d0cca06eb2542fb8a044d89b78b8aa24e058a 100644 (file)
@@ -132,7 +132,7 @@ Extensions to libpcap
 
 I've included some extra functions to DOS-libpcap:
 
-  `pcap_config_hook (const char *name, const char *value)' 
+  `pcap_config_hook (const char *name, const char *value)'
 
     Allows an application to set values of internal libpcap variables.
     `name' is typically a left-side keyword with an associated `value'
index 2dedd4ad02fe94953973037299f45371a3e68fba..b1da1a00325860b9555eacdfd3841911035fc44a 100644 (file)
@@ -235,7 +235,7 @@ static int pcap_set_datalink_bpf(pcap_t *p, int dlt);
  */
 static int
 pcap_getnonblock_bpf(pcap_t *p, char *errbuf)
-{ 
+{
 #ifdef HAVE_ZEROCOPY_BPF
        struct pcap_bpf *pb = p->priv;
 
@@ -247,7 +247,7 @@ pcap_getnonblock_bpf(pcap_t *p, char *errbuf)
 
 static int
 pcap_setnonblock_bpf(pcap_t *p, int nonblock, char *errbuf)
-{   
+{
 #ifdef HAVE_ZEROCOPY_BPF
        struct pcap_bpf *pb = p->priv;
 
index 93745229336206d17213ba52e7381a06d3d6f15a..ebb64c3f96fa845b414699839096aef9eefe1c46 100644 (file)
@@ -4,7 +4,7 @@
  *
  * This code is derived from the Stanford/CMU enet packet filter,
  * (net/enet.c) distributed as part of 4.3BSD, and code contributed
- * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
  * Berkeley Laboratory.
  *
  * Redistribution and use in source and binary forms, with or without
index a32691d348c3bbdc2a9eecce220a67f1e82adfcc..5bb627a82423b008a5cb3357eca9ce88e0a6abd3 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -31,7 +31,7 @@
  * By Paolo Abeni <[email protected]>
  *
  */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -73,7 +73,7 @@ struct pcap_bt {
        int dev_id;             /* device ID of device we're bound to */
 };
 
-int 
+int
 bt_findalldevs(pcap_if_t **alldevsp, char *err_str)
 {
        struct hci_dev_list_req *dev_list;
@@ -84,7 +84,7 @@ bt_findalldevs(pcap_if_t **alldevsp, char *err_str)
        sock  = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
        if (sock < 0)
        {
-               /* if bluetooth is not supported this this is not fatal*/ 
+               /* if bluetooth is not supported this this is not fatal*/
                if (errno == EAFNOSUPPORT)
                        return 0;
                snprintf(err_str, PCAP_ERRBUF_SIZE,
@@ -93,7 +93,7 @@ bt_findalldevs(pcap_if_t **alldevsp, char *err_str)
        }
 
        dev_list = malloc(HCI_MAX_DEV * sizeof(*dev_req) + sizeof(*dev_list));
-       if (!dev_list) 
+       if (!dev_list)
        {
                snprintf(err_str, PCAP_ERRBUF_SIZE, "Can't allocate %zu bytes for Bluetooth device list",
                        HCI_MAX_DEV * sizeof(*dev_req) + sizeof(*dev_list));
@@ -103,7 +103,7 @@ bt_findalldevs(pcap_if_t **alldevsp, char *err_str)
 
        dev_list->dev_num = HCI_MAX_DEV;
 
-       if (ioctl(sock, HCIGETDEVLIST, (void *) dev_list) < 0) 
+       if (ioctl(sock, HCIGETDEVLIST, (void *) dev_list) < 0)
        {
                snprintf(err_str, PCAP_ERRBUF_SIZE,
                    "Can't get Bluetooth device list via ioctl: %s",
@@ -115,11 +115,11 @@ bt_findalldevs(pcap_if_t **alldevsp, char *err_str)
        dev_req = dev_list->dev_req;
        for (i = 0; i < dev_list->dev_num; i++, dev_req++) {
                char dev_name[20], dev_descr[30];
-               
+
                snprintf(dev_name, 20, BT_IFACE"%d", dev_req->dev_id);
                snprintf(dev_descr, 30, "Bluetooth adapter number %d", i);
-                       
-               if (pcap_add_if(alldevsp, dev_name, 0, 
+
+               if (pcap_add_if(alldevsp, dev_name, 0,
                       dev_descr, err_str) < 0)
                {
                        ret = -1;
@@ -193,7 +193,7 @@ bt_activate(pcap_t* handle)
        if (sscanf(handle->opt.source, BT_IFACE"%d", &dev_id) != 1)
        {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
-                       "Can't get Bluetooth device index from %s", 
+                       "Can't get Bluetooth device index from %s",
                         handle->opt.source);
                return PCAP_ERROR;
        }
@@ -212,7 +212,7 @@ bt_activate(pcap_t* handle)
        handle->setnonblock_op = pcap_setnonblock_fd;
        handle->stats_op = bt_stats_linux;
        handlep->dev_id = dev_id;
-       
+
        /* Create HCI socket */
        handle->fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
        if (handle->fd < 0) {
@@ -242,10 +242,10 @@ bt_activate(pcap_t* handle)
                goto close_fail;
        }
 
-       /* Setup filter, do not call hci function to avoid dependence on 
+       /* Setup filter, do not call hci function to avoid dependence on
         * external libs        */
        memset(&flt, 0, sizeof(flt));
-       memset((void *) &flt.type_mask, 0xff, sizeof(flt.type_mask));   
+       memset((void *) &flt.type_mask, 0xff, sizeof(flt.type_mask));
        memset((void *) &flt.event_mask, 0xff, sizeof(flt.event_mask));
        if (setsockopt(handle->fd, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
@@ -309,7 +309,7 @@ bt_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *us
        bthdr = (pcap_bluetooth_h4_header*) &handle->buffer[handle->offset];
        iv.iov_base = &handle->buffer[handle->offset+sizeof(pcap_bluetooth_h4_header)];
        iv.iov_len  = handle->snapshot;
-       
+
        memset(&msg, 0, sizeof(msg));
        msg.msg_iov = &iv;
        msg.msg_iovlen = 1;
@@ -334,7 +334,7 @@ bt_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *us
 
        pkth.caplen = ret;
 
-       /* get direction and timestamp*/ 
+       /* get direction and timestamp*/
        cmsg = CMSG_FIRSTHDR(&msg);
        int in=0;
        while (cmsg) {
@@ -349,7 +349,7 @@ bt_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *us
                }
                cmsg = CMSG_NXTHDR(&msg, cmsg);
        }
-       if ((in && (handle->direction == PCAP_D_OUT)) || 
+       if ((in && (handle->direction == PCAP_D_OUT)) ||
                                ((!in) && (handle->direction == PCAP_D_IN)))
                return 0;
 
@@ -371,10 +371,10 @@ bt_inject_linux(pcap_t *handle, const void *buf, size_t size)
        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "inject not supported on "
                "bluetooth devices");
        return (-1);
-}                           
+}
 
 
-static int 
+static int
 bt_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 {
        struct pcap_bt *handlep = handle->priv;
@@ -382,28 +382,28 @@ bt_stats_linux(pcap_t *handle, struct pcap_stat *stats)
        struct hci_dev_info dev_info;
        struct hci_dev_stats * s = &dev_info.stat;
        dev_info.dev_id = handlep->dev_id;
-       
+
        /* ignore eintr */
        do {
                ret = ioctl(handle->fd, HCIGETDEVINFO, (void *)&dev_info);
        } while ((ret == -1) && (errno == EINTR));
-           
+       
        if (ret < 0) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
                    "Can't get stats via ioctl: %s", strerror(errno));
                return (-1);
-               
+
        }
 
-       /* we receive both rx and tx frames, so comulate all stats */   
-       stats->ps_recv = s->evt_rx + s->acl_rx + s->sco_rx + s->cmd_tx + 
+       /* we receive both rx and tx frames, so comulate all stats */
+       stats->ps_recv = s->evt_rx + s->acl_rx + s->sco_rx + s->cmd_tx +
                s->acl_tx +s->sco_tx;
        stats->ps_drop = s->err_rx + s->err_tx;
        stats->ps_ifdrop = 0;
        return 0;
 }
 
-static int 
+static int
 bt_setdirection_linux(pcap_t *p, pcap_direction_t d)
 {
        p->direction = d;
index cacbd2f10dbd090b58d5abb384b1382a80a67d2f..e098654dcbc8e2da56302584958e96db85add6ec 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
index 99776f4dde3badd1bd3763006214889b926c6c5e..f44c45e801c465ff8cb774a0e3b8ed79615b73d1 100644 (file)
@@ -93,7 +93,7 @@ int canusb_findalldevs(pcap_if_t **alldevsp, char *err_str)
     libusb_device** devs;
     unsigned char sernum[65];
     int cnt, i;
-    
+
     if (libusb_init(&fdctx) != 0) {
         /*
          * XXX - if this doesn't just mean "no USB file system mounted",
@@ -101,7 +101,7 @@ int canusb_findalldevs(pcap_if_t **alldevsp, char *err_str)
          * saying "no CANUSB devices".
          */
         return 0;
-    } 
+    }
 
     cnt = libusb_get_device_list(fdctx,&devs);
 
@@ -112,24 +112,24 @@ int canusb_findalldevs(pcap_if_t **alldevsp, char *err_str)
         struct libusb_device_descriptor desc;
         libusb_get_device_descriptor(devs[i],&desc);
 
-        if ((desc.idVendor != CANUSB_VID) || (desc.idProduct != CANUSB_PID)) 
+        if ((desc.idVendor != CANUSB_VID) || (desc.idProduct != CANUSB_PID))
             continue; //It is not, check next device
-          
+
         //It is!
         libusb_device_handle *dh = NULL;
 
         if ((ret = libusb_open(devs[i],&dh)) == 0)
         {
             char dev_name[30];
-            char dev_descr[50]; 
+            char dev_descr[50];
             int n = libusb_get_string_descriptor_ascii(dh,desc.iSerialNumber,sernum,64);
             sernum[n] = 0;
 
             snprintf(dev_name, 30, CANUSB_IFACE"%s", sernum);
             snprintf(dev_descr, 50, "CanUSB [%s]", sernum);
-            
+
             libusb_close(dh);
-            
+
             if (pcap_add_if(alldevsp, dev_name, 0, dev_descr, err_str) < 0)
             {
                 libusb_free_device_list(devs,1);
@@ -149,18 +149,18 @@ static libusb_device_handle* canusb_opendevice(struct libusb_context *ctx, char*
     libusb_device** devs;
     unsigned char serial[65];
     int cnt,i,n;
-    
+
     cnt = libusb_get_device_list(ctx,&devs);
 
     for(i=0;i<cnt;i++)
-    {    
+    {
         // Check if this device is interesting.
         struct libusb_device_descriptor desc;
         libusb_get_device_descriptor(devs[i],&desc);
 
         if ((desc.idVendor != CANUSB_VID) || (desc.idProduct != CANUSB_PID))
           continue;
-          
+
         //Found one!
         libusb_device_handle *dh = NULL;
 
@@ -192,9 +192,9 @@ static libusb_device_handle* canusb_opendevice(struct libusb_context *ctx, char*
             libusb_close(dh);
             continue;
         }
-        
+
         //Fount it!
-        libusb_free_device_list(devs,1);        
+        libusb_free_device_list(devs,1);
         return dh;
     }
 
@@ -205,7 +205,7 @@ static libusb_device_handle* canusb_opendevice(struct libusb_context *ctx, char*
 
 pcap_t *
 canusb_create(const char *device, char *ebuf, int *is_ours)
-{ 
+{
     const char *cp;
     char *cpend;
     long devnum;
@@ -259,31 +259,31 @@ static void* canusb_capture_thread(void *arg)
 {
     struct pcap_canusb *canusb = arg;
     int i;
-    struct 
+    struct
     {
       uint8_t rxsz, txsz;
     } status;
-  
-    fcntl(canusb->wrpipe, F_SETFL, O_NONBLOCK);  
+
+    fcntl(canusb->wrpipe, F_SETFL, O_NONBLOCK);
 
     while(canusb->loop)
     {
         int sz;
         struct CAN_Msg msg;
-    
+
+        libusb_interrupt_transfer(canusb->dev, 0x81, (unsigned char*)&status, sizeof(status), &sz, 100);
+        //HACK!!!!! -> drop buffered data, read new one by reading twice.
         libusb_interrupt_transfer(canusb->dev, 0x81, (unsigned char*)&status, sizeof(status), &sz, 100);
-        //HACK!!!!! -> drop buffered data, read new one by reading twice.        
-        libusb_interrupt_transfer(canusb->dev, 0x81, (unsigned char*)&status, sizeof(status), &sz, 100);                                   
 
         for(i = 0; i<status.rxsz; i++)
         {
-            libusb_bulk_transfer(canusb->dev, 0x85, (unsigned char*)&msg, sizeof(msg), &sz, 100);      
+            libusb_bulk_transfer(canusb->dev, 0x85, (unsigned char*)&msg, sizeof(msg), &sz, 100);
             if(write(canusb->wrpipe, &msg, sizeof(msg)) < 0)
                 fprintf(stderr,"write() error: %s\n", strerror(errno));
         }
 
     }
-  
+
     return NULL;
 }
 
@@ -297,7 +297,7 @@ static int canusb_startcapture(struct pcap_canusb* this)
     this->rdpipe = pipefd[0];
     this->wrpipe = pipefd[1];
 
-    this->loop = 1;  
+    this->loop = 1;
     pthread_create(&this->worker, NULL, canusb_capture_thread, this);
 
     return this->rdpipe;
@@ -312,7 +312,7 @@ static void canusb_clearbufs(struct pcap_canusb* this)
     cmd[1] = 1;  //Empty outgoing buffer
     cmd[3] = 0;  //Not a write to serial number
     memset(&cmd[4],0,16-4);
-        
+
     libusb_interrupt_transfer(this->dev, 0x1,cmd,16,&al,100);
 }
 
@@ -328,7 +328,7 @@ static void canusb_close(pcap_t* handle)
     {
         libusb_close(canusb->dev);
         canusb->dev = NULL;
-    }    
+    }
     if (canusb->ctx)
     {
         libusb_exit(canusb->ctx);
@@ -347,9 +347,9 @@ static int canusb_activate(pcap_t* handle)
         /*
          * XXX - what causes this to fail?
          */
-        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "libusb_init() failed");  
+        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "libusb_init() failed");
         return PCAP_ERROR;
-    } 
+    }
 
     handle->read_op = canusb_read_linux;
 
@@ -373,7 +373,7 @@ static int canusb_activate(pcap_t* handle)
     if (!canusb->dev)
     {
         libusb_exit(canusb->ctx);
-        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't open USB Device");  
+        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't open USB Device");
         return PCAP_ERROR;
     }
 
@@ -395,7 +395,7 @@ canusb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char
     int i = 0;
     struct CAN_Msg msg;
     struct pcap_pkthdr pkth;
-  
+
     while(i < max_packets)
     {
         int n;
@@ -406,10 +406,10 @@ canusb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char
         pkth.caplen = pkth.len = n;
         pkth.caplen -= 4;
         pkth.caplen -= 8 - msg.length;
-    
+
         if ((firstpacket.tv_sec == -1) && (firstpacket.tv_usec == -1))
             gettimeofday(&firstpacket, NULL);
-      
+
         pkth.ts.tv_usec = firstpacket.tv_usec + (msg.timestamp % 100) * 10000;
         pkth.ts.tv_sec = firstpacket.tv_usec + (msg.timestamp / 100);
         if (pkth.ts.tv_usec > 1000000)
@@ -421,7 +421,7 @@ canusb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char
         callback(user, &pkth, (void*)&msg.id);
         i++;
     }
-  
+
     return i;
 }
 
index 85c0a7c18d073eadc744be03f1b0eded8c43ece2..4db49688547a4a2ce02d52666b0ee132dee3c9ca 100644 (file)
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The Link Types are used for prepending meta-information
  * like interface index, interface name
  * before standard Ethernet, PPP, Frelay & C-HDLC Frames
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ is used for internal communication with a
  * voice Adapter Card (PIC)
  */
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ is used for internal communication with a
  * integrated service module (ISM).
  */
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ is used for capturing data on a secure tunnel interface.
  */
 #define LINKTYPE_JUNIPER_ST     200
  */
 #define LINKTYPE_IEEE802_15_4_NONASK_PHY       215
 
-/* 
+/*
  * David Gibson <[email protected]> requested this for
  * captures from the Linux kernel /dev/input/eventN devices. This
  * is used to communicate keystrokes and mouse movements from the
- * Linux kernel to display systems, such as Xorg. 
+ * Linux kernel to display systems, such as Xorg.
  */
 #define LINKTYPE_LINUX_EVDEV   216
 
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  */
 #define LINKTYPE_JUNIPER_VS                    232
 #define LINKTYPE_JUNIPER_SRX_E2E               233
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  */
 #define LINKTYPE_JUNIPER_ATM_CEMIC             238
 
 /*
- * NetFilter LOG messages 
+ * NetFilter LOG messages
  * (payload of netlink NFNL_SUBSYS_ULOG/NFULNL_MSG_PACKET packets)
  *
  * Requested by Jakub Zawadzki <[email protected]>
 
 /*
  * Link-layer header type for upper-protocol layer PDU saves from wireshark.
- * 
+ *
  * the actual contents are determined by two TAGs stored with each
  * packet:
  *   EXP_PDU_TAG_LINKTYPE          the link type (LINKTYPE_ value) of the
@@ -1170,7 +1170,7 @@ swap_linux_usb_header(const struct pcap_pkthdr *hdr, u_char *buf,
         */
 
        /*
-        * The URB id is a totally opaque value; do we really need to 
+        * The URB id is a totally opaque value; do we really need to
         * convert it to the reading host's byte order???
         */
        offset += 8;                    /* skip past id */
index 099127f7cfcc6c85c8441f92bf91081446214799..491524893e7af9881dbcf0367364c52f48a4fce7 100644 (file)
@@ -151,7 +151,7 @@ dag_platform_cleanup(pcap_t *p)
 #ifdef HAVE_DAG_STREAMS_API
                if(dag_stop_stream(p->fd, pd->dag_stream) < 0)
                        fprintf(stderr,"dag_stop_stream: %s\n", strerror(errno));
-               
+
                if(dag_detach_stream(p->fd, pd->dag_stream) < 0)
                        fprintf(stderr,"dag_detach_stream: %s\n", strerror(errno));
 #else
@@ -222,7 +222,7 @@ dag_erf_ext_header_count(uint8_t * erf, size_t len)
 
        /* loop over the extension headers */
        do {
-       
+
                /* sanity check we have enough bytes */
                if ( len < (24 + (hdr_num * 8)) )
                        return hdr_num;
@@ -253,7 +253,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 
        /* Get the next bufferful of packets (if necessary). */
        while (pd->dag_mem_top - pd->dag_mem_bottom < dag_record_size) {
+
                /*
                 * Has "pcap_breakloop()" been called?
                 */
@@ -292,7 +292,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        /* Pcap is configured to process only available packets, and there aren't any, return immediately. */
                        return 0;
                }
-               
+
                if(!nonblocking &&
                   pd->dag_timeout &&
                   (pd->dag_mem_top - pd->dag_mem_bottom < dag_record_size))
@@ -302,14 +302,14 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                }
 
        }
-       
+
        /* Process the packets. */
        while (pd->dag_mem_top - pd->dag_mem_bottom >= dag_record_size) {
-               
+
                unsigned short packet_len = 0;
                int caplen = 0;
                struct pcap_pkthdr      pcap_header;
-               
+
 #ifdef HAVE_DAG_STREAMS_API
                dag_record_t *header = (dag_record_t *)(pd->dag_mem_bottom);
 #else
@@ -318,7 +318,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 
                u_char *dp = ((u_char *)header); /* + dag_record_size; */
                unsigned short rlen;
+
                /*
                 * Has "pcap_breakloop()" been called?
                 */
@@ -331,7 +331,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        p->break_loop = 0;
                        return -2;
                }
+
                rlen = ntohs(header->rlen);
                if (rlen < dag_record_size)
                {
@@ -361,7 +361,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                                }
                        }
                }
-               
+
                if ((header->type & 0x7f) == TYPE_PAD) {
                        continue;
                }
@@ -369,13 +369,13 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                num_ext_hdr = dag_erf_ext_header_count(dp, rlen);
 
                /* ERF encapsulation */
-               /* The Extensible Record Format is not dropped for this kind of encapsulation, 
+               /* The Extensible Record Format is not dropped for this kind of encapsulation,
                 * and will be handled as a pseudo header by the decoding application.
                 * The information carried in the ERF header and in the optional subheader (if present)
                 * could be merged with the libpcap information, to offer a better decoding.
                 * The packet length is
                 * o the length of the packet on the link (header->wlen),
-                * o plus the length of the ERF header (dag_record_size), as the length of the 
+                * o plus the length of the ERF header (dag_record_size), as the length of the
                 *   pseudo header will be adjusted during the decoding,
                 * o plus the length of the optional subheader (if present).
                 *
@@ -417,7 +417,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        dp += dag_record_size;
                        /* Skip over extension headers */
                        dp += 8 * num_ext_hdr;
-                       
+
                        switch((header->type & 0x7f)) {
                        case TYPE_ATM:
                        case TYPE_AAL5:
@@ -445,13 +445,13 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                                if (p->linktype == DLT_SUNATM) {
                                        struct sunatm_hdr *sunatm = (struct sunatm_hdr *)dp;
                                        unsigned long rawatm;
-                                       
+
                                        rawatm = ntohl(*((unsigned long *)dp));
                                        sunatm->vci = htons((rawatm >>  4) & 0xffff);
                                        sunatm->vpi = (rawatm >> 20) & 0x00ff;
-                                       sunatm->flags = ((header->flags.iface & 1) ? 0x80 : 0x00) | 
+                                       sunatm->flags = ((header->flags.iface & 1) ? 0x80 : 0x00) |
                                                ((sunatm->vpi == 0 && sunatm->vci == htons(5)) ? 6 :
-                                                ((sunatm->vpi == 0 && sunatm->vci == htons(16)) ? 5 : 
+                                                ((sunatm->vpi == 0 && sunatm->vci == htons(16)) ? 5 :
                                                  ((dp[ATM_HDR_SIZE] == 0xaa &&
                                                    dp[ATM_HDR_SIZE+1] == 0xaa &&
                                                    dp[ATM_HDR_SIZE+2] == 0x03) ? 2 : 1)));
@@ -509,7 +509,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                                        /* Add the MTP2 Pseudo Header */
                                        caplen += MTP2_HDR_LEN;
                                        packet_len += MTP2_HDR_LEN;
-                                       
+
                                        TempPkt[MTP2_SENT_OFFSET] = 0;
                                        TempPkt[MTP2_ANNEX_A_USED_OFFSET] = MTP2_ANNEX_A_USED_UNKNOWN;
                                        *(TempPkt+MTP2_LINK_NUMBER_OFFSET) = ((header->rec.mc_hdlc.mc_header>>16)&0x01);
@@ -547,16 +547,16 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        } /* switch type */
 
                } /* ERF encapsulation */
-               
+
                if (caplen > p->snapshot)
                        caplen = p->snapshot;
 
                /* Run the packet filter if there is one. */
                if ((p->fcode.bf_insns == NULL) || bpf_filter(p->fcode.bf_insns, dp, packet_len, caplen)) {
-                       
+
                        /* convert between timestamp formats */
                        register unsigned long long ts;
-                               
+
                        if (IS_BIGENDIAN()) {
                                ts = SWAPLL(header->ts);
                        } else {
@@ -576,7 +576,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        pcap_header.ts.tv_sec = ts >> 32;
                        ts = (ts & 0xffffffffULL) * ticks_per_second;
                        ts += 0x80000000; /* rounding */
-                       pcap_header.ts.tv_usec = ts >> 32;              
+                       pcap_header.ts.tv_usec = ts >> 32;
                        if (pcap_header.ts.tv_usec >= ticks_per_second) {
                                pcap_header.ts.tv_usec -= ticks_per_second;
                                pcap_header.ts.tv_sec++;
@@ -585,13 +585,13 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        /* Fill in our own header data */
                        pcap_header.caplen = caplen;
                        pcap_header.len = packet_len;
-       
+
                        /* Count the packet. */
                        pd->stat.ps_recv++;
-       
+
                        /* Call the user supplied callback function */
                        callback(user, &pcap_header, dp);
-       
+
                        /* Only count packets that pass the filter, for consistency with standard Linux behaviour. */
                        processed++;
                        if (processed == cnt && !PACKET_COUNT_IS_UNLIMITED(cnt))
@@ -618,7 +618,7 @@ dag_inject(pcap_t *p, const void *buf _U_, size_t size _U_)
  *  device will result in a failure.  The promisc flag is ignored because DAG
  *  cards are always promiscuous.  The to_ms parameter is used in setting the
  *  API polling parameters.
- *  
+ *
  *  snaplen is now also ignored, until we get per-stream slen support. Set
  *  slen with approprite DAG tool BEFORE pcap_activate().
  *
@@ -654,7 +654,7 @@ static int dag_activate(pcap_t* handle)
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "Can't allocate string for device name: %s\n", pcap_strerror(errno));
                goto fail;
        }
-       
+
        /* Parse input name to get dag device and stream number if provided */
        if (dag_parse_name(device, newDev, strlen(device) + 16, &handlep->dag_stream) < 0) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dag_parse_name: %s\n", pcap_strerror(errno));
@@ -700,7 +700,7 @@ static int dag_activate(pcap_t* handle)
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dag_get_stream_poll: %s\n", pcap_strerror(errno));
                goto faildetach;
        }
-       
+
        if (handle->opt.immediate) {
                /* Call callback immediately.
                 * XXX - is this the right way to handle this?
@@ -725,7 +725,7 @@ static int dag_activate(pcap_t* handle)
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dag_set_stream_poll: %s\n", pcap_strerror(errno));
                goto faildetach;
        }
-               
+
 #else
        if((handlep->dag_mem_base = dag_mmap(handle->fd)) == MAP_FAILED) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,"dag_mmap %s: %s\n", device, pcap_strerror(errno));
@@ -748,14 +748,14 @@ static int dag_activate(pcap_t* handle)
                handle->snapshot = MIN_DAG_SNAPLEN;
        }
        /* snap len has to be a multiple of 4 */
-       snprintf(conf, 30, "varlen slen=%d", (snaplen + 3) & ~3); 
+       snprintf(conf, 30, "varlen slen=%d", (snaplen + 3) & ~3);
 
        if(dag_configure(handle->fd, conf) < 0) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,"dag_configure %s: %s\n", device, pcap_strerror(errno));
                goto faildetach;
        }
-#endif 
-       
+#endif
+
 #ifdef HAVE_DAG_STREAMS_API
        if(dag_start_stream(handle->fd, handlep->dag_stream) < 0) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "dag_start_stream %s: %s\n", device, pcap_strerror(errno));
@@ -822,7 +822,7 @@ static int dag_activate(pcap_t* handle)
        handle->linktype = -1;
        if (dag_get_datalink(handle) < 0)
                goto failstop;
-       
+
        handle->bufsize = 0;
 
        if (new_pcap_dag(handle) < 0) {
@@ -853,12 +853,12 @@ static int dag_activate(pcap_t* handle)
        handlep->stat.ps_ifdrop = 0;
        return 0;
 
-#ifdef HAVE_DAG_STREAMS_API 
+#ifdef HAVE_DAG_STREAMS_API
 failstop:
        if (dag_stop_stream(handle->fd, handlep->dag_stream) < 0) {
                fprintf(stderr,"dag_stop_stream: %s\n", strerror(errno));
        }
-       
+
 faildetach:
        if (dag_detach_stream(handle->fd, handlep->dag_stream) < 0)
                fprintf(stderr,"dag_detach_stream: %s\n", strerror(errno));
@@ -867,7 +867,7 @@ failstop:
        if (dag_stop(handle->fd) < 0)
                fprintf(stderr,"dag_stop: %s\n", strerror(errno));
 #endif /* HAVE_DAG_STREAMS_API */
-       
+
 failclose:
        if (dag_close(handle->fd) < 0)
                fprintf(stderr,"dag_close: %s\n", strerror(errno));
@@ -969,9 +969,9 @@ dag_stats(pcap_t *p, struct pcap_stat *ps) {
        */
        /*pd->stat.ps_recv = 0;*/
        /*pd->stat.ps_drop = 0;*/
-       
+
        *ps = pd->stat;
+
        return 0;
 }
 
@@ -1028,13 +1028,13 @@ dag_findalldevs(pcap_if_t **devlistp, char *errbuf)
                                                         */
                                                        ret = -1;
                                                }
-                                               
+
                                                rxstreams--;
                                                if(rxstreams <= 0) {
                                                        break;
                                                }
                                        }
-                               }                               
+                               }
                        }
 #endif  /* HAVE_DAG_STREAMS_API */
                        dag_close(dagfd);
@@ -1094,13 +1094,13 @@ dag_setnonblock(pcap_t *p, int nonblock, char *errbuf)
                uint32_t mindata;
                struct timeval maxwait;
                struct timeval poll;
-               
+
                if (dag_get_stream_poll(p->fd, pd->dag_stream,
                                        &mindata, &maxwait, &poll) < 0) {
                        snprintf(errbuf, PCAP_ERRBUF_SIZE, "dag_get_stream_poll: %s\n", pcap_strerror(errno));
                        return -1;
                }
-               
+
                /* Amount of data to collect in Bytes before calling callbacks.
                 * Important for efficiency, but can introduce latency
                 * at low packet rates if to_ms not set!
@@ -1109,7 +1109,7 @@ dag_setnonblock(pcap_t *p, int nonblock, char *errbuf)
                        mindata = 0;
                else
                        mindata = 65536;
-               
+
                if (dag_set_stream_poll(p->fd, pd->dag_stream,
                                        mindata, &maxwait, &poll) < 0) {
                        snprintf(errbuf, PCAP_ERRBUF_SIZE, "dag_set_stream_poll: %s\n", pcap_strerror(errno));
@@ -1124,7 +1124,7 @@ dag_setnonblock(pcap_t *p, int nonblock, char *errbuf)
        }
        return (0);
 }
-               
+
 static int
 dag_get_datalink(pcap_t *p)
 {
@@ -1145,18 +1145,18 @@ dag_get_datalink(pcap_t *p)
        /* Get list of possible ERF types for this card */
        if (dag_get_stream_erf_types(p->fd, pd->dag_stream, types, 255) < 0) {
                snprintf(p->errbuf, sizeof(p->errbuf), "dag_get_stream_erf_types: %s", pcap_strerror(errno));
-               return (-1);            
+               return (-1);
        }
-       
+
        while (types[index]) {
 
 #elif defined HAVE_DAG_GET_ERF_TYPES
        /* Get list of possible ERF types for this card */
        if (dag_get_erf_types(p->fd, types, 255) < 0) {
                snprintf(p->errbuf, sizeof(p->errbuf), "dag_get_erf_types: %s", pcap_strerror(errno));
-               return (-1);            
+               return (-1);
        }
-       
+
        while (types[index]) {
 #else
        /* Check the type through a dagapi call. */
@@ -1202,7 +1202,7 @@ dag_get_datalink(pcap_t *p)
                                p->linktype = DLT_EN10MB;
                        break;
 
-               case TYPE_ATM: 
+               case TYPE_ATM:
                case TYPE_AAL5:
                case TYPE_MC_ATM:
                case TYPE_MC_AAL5:
index c878353b9f4bfd1ee9ebdf65965b72669fb90079..ab3f12581efaed876d20ddd633a2f26a99c1623f 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -122,7 +122,7 @@ dbus_write(pcap_t *handle, const void *buf, size_t size)
 
        dbus_message_unref(msg);
        return 0;
-}                           
+}
 
 static int
 dbus_stats(pcap_t *handle, struct pcap_stat *stats)
@@ -250,8 +250,8 @@ dbus_create(const char *device, char *ebuf, int *is_ours)
 {
        pcap_t *p;
 
-       if (strcmp(device, "dbus-system") && 
-               strcmp(device, "dbus-session") && 
+       if (strcmp(device, "dbus-system") &&
+               strcmp(device, "dbus-session") &&
                strncmp(device, "dbus://", 7))
        {
                *is_ours = 0;
@@ -267,7 +267,7 @@ dbus_create(const char *device, char *ebuf, int *is_ours)
        return (p);
 }
 
-int 
+int
 dbus_findalldevs(pcap_if_t **alldevsp, char *err_str)
 {
        if (pcap_add_if(alldevsp, "dbus-system", 0, "D-Bus system bus", err_str) < 0)
index 459860066eb660f9ed482001c61dc979489c6ef0..c0071352674bd3fec072a92c7c0b99f54e641e38 100644 (file)
@@ -298,7 +298,7 @@ pcap_inject_dlpi(pcap_t *p, const void *buf, size_t size)
        ret = -1;
 #endif /* raw mode */
        return (ret);
-}   
+}
 
 #ifndef DL_IPATM
 #define DL_IPATM       0x12    /* ATM Classical IP interface */
index 43f50c7f13b253eb4a65440abe81f9986210c1bd..8632cee66b03a6621c24f8ca2541bfc3ee4ebcf7 100644 (file)
@@ -166,7 +166,7 @@ pcap_t *pcap_create_interface (const char *device, char *ebuf)
  * network packets.
  */
 static int pcap_activate_dos (pcap_t *pcap)
-{ 
+{
   struct pcap_dos *pcapd = pcap->priv;
 
   if (pcap->opt.rfmon) {
@@ -197,7 +197,7 @@ static int pcap_activate_dos (pcap_t *pcap)
         !first_init(pcap->opt.source, pcap->errbuf, pcap->opt.promisc))
     {
       return (PCAP_ERROR);
-    } 
+    }
     atexit (close_driver);
   }
   else if (stricmp(active_dev->name,pcap->opt.source))
@@ -401,7 +401,7 @@ int pcap_stats_ex (pcap_t *p, struct pcap_stat_ex *se)
     strlcpy (p->errbuf, "pktdrvr doesn't have detailed statistics",
              PCAP_ERRBUF_SIZE);
     return (-1);
-  }             
+  }
   memcpy (se, (*dev->get_stats)(dev), sizeof(*se));
   return (0);
 }
@@ -520,7 +520,7 @@ int pcap_lookupnet (const char *device, bpf_u_int32 *localnet,
   }
   ARGSUSED (device);
   return (0);
-}      
+}
 
 /*
  * Get a list of all interfaces that are present and that we probe okay.
@@ -960,7 +960,7 @@ static int init_watt32 (struct pcap *pcap, const char *dev_name, char *err_buf)
    *            have default values. Should be taken from another
    *            ini-file/environment in any case (ref. tcpdump.ini)
    */
-  _watt_is_init = 1;  
+  _watt_is_init = 1;
 
   if (!using_pktdrv || !has_ip_addr)  /* for now .... */
   {
@@ -1092,7 +1092,7 @@ static int pkt_open (struct device *dev)
 
   if (!PktInitDriver(mode))
      return (0);
+
   PktResetStatistics (pktInfo.handle);
   PktQueueBusy (FALSE);
   return (1);
@@ -1290,7 +1290,7 @@ struct device rtl8139_dev LOCKED_VAR = {
               0,0,0,0,0,0,
               &cs89_dev,
               rtl8139_probe     /* dev->probe routine */
-            };            
+            };
 
 /*
  * Dequeue routine is called by polling.
index 8f92252ba26852ece89b9aff823749aeac2da368..bf47fb511ecee078caa613819b7a2e516cc86844 100644 (file)
@@ -214,7 +214,7 @@ extern void _w32_os_yield (void); /* Watt-32's misc.c */
   #define PCAP_ASSERT(x) ((void)0)
 
 #else
-  void pcap_assert (const char *what, const char *file, unsigned line);  
+  void pcap_assert (const char *what, const char *file, unsigned line);
 
   #define PCAP_ASSERT(x) do { \
                            if (!(x)) \
index 4c84ebf5c587ef1214b644655fb9f605306a0cb2..d7401946714347f235536c3e59014044810d63ca 100644 (file)
@@ -697,7 +697,7 @@ changes the decoding offsets for the remainder of \fIexpression\fR on
 the assumption that the packet is a MPLS-encapsulated IP packet.  The
 \fBmpls \fI[label_num]\fR expression may be used more than once, to
 filter on MPLS hierarchies.  Each use of that expression increments the
-filter offsets by 4. 
+filter offsets by 4.
 .IP
 For example:
 .in +.5i
index 32faeb7d9bc40a554049f4c122e9bacf2b59539d..cd32e065c54f2351419b505e49e1cee82af8efff 100644 (file)
  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  *  Modifications:     Added PACKET_MMAP support
- *                     Paolo Abeni <[email protected]> 
+ *                     Paolo Abeni <[email protected]>
  *                     Added TPACKET_V3 support
  *                     Gabor Tatarka <[email protected]>
- *                     
+ *
  *                     based on previous works of:
  *                     Simon Patarin <[email protected]>
  *                     Phil Wood <[email protected]>
@@ -47,7 +47,7 @@
  * 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. 
+ *    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 AUTHOR ``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.  
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  * IN NO EVENT SHALL THE AUTHOR 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, 
+ * 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.
 # endif /* PACKET_HOST */
 
 
- /* check for memory mapped access avaibility. We assume every needed 
+ /* check for memory mapped access avaibility. We assume every needed
   * struct is defined if the macro TPACKET_HDRLEN is defined, because it
   * uses many ring related structs and macros */
 # ifdef PCAP_SUPPORT_PACKET_RING
@@ -1032,7 +1032,7 @@ linux_if_drops(const char * if_name)
        FILE * file;
        int field_to_convert = 3, if_name_sz = strlen(if_name);
        long int dropped_pkts = 0;
-       
+
        file = fopen("/proc/net/dev", "r");
        if (!file)
                return 0;
@@ -1047,7 +1047,7 @@ linux_if_drops(const char * if_name)
                        field_to_convert = 4;
                        continue;
                }
-       
+
                /* find iface and make sure it actually matches -- space before the name and : after it */
                if ((bufptr = strstr(buffer, if_name)) &&
                        (bufptr == buffer || *(bufptr-1) == ' ') &&
@@ -1061,20 +1061,20 @@ linux_if_drops(const char * if_name)
                                while (*bufptr != '\0' && *(bufptr++) == ' ');
                                while (*bufptr != '\0' && *(bufptr++) != ' ');
                        }
-                       
+
                        /* get rid of any final spaces */
                        while (*bufptr != '\0' && *bufptr == ' ') bufptr++;
-                       
+
                        if (*bufptr != '\0')
                                dropped_pkts = strtol(bufptr, NULL, 10);
 
                        break;
                }
        }
-       
+
        fclose(file);
        return dropped_pkts;
-} 
+}
 
 
 /*
@@ -1309,12 +1309,12 @@ pcap_activate_linux(pcap_t *handle)
                         pcap_strerror(errno) );
                return PCAP_ERROR;
        }
-       
+
        /* copy timeout value */
        handlep->timeout = handle->opt.timeout;
 
        /*
-        * If we're in promiscuous mode, then we probably want 
+        * If we're in promiscuous mode, then we probably want
         * to see when the interface drops packets too, so get an
         * initial count from /proc/net/dev
         */
@@ -1874,7 +1874,7 @@ pcap_inject_linux(pcap_t *handle, const void *buf, size_t size)
                return (-1);
        }
        return (ret);
-}                           
+}
 
 /*
  *  Get the statistics for the given packet capture handle.
@@ -1912,8 +1912,8 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 #endif /* HAVE_TPACKET_STATS */
 
        long if_dropped = 0;
-       
-       /* 
+
+       /*
         *      To fill in ps_ifdrop, we parse /proc/net/dev for the number
         */
        if (handle->opt.promisc)
@@ -1943,7 +1943,7 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats)
                 *      dropped by the interface driver.  It counts only
                 *      packets that passed the filter.
                 *
-                *      See above for ps_ifdrop. 
+                *      See above for ps_ifdrop.
                 *
                 *      Both statistics include packets not yet read from
                 *      the kernel by libpcap, and thus not yet seen by
@@ -1972,7 +1972,7 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats)
                 * "tp_packets" as the count of packets and "tp_drops"
                 * as the count of drops.
                 *
-                * Keep a running total because each call to 
+                * Keep a running total because each call to
                 *    getsockopt(handle->fd, SOL_PACKET, PACKET_STATISTICS, ....
                 * resets the counters to zero.
                 */
@@ -2018,10 +2018,10 @@ pcap_stats_linux(pcap_t *handle, struct pcap_stat *stats)
         * We maintain the count of packets processed by libpcap in
         * "handlep->packets_read", for reasons described in the comment
         * at the end of pcap_read_packet().  We have no idea how many
-        * packets were dropped by the kernel buffers -- but we know 
+        * packets were dropped by the kernel buffers -- but we know
         * how many the interface dropped, so we can return that.
         */
-        
+       
        stats->ps_recv = handlep->packets_read;
        stats->ps_drop = 0;
        stats->ps_ifdrop = handlep->stat.ps_ifdrop;
@@ -2682,7 +2682,7 @@ static void map_arphrd_to_dlt(pcap_t *handle, int sock_fd, int arptype,
                        handle->linktype = DLT_RAW;
                        return;
                }
-       
+
                /*
                 * Is this a real Ethernet device?  If so, give it a
                 * link-layer-type list with DLT_EN10MB and DLT_DOCSIS, so
@@ -3472,7 +3472,7 @@ activate_new(pcap_t *handle)
  * On error, returns -1, and sets *status to the appropriate error code;
  * if that is PCAP_ERROR, sets handle->errbuf to the appropriate message.
  */
-static int 
+static int
 activate_mmap(pcap_t *handle, int *status)
 {
        struct pcap_linux *handlep = handle->priv;
@@ -3556,7 +3556,7 @@ activate_mmap(pcap_t *handle, int *status)
        return 1;
 }
 #else /* HAVE_PACKET_RING */
-static int 
+static int
 activate_mmap(pcap_t *handle _U_, int *status _U_)
 {
        return 0;
@@ -3945,12 +3945,12 @@ create_ring(pcap_t *handle, int *status)
                return -1;
        }
 
-       /* compute the minumum block size that will handle this frame. 
-        * The block has to be page size aligned. 
-        * The max block size allowed by the kernel is arch-dependent and 
+       /* compute the minumum block size that will handle this frame.
+        * The block has to be page size aligned.
+        * The max block size allowed by the kernel is arch-dependent and
         * it's not explicitly checked here. */
        req.tp_block_size = getpagesize();
-       while (req.tp_block_size < req.tp_frame_size) 
+       while (req.tp_block_size < req.tp_frame_size)
                req.tp_block_size <<= 1;
 
        frames_per_block = req.tp_block_size/req.tp_frame_size;
@@ -4048,8 +4048,8 @@ create_ring(pcap_t *handle, int *status)
                        }
                        if (setsockopt(handle->fd, SOL_PACKET, PACKET_TIMESTAMP,
                                (void *)&timesource, sizeof(timesource))) {
-                               snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, 
-                                       "can't set PACKET_TIMESTAMP: %s", 
+                               snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
+                                       "can't set PACKET_TIMESTAMP: %s",
                                        pcap_strerror(errno));
                                *status = PCAP_ERROR;
                                return -1;
@@ -4064,7 +4064,7 @@ retry:
 
        /* req.tp_frame_nr is requested to match frames_per_block*req.tp_block_nr */
        req.tp_frame_nr = req.tp_block_nr * frames_per_block;
-       
+
 #ifdef HAVE_TPACKET3
        /* timeout value to retire block - use the configured buffering timeout, or default if <0. */
        req.tp_retire_blk_tov = (handlep->timeout>=0)?handlep->timeout:0;
@@ -4197,7 +4197,7 @@ pcap_oneshot_mmap(u_char *user, const struct pcap_pkthdr *h,
        memcpy(handlep->oneshot_buffer, bytes, h->caplen);
        *sp->pkt = handlep->oneshot_buffer;
 }
-    
+
 static void
 pcap_cleanup_linux_mmap( pcap_t *handle )
 {
@@ -4891,7 +4891,7 @@ again:
 }
 #endif /* HAVE_TPACKET3 */
 
-static int 
+static int
 pcap_setfilter_linux_mmap(pcap_t *handle, struct bpf_program *filter)
 {
        struct pcap_linux *handlep = handle->priv;
@@ -5903,7 +5903,7 @@ iface_ethtool_flag_ioctl(pcap_t *handle, int cmd, const char *cmdname)
                    cmdname, strerror(errno));
                return -1;
        }
-       return eval.data;       
+       return eval.data;
 }
 
 static int
index 9e61e455dbfefd34f5fd6d898ab5bb0f97def081..3ee6faa3b7b8af0c28d0884ec6266465c4f2b70d 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 #include <linux/netfilter/nfnetlink_queue.h>
 
 /* NOTE: if your program drops privilages after pcap_activate() it WON'T work with nfqueue.
- *       It took me quite some time to debug ;/ 
+ *       It took me quite some time to debug ;/
  *
  *       Sending any data to nfnetlink socket requires CAP_NET_ADMIN privilages,
  *       and in nfqueue we need to send verdict reply after recving packet.
  *
  *       In tcpdump you can disable dropping privilages with -Z root
  */
+
 #include "pcap-netfilter-linux.h"
 
 #define HDR_LENGTH (NLMSG_LENGTH(NLMSG_ALIGN(sizeof(struct nfgenmsg))))
@@ -116,10 +116,10 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c
                        return -1;
                }
 
-               if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_ULOG && 
-                   NFNL_MSG_TYPE(nlh->nlmsg_type) == NFULNL_MSG_PACKET) 
+               if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_ULOG &&
+                   NFNL_MSG_TYPE(nlh->nlmsg_type) == NFULNL_MSG_PACKET)
                        type = NFLOG;
-               else if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_QUEUE && 
+               else if (NFNL_SUBSYS_ID(nlh->nlmsg_type) == NFNL_SUBSYS_QUEUE &&
                         NFNL_MSG_TYPE(nlh->nlmsg_type) == NFQNL_MSG_PACKET)
                        type = NFQUEUE;
 
@@ -184,7 +184,7 @@ netfilter_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_c
 
                                gettimeofday(&pkth.ts, NULL);
                                if (handle->fcode.bf_insns == NULL ||
-                                               bpf_filter(handle->fcode.bf_insns, payload, pkth.len, pkth.caplen)) 
+                                               bpf_filter(handle->fcode.bf_insns, payload, pkth.len, pkth.caplen))
                                {
                                        handlep->packets_read++;
                                        callback(user, &pkth, payload);
@@ -234,7 +234,7 @@ netfilter_inject_linux(pcap_t *handle, const void *buf, size_t size)
 {
        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "inject not supported on netfilter devices");
        return (-1);
-}                           
+}
 
 struct my_nfattr {
        u_int16_t nfa_len;
@@ -252,7 +252,7 @@ netfilter_send_config_msg(const pcap_t *handle, u_int16_t msg_type, int ack, u_i
 
        struct sockaddr_nl snl;
        static unsigned int seq_id;
-       
+
        if (!seq_id)
                seq_id = time(NULL);
        ++seq_id;
@@ -344,7 +344,7 @@ nflog_send_config_cmd(const pcap_t *handle, u_int16_t group_id, u_int8_t cmd, u_
        return nflog_send_config_msg(handle, family, group_id, &nfa);
 }
 
-static int 
+static int
 nflog_send_config_mode(const pcap_t *handle, u_int16_t group_id, u_int8_t copy_mode, u_int32_t copy_range)
 {
        struct nfulnl_msg_config_mode msg;
@@ -398,7 +398,7 @@ nfqueue_send_config_cmd(const pcap_t *handle, u_int16_t group_id, u_int8_t cmd,
        return nfqueue_send_config_msg(handle, AF_UNSPEC, group_id, &nfa);
 }
 
-static int 
+static int
 nfqueue_send_config_mode(const pcap_t *handle, u_int16_t group_id, u_int8_t copy_mode, u_int32_t copy_range)
 {
        struct nfqnl_msg_config_params msg;
@@ -431,7 +431,7 @@ netfilter_activate(pcap_t* handle)
                dev += strlen(NFQUEUE_IFACE);
                type = NFQUEUE;
        }
+
        if (type != OTHER && *dev == ':') {
                dev++;
                while (*dev) {
@@ -440,7 +440,7 @@ netfilter_activate(pcap_t* handle)
 
                        if (group_count == 32) {
                                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
-                                               "Maximum 32 netfilter groups! dev: %s", 
+                                               "Maximum 32 netfilter groups! dev: %s",
                                                handle->opt.source);
                                return PCAP_ERROR;
                        }
@@ -465,7 +465,7 @@ netfilter_activate(pcap_t* handle)
 
        if (type == OTHER || *dev) {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
-                               "Can't get netfilter group(s) index from %s", 
+                               "Can't get netfilter group(s) index from %s",
                                handle->opt.source);
                return PCAP_ERROR;
        }
@@ -602,7 +602,7 @@ netfilter_create(const char *device, char *ebuf, int *is_ours)
        /* Does it begin with NFLOG_IFACE or NFQUEUE_IFACE? */
        if (strncmp(cp, NFLOG_IFACE, sizeof NFLOG_IFACE - 1) == 0)
                cp += sizeof NFLOG_IFACE - 1;
-       else if (strncmp(cp, NFQUEUE_IFACE, sizeof NFQUEUE_IFACE - 1) == 0) 
+       else if (strncmp(cp, NFQUEUE_IFACE, sizeof NFQUEUE_IFACE - 1) == 0)
                cp += sizeof NFQUEUE_IFACE - 1;
        else {
                /* Nope, doesn't begin with NFLOG_IFACE nor NFQUEUE_IFACE */
@@ -631,11 +631,11 @@ netfilter_create(const char *device, char *ebuf, int *is_ours)
        return (p);
 }
 
-int 
+int
 netfilter_findalldevs(pcap_if_t **alldevsp, char *err_str)
 {
        int sock;
-       
+
        sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
        if (sock < 0) {
                /* if netlink is not supported this is not fatal */
index 882a4021917281082c54d48ba9194da3a031ad9e..01d9b394f5a806d6c3129912484937dcbc595e05 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
index ea81eb579f581d30c3133135448c1daf891c0f2b..a8355f9d6cf921ef9bb342a292e13f4f542e70d7 100644 (file)
@@ -211,7 +211,7 @@ pcap_inject_nit(pcap_t *p, const void *buf, size_t size)
                return (-1);
        }
        return (ret);
-}                           
+}
 
 static int
 nit_setflags(pcap_t *p)
index 96a4a50979b44fa344b63aa6d4074eca93b596ff..e03b2ed1f0f32e50a2730f4b33394c46f03dee3e 100644 (file)
--- a/pcap-pf.c
+++ b/pcap-pf.c
@@ -237,7 +237,7 @@ pcap_inject_pf(pcap_t *p, const void *buf, size_t size)
                return (-1);
        }
        return (ret);
-}                           
+}
 
 static int
 pcap_stats_pf(pcap_t *p, struct pcap_stat *ps)
index 2b93c143781d3aae68d1d06bf3f3163090b1f105..622f6c6e7bc068854542eddd956166627f5f3d93 100644 (file)
@@ -22,7 +22,7 @@
 pcap-savefile \- libpcap savefile format
 .SH DESCRIPTION
 NOTE: applications and libraries should, if possible, use libpcap to
-read savefiles, rather than having their own code to read savefiles. 
+read savefiles, rather than having their own code to read savefiles.
 If, in the future, a new file format is supported by libpcap,
 applications and libraries using libpcap to read savefiles will be able
 to read the new format of savefiles, but applications and libraries
index 2f0ff33beb7ea3729236d5ed2f09c3246ce0849e..61cd2f5775e717433e313c98552f1ddca597b9d1 100644 (file)
@@ -194,9 +194,9 @@ septel_inject(pcap_t *handle, const void *buf _U_, size_t size _U_)
  *  See also pcap(3).
  */
 static pcap_t *septel_activate(pcap_t* handle) {
-  /* Initialize some components of the pcap structure. */  
+  /* Initialize some components of the pcap structure. */
   handle->linktype = DLT_MTP2;
-  
+
   handle->bufsize = 0;
 
   /*
@@ -244,9 +244,9 @@ static int septel_stats(pcap_t *p, struct pcap_stat *ps) {
   struct pcap_septel *handlep = p->priv;
   /*handlep->stat.ps_recv = 0;*/
   /*handlep->stat.ps_drop = 0;*/
-  
+
   *ps = handlep->stat;
+
   return 0;
 }
 
index d507e1eecd8a9e03f4d6b1a4de6141352fe3bea4..b35b106e5960aeb74253dcc4dc0e8d3972e29fac 100644 (file)
@@ -183,7 +183,7 @@ static int read_client_nbytes(int fd, int count, unsigned char *buf) {
        find_unit_by_fd(fd, &chassis, &geoslot, &u);
        while (count) {
                if ((len = recv(fd, buf, count, 0)) <= 0)       return -1;      /* read in whatever data was sent to us */
-               count -= len;   
+               count -= len;
                buf += len;
        }                                                                                                                       /* till we have everything we are looking for */
        return 0;
@@ -211,7 +211,7 @@ static void empty_unit(int chassis, int geoslot) {
                u->imsg = (char *)realloc(u->imsg, 1);                          /* and re-allocate the old large buffer into a new small one */
                if (u->imsg == NULL) {  /* oops, realloc call failed */
                        fprintf(stderr, "Warning...call to realloc() failed, value of errno is %d\n", errno);
-               
+
        }
 }
 
@@ -553,10 +553,10 @@ static void sort_if_table(void) {
                }
                if (has_swapped == 0)
                        return;
-       }       
+       }
        return;
 }
-       
+
 static int process_client_data (char *errbuf) {                                                                /* returns: -1 = error, 0 = OK */
        int                                     chassis, geoslot;
        unit_t                          *u;
index a2ba495d7bd2299aea1046dc2bf79a3ecc7b8a81..03dc08def54b3468bd05f590c42eafb0cc940a81 100644 (file)
@@ -476,7 +476,7 @@ snf_create(const char *device, char *ebuf, int *is_ours)
        ps = p->priv;
 
        /*
-        * We support microsecond and nanosecond time stamps. 
+        * We support microsecond and nanosecond time stamps.
         */
        p->tstamp_precision_count = 2;
        p->tstamp_precision_list = malloc(2 * sizeof(u_int));
index e6232c2e84205af2c18da4abe5c55c9eb53aff3c..0ce7860309d84bd69f4425224d8f2809804f9b87 100644 (file)
@@ -211,7 +211,7 @@ static int
 pcap_inject_snit(pcap_t *p, const void *buf, size_t size)
 {
        struct strbuf ctl, data;
-       
+
        /*
         * XXX - can we just do
         *
index 7993e70edebaaf0e17adf35aa059c3af629d018a..f622f31faad073bf80ee82f24772ac0f86854e4a 100644 (file)
@@ -114,7 +114,7 @@ again:
        caplen = (datalen < p->snapshot) ? datalen : p->snapshot;
        cp = (u_char *)(sh + 1) + p->offset;            /* XXX */
 
-       /* 
+       /*
         * XXX unfortunately snoop loopback isn't exactly like
         * BSD's.  The address family is encoded in the first 2
         * bytes rather than the first 4 bytes!  Luckily the last
@@ -155,7 +155,7 @@ pcap_inject_snoop(pcap_t *p, const void *buf, size_t size)
                return (-1);
        }
        return (ret);
-}                           
+}
 
 static int
 pcap_stats_snoop(pcap_t *p, struct pcap_stat *ps)
index 6cb066c9e10fb6f69cf781cf763c6ebe580be620..74a9a35d0e997caf597486309518f145795bdffe 100644 (file)
@@ -104,12 +104,12 @@ precision of this time stamp is unspecified; it might or might not be
 synchronized with the host operating system's clock.
 .TP 5
 .BR PCAP_TSTAMP_HOST_LOWPREC " - " host_lowprec
-Time stamp provided by the host on which the capture is being done. 
+Time stamp provided by the host on which the capture is being done.
 This is a low-precision time stamp, synchronized with the host operating
 system's clock.
 .TP 5
 .BR PCAP_TSTAMP_HOST_HIPREC " - " host_hiprec
-Time stamp provided by the host on which the capture is being done. 
+Time stamp provided by the host on which the capture is being done.
 This is a high-precision time stamp; it might or might not be
 synchronized with the host operating system's clock.  It might be more
 expensive to fetch than
@@ -129,7 +129,7 @@ the host operating system's clock.
 By default, when performing a live capture or reading from a savefile,
 time stamps are supplied as seconds since January 1, 1970, 00:00:00 UTC,
 and microseconds since that seconds value, even if higher-resolution
-time stamps are available from the capture device or in the savefile. 
+time stamps are available from the capture device or in the savefile.
 If, when reading a savefile, the time stamps in the file have a higher
 resolution than one microsecond, the additional digits of resolution are
 discarded.
index 63eb11eba2456428b05c94fc07bd909bec91287e..957273a87d62bf4d0d9a66e5074464bb445bab5a 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -32,7 +32,7 @@
  * Modifications: Kris Katterjohn <[email protected]>
  *
  */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -139,21 +139,21 @@ static int usb_setdirection_linux(pcap_t *, pcap_direction_t);
 static void usb_cleanup_linux_mmap(pcap_t *);
 
 /* facility to add an USB device to the device list*/
-static int 
+static int
 usb_dev_add(pcap_if_t** alldevsp, int n, char *err_str)
 {
        char dev_name[10];
-       char dev_descr[30]; 
+       char dev_descr[30];
        snprintf(dev_name, 10, USB_IFACE"%d", n);
        snprintf(dev_descr, 30, "USB bus number %d", n);
 
-       if (pcap_add_if(alldevsp, dev_name, 0, 
+       if (pcap_add_if(alldevsp, dev_name, 0,
            dev_descr, err_str) < 0)
                return -1;
-       return 0; 
+       return 0;
 }
 
-int 
+int
 usb_findalldevs(pcap_if_t **alldevsp, char *err_str)
 {
        struct dirent* data;
@@ -172,7 +172,7 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str)
                        if (strncmp(name, "usb", 3) != 0)
                                continue;
 
-                       if (sscanf(&name[3], "%d", &n) == 0) 
+                       if (sscanf(&name[3], "%d", &n) == 0)
                                continue;
 
                        ret = usb_dev_add(alldevsp, n, err_str);
@@ -193,7 +193,7 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str)
                        if ((len < 1) || !isdigit(name[--len]))
                                continue;
                        while (isdigit(name[--len]));
-                       if (sscanf(&name[len+1], "%d", &n) != 1) 
+                       if (sscanf(&name[len+1], "%d", &n) != 1)
                                continue;
 
                        ret = usb_dev_add(alldevsp, n, err_str);
@@ -207,12 +207,12 @@ usb_findalldevs(pcap_if_t **alldevsp, char *err_str)
        return 0;
 }
 
-static 
+static
 int usb_mmap(pcap_t* handle)
 {
        struct pcap_usb_linux *handlep = handle->priv;
        int len = ioctl(handle->fd, MON_IOCQ_RING_SIZE);
-       if (len < 0) 
+       if (len < 0)
                return 0;
 
        handlep->mmapbuflen = len;
@@ -260,7 +260,7 @@ probe_devices(int bus)
                        continue;
 
                snprintf(buf, sizeof(buf), "/dev/bus/usb/%03d/%s", bus, data->d_name);
-               
+
                fd = open(buf, O_RDWR);
                if (fd == -1)
                        continue;
@@ -363,7 +363,7 @@ usb_activate(pcap_t* handle)
        }
 
        /*now select the read method: try to open binary interface */
-       snprintf(full_path, USB_LINE_LEN, LINUX_USB_MON_DEV"%d", handlep->bus_index);  
+       snprintf(full_path, USB_LINE_LEN, LINUX_USB_MON_DEV"%d", handlep->bus_index);
        handle->fd = open(full_path, O_RDONLY, 0);
        if (handle->fd >= 0)
        {
@@ -402,7 +402,7 @@ usb_activate(pcap_t* handle)
        }
        else {
                /*Binary interface not available, try open text interface */
-               snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR"/%dt", handlep->bus_index);  
+               snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR"/%dt", handlep->bus_index);
                handle->fd = open(full_path, O_RDONLY, 0);
                if (handle->fd < 0)
                {
@@ -412,7 +412,7 @@ usb_activate(pcap_t* handle)
                                 * Not found at the new location; try
                                 * the old location.
                                 */
-                               snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%dt", handlep->bus_index);  
+                               snprintf(full_path, USB_LINE_LEN, USB_TEXT_DIR_OLD"/%dt", handlep->bus_index);
                                handle->fd = open(full_path, O_RDONLY, 0);
                        }
                        if (handle->fd < 0) {
@@ -453,22 +453,22 @@ usb_activate(pcap_t* handle)
        return 0;
 }
 
-static inline int 
+static inline int
 ascii_to_int(char c)
 {
        return c < 'A' ? c- '0': ((c<'a') ? c - 'A' + 10: c-'a'+10);
 }
 
 /*
- * see <linux-kernel-source>/Documentation/usb/usbmon.txt and 
- * <linux-kernel-source>/drivers/usb/mon/mon_text.c for urb string 
+ * see <linux-kernel-source>/Documentation/usb/usbmon.txt and
+ * <linux-kernel-source>/drivers/usb/mon/mon_text.c for urb string
  * format description
  */
 static int
 usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *user)
 {
        /* see:
-       * /usr/src/linux/Documentation/usb/usbmon.txt 
+       * /usr/src/linux/Documentation/usb/usbmon.txt
        * for message format
        */
        struct pcap_usb_linux *handlep = handle->priv;
@@ -501,11 +501,11 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
                return -1;
        }
 
-       /* read urb header; %n argument may increment return value, but it's 
+       /* read urb header; %n argument may increment return value, but it's
        * not mandatory, so does not count on it*/
        string[ret] = 0;
-       ret = sscanf(string, "%x %d %c %c%c:%d:%d %s%n", &tag, &timestamp, &etype, 
-               &pipeid1, &pipeid2, &dev_addr, &ep_num, status, 
+       ret = sscanf(string, "%x %d %c %c%c:%d:%d %s%n", &tag, &timestamp, &etype,
+               &pipeid1, &pipeid2, &dev_addr, &ep_num, status,
                &cnt);
        if (ret < 8)
        {
@@ -521,10 +521,10 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
        string += cnt;
 
        /* don't use usbmon provided timestamp, since it have low precision*/
-       if (gettimeofday(&pkth.ts, NULL) < 0) 
+       if (gettimeofday(&pkth.ts, NULL) < 0)
        {
                snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
-                       "Can't get timestamp for message '%s' %d:%s", 
+                       "Can't get timestamp for message '%s' %d:%s",
                        string, errno, strerror(errno));
                return -1;
        }
@@ -567,11 +567,11 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
        if (ret != 1)
        {
                /* this a setup packet, setup data can be filled with underscore if
-               * usbmon has not been able to read them, so we must parse this fields as 
+               * usbmon has not been able to read them, so we must parse this fields as
                * strings */
                pcap_usb_setup* shdr;
                char str1[3], str2[3], str3[5], str4[5], str5[5];
-               ret = sscanf(string, "%s %s %s %s %s%n", str1, str2, str3, str4, 
+               ret = sscanf(string, "%s %s %s %s %s%n", str1, str2, str3, str4,
                str5, &cnt);
                if (ret < 5)
                {
@@ -592,7 +592,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
 
                uhdr->setup_flag = 0;
        }
-       else 
+       else
                uhdr->setup_flag = 1;
 
        /* read urb data */
@@ -605,7 +605,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
        }
        string += cnt;
 
-       /* urb tag is not present if urb length is 0, so we can stop here 
+       /* urb tag is not present if urb length is 0, so we can stop here
         * text parsing */
        pkth.len = urb_len+pkth.caplen;
        uhdr->urb_len = urb_len;
@@ -622,7 +622,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
                return -1;
        }
 
-       if (urb_tag != '=') 
+       if (urb_tag != '=')
                goto got;
 
        /* skip urb tag and following space */
@@ -631,7 +631,7 @@ usb_read_linux(pcap_t *handle, int max_packets, pcap_handler callback, u_char *u
        /* if we reach this point we got some urb data*/
        uhdr->data_flag = 0;
 
-       /* read all urb data; if urb length is greater then the usbmon internal 
+       /* read all urb data; if urb length is greater then the usbmon internal
         * buffer length used by the kernel to spool the URB, we get only
         * a partial information.
         * At least until linux 2.6.17 there is no way to set usbmon intenal buffer
@@ -670,7 +670,7 @@ usb_inject_linux(pcap_t *handle, const void *buf, size_t size)
        return (-1);
 }
 
-static int 
+static int
 usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 {
        struct pcap_usb_linux *handlep = handle->priv;
@@ -695,7 +695,7 @@ usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
                }
                if (fd < 0) {
                        snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
-                               "Can't open USB stats file %s: %s", 
+                               "Can't open USB stats file %s: %s",
                                string, strerror(errno));
                        return -1;
                }
@@ -717,11 +717,11 @@ usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
 
        /* extract info on dropped urbs */
        for (consumed=0; consumed < ret; ) {
-               /* from the sscanf man page: 
-                * The C standard says: "Execution of a %n directive does 
+               /* from the sscanf man page:
+                * The C standard says: "Execution of a %n directive does
                 * not increment the assignment count returned at the completion
                 * of  execution" but the Corrigendum seems to contradict this.
-                * Do not make any assumptions on the effect of %n conversions 
+                * Do not make any assumptions on the effect of %n conversions
                 * on the return value and explicitly check for cnt assignmet*/
                int ntok;
 
@@ -733,7 +733,7 @@ usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
                ptr += cnt;
                if (strcmp(token, "nreaders") == 0)
                        ret = sscanf(ptr, "%d", &stats->ps_drop);
-               else 
+               else
                        ret = sscanf(ptr, "%d", &dummy);
                if (ntok != 1)
                        break;
@@ -746,7 +746,7 @@ usb_stats_linux(pcap_t *handle, struct pcap_stat *stats)
        return 0;
 }
 
-static int 
+static int
 usb_setdirection_linux(pcap_t *p, pcap_direction_t d)
 {
        p->direction = d;
@@ -754,7 +754,7 @@ usb_setdirection_linux(pcap_t *p, pcap_direction_t d)
 }
 
 
-static int 
+static int
 usb_stats_linux_bin(pcap_t *handle, struct pcap_stat *stats)
 {
        struct pcap_usb_linux *handlep = handle->priv;
@@ -775,7 +775,7 @@ usb_stats_linux_bin(pcap_t *handle, struct pcap_stat *stats)
 }
 
 /*
- * see <linux-kernel-source>/Documentation/usb/usbmon.txt and 
+ * see <linux-kernel-source>/Documentation/usb/usbmon.txt and
  * <linux-kernel-source>/drivers/usb/mon/mon_bin.c binary ABI
  */
 static int
@@ -833,7 +833,7 @@ usb_read_linux_bin(pcap_t *handle, int max_packets, pcap_handler callback, u_cha
 }
 
 /*
- * see <linux-kernel-source>/Documentation/usb/usbmon.txt and 
+ * see <linux-kernel-source>/Documentation/usb/usbmon.txt and
  * <linux-kernel-source>/drivers/usb/mon/mon_bin.c binary ABI
  */
 #define VEC_SIZE 32
@@ -887,7 +887,7 @@ usb_read_linux_mmap(pcap_t *handle, int max_packets, pcap_handler callback, u_ch
                for (i=0; i<fetch.nfetch; ++i) {
                        /* discard filler */
                        hdr = (pcap_usb_header*) &handlep->mmapbuf[vec[i]];
-                       if (hdr->event_type == '@') 
+                       if (hdr->event_type == '@')
                                continue;
 
                        /* we can get less that than really captured from kernel, depending on
index 06dee01339a58762658b41a33616e443ebfb950a..234a262f9093c0bab8f9045508518de01bd880b6 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
index f63b5c472b93d692ec8c93676cdf55d2aa894c38..f449f796598871509b0386f3eac7b800b8bd57d3 100644 (file)
@@ -12,9 +12,9 @@
  * 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. Neither the name of the Politecnico di Torino, CACE Technologies 
- * nor the names of its contributors may be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. Neither the name of the Politecnico di Torino, CACE Technologies
+ * nor the names of its contributors may be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -108,7 +108,7 @@ BOOL WINAPI DllMain(
 }
 
 /* Start winsock */
-int 
+int
 wsockinit()
 {
        WORD wVersionRequested;
@@ -118,13 +118,13 @@ wsockinit()
 
        if (done)
                return err;
-       
-       wVersionRequested = MAKEWORD( 1, 1); 
+
+       wVersionRequested = MAKEWORD( 1, 1);
        err = WSAStartup( wVersionRequested, &wsaData );
        atexit ((void(*)(void))WSACleanup);
        InitializeCriticalSection(&g_PcapCompileCriticalSection);
        done = 1;
-       
+
        if ( err != 0 )
                err = -1;
        return err;
@@ -220,11 +220,11 @@ pcap_read_win32_npf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "read error: PacketReceivePacket failed");
                        return (PCAP_ERROR);
                }
-                       
+
                cc = p->Packet->ulBytesReceived;
 
                bp = p->Packet->Buffer;
-       } 
+       }
        else
                bp = p->bp;
 
@@ -328,14 +328,14 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        /* The timeout has expired but we no packets arrived */
                        return 0;
                header = (dag_record_t*)p->adapter->DagBuffer;
-       } 
+       }
        else
                header = (dag_record_t*)p->bp;
-       
+
        endofbuf = (char*)header + cc;
-       
-       /* 
-        * Cycle through the packets 
+
+       /*
+        * Cycle through the packets
         */
        do
        {
@@ -345,12 +345,12 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
 
                /* Increase the number of captured packets */
                pw->stat.ps_recv++;
-               
+
                /* Find the beginning of the packet */
                dp = ((u_char *)header) + dag_record_size;
 
                /* Determine actual packet len */
-               switch(header->type) 
+               switch(header->type)
                {
                case TYPE_ATM:
                        packet_len = ATM_SNAPLEN;
@@ -368,9 +368,9 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                                caplen = packet_len;
                        }
                        dp += 2;
-                       
+
                        break;
-               
+
                case TYPE_HDLC_POS:
                        swt = SWAPS(header->wlen);
                        packet_len = swt - (pw->dag_fcs_bits);
@@ -379,10 +379,10 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                        {
                                caplen = packet_len;
                        }
-                       
+
                        break;
                }
-               
+
                if(caplen > p->snapshot)
                        caplen = p->snapshot;
 
@@ -395,14 +395,14 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                 * out of the loop without having read any packets, and
                 * return the number of packets we've processed so far.
                 */
-               if (p->break_loop) 
+               if (p->break_loop)
                {
-                       if (n == 0) 
+                       if (n == 0)
                        {
                                p->break_loop = 0;
                                return (-2);
-                       } 
-                       else 
+                       }
+                       else
                        {
                                p->bp = (char*)header;
                                p->cc = endofbuf - (char*)header;
@@ -423,30 +423,30 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                                pcap_header.ts.tv_sec++;
                        }
                }
-               
+
                /* No underlaying filtering system. We need to filter on our own */
-               if (p->fcode.bf_insns) 
+               if (p->fcode.bf_insns)
                {
-                       if (bpf_filter(p->fcode.bf_insns, dp, packet_len, caplen) == 0) 
+                       if (bpf_filter(p->fcode.bf_insns, dp, packet_len, caplen) == 0)
                        {
                                /* Move to next packet */
                                header = (dag_record_t*)((char*)header + erf_record_len);
                                continue;
                        }
                }
-               
+
                /* Fill the header for the user suppplied callback function */
                pcap_header.caplen = caplen;
                pcap_header.len = packet_len;
-               
+
                /* Call the callback function */
                (*callback)(user, &pcap_header, dp);
-               
+
                /* Move to next packet */
                header = (dag_record_t*)((char*)header + erf_record_len);
 
                /* Stop if the number of packets requested by user has been reached*/
-               if (++n >= cnt && !PACKET_COUNT_IS_UNLIMITED(cnt)) 
+               if (++n >= cnt && !PACKET_COUNT_IS_UNLIMITED(cnt))
                {
                        p->bp = (char*)header;
                        p->cc = endofbuf - (char*)header;
@@ -454,24 +454,24 @@ pcap_read_win32_dag(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
                }
        }
        while((u_char*)header < endofbuf);
-       
+
   return 1;
 }
 #endif /* HAVE_DAG_API */
 
 /* Send a packet to the network */
-static int 
+static int
 pcap_inject_win32(pcap_t *p, const void *buf, size_t size){
        LPPACKET PacketToSend;
 
        PacketToSend=PacketAllocatePacket();
-       
+
        if (PacketToSend == NULL)
        {
                snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "send error: PacketAllocatePacket failed");
                return -1;
        }
-       
+
        PacketInitPacket(PacketToSend,(PVOID)buf,size);
        if(PacketSendPacket(p->adapter,PacketToSend,TRUE) == FALSE){
                snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "send error: PacketSendPacket failed");
@@ -522,28 +522,28 @@ pcap_activate_win32(pcap_t *p)
        wsockinit();
 
        p->adapter = PacketOpenAdapter(p->opt.source);
-       
+
        if (p->adapter == NULL)
        {
                /* Adapter detected but we are not able to open it. Return failure. */
                snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Error opening adapter: %s", pcap_win32strerror());
                return PCAP_ERROR;
        }
-       
+
        /*get network type*/
        if(PacketGetNetType (p->adapter,&type) == FALSE)
        {
                snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Cannot determine the network type: %s", pcap_win32strerror());
                goto bad;
        }
-       
+
        /*Set the linktype*/
-       switch (type.LinkType) 
+       switch (type.LinkType)
        {
        case NdisMediumWan:
                p->linktype = DLT_EN10MB;
                break;
-               
+
        case NdisMedium802_3:
                p->linktype = DLT_EN10MB;
                /*
@@ -566,27 +566,27 @@ pcap_activate_win32(pcap_t *p)
                        p->dlt_count = 2;
                }
                break;
-               
+
        case NdisMediumFddi:
                p->linktype = DLT_FDDI;
                break;
-               
-       case NdisMedium802_5:                   
-               p->linktype = DLT_IEEE802;      
+
+       case NdisMedium802_5:
+               p->linktype = DLT_IEEE802;
                break;
-               
+
        case NdisMediumArcnetRaw:
                p->linktype = DLT_ARCNET;
                break;
-               
+
        case NdisMediumArcnet878_2:
                p->linktype = DLT_ARCNET;
                break;
-               
+
        case NdisMediumAtm:
                p->linktype = DLT_ATM_RFC1483;
                break;
-               
+
        case NdisMediumCHDLC:
                p->linktype = DLT_CHDLC;
                break;
@@ -617,7 +617,7 @@ pcap_activate_win32(pcap_t *p)
        }
 
        /* Set promiscuous mode */
-       if (p->opt.promisc) 
+       if (p->opt.promisc)
        {
 
                if (PacketSetHwFilter(p->adapter,NDIS_PACKET_TYPE_PROMISCUOUS) == FALSE)
@@ -626,7 +626,7 @@ pcap_activate_win32(pcap_t *p)
                        goto bad;
                }
        }
-       else 
+       else
        {
                if (PacketSetHwFilter(p->adapter,NDIS_PACKET_TYPE_ALL_LOCAL) == FALSE)
                {
@@ -647,8 +647,8 @@ pcap_activate_win32(pcap_t *p)
 
        if(!(p->adapter->Flags & INFO_FLAG_DAG_CARD))
        {
-       /* 
-        * Traditional Adapter 
+       /*
+        * Traditional Adapter
         */
                /*
                 * If the buffer size wasn't explicitly set, default to
@@ -662,16 +662,16 @@ pcap_activate_win32(pcap_t *p)
                        snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "driver error: not enough memory to allocate the kernel buffer");
                        goto bad;
                }
-               
+
                p->buffer = (u_char *)malloc(p->bufsize);
-               if (p->buffer == NULL) 
+               if (p->buffer == NULL)
                {
                        snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno));
                        goto bad;
                }
-               
+
                PacketInitPacket(p->Packet,(BYTE*)p->buffer,p->bufsize);
-               
+
                if (p->opt.immediate)
                {
                        /* tell the driver to copy the buffer as soon as data arrives */
@@ -694,8 +694,8 @@ pcap_activate_win32(pcap_t *p)
        else
 #ifdef HAVE_DAG_API
        {
-       /* 
-        * Dag Card 
+       /*
+        * Dag Card
         */
                LONG    status;
                HKEY    dagkey;
@@ -703,8 +703,8 @@ pcap_activate_win32(pcap_t *p)
                DWORD   lpcbdata;
                int             postype = 0;
                char    keyname[512];
-               
-               snprintf(keyname, sizeof(keyname), "%s\\CardParams\\%s", 
+
+               snprintf(keyname, sizeof(keyname), "%s\\CardParams\\%s",
                        "SYSTEM\\CurrentControlSet\\Services\\DAG",
                        strstr(_strlwr(p->opt.source), "dag"));
                do
@@ -712,36 +712,36 @@ pcap_activate_win32(pcap_t *p)
                        status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyname, 0, KEY_READ, &dagkey);
                        if(status != ERROR_SUCCESS)
                                break;
-                       
+
                        status = RegQueryValueEx(dagkey,
                                "PosType",
                                NULL,
                                &lptype,
                                (char*)&postype,
                                &lpcbdata);
-                       
+
                        if(status != ERROR_SUCCESS)
                        {
                                postype = 0;
                        }
-                       
+
                        RegCloseKey(dagkey);
                }
                while(FALSE);
-               
-               
+
+
                p->snapshot = PacketSetSnapLen(p->adapter, snaplen);
-               
-               /* Set the length of the FCS associated to any packet. This value 
+
+               /* Set the length of the FCS associated to any packet. This value
                 * will be subtracted to the packet length */
                pw->dag_fcs_bits = p->adapter->DagFcsLen;
        }
 #else
        goto bad;
 #endif /* HAVE_DAG_API */
-       
+
        PacketSetReadTimeout(p->adapter, p->opt.timeout);
-       
+
 #ifdef HAVE_DAG_API
        if(p->adapter->Flags & INFO_FLAG_DAG_CARD)
        {
@@ -882,23 +882,23 @@ pcap_setfilter_win32_npf(pcap_t *p, struct bpf_program *fp)
 /*
  * We filter at user level, since the kernel driver does't process the packets
  */
-static int 
+static int
 pcap_setfilter_win32_dag(pcap_t *p, struct bpf_program *fp) {
-       
-       if(!fp) 
+
+       if(!fp)
        {
                strncpy(p->errbuf, "setfilter: No filter specified", sizeof(p->errbuf));
                return -1;
        }
-       
+
        /* Install a user level filter */
-       if (install_bpf_program(p, fp) < 0) 
+       if (install_bpf_program(p, fp) < 0)
        {
                snprintf(p->errbuf, sizeof(p->errbuf),
                        "setfilter, unable to install the filter: %s", pcap_strerror(errno));
                return -1;
        }
-       
+
        return (0);
 }
 
index cbbbcf9d4a128ebc834ee1ff9f2db57614b573cc..c02ac43ef697c7087958be248e9cc34a39cef492 100644 (file)
@@ -575,7 +575,7 @@ bytes of the packet on success, and NULL on error.
 .BR pcap_next_ex ()
 is passed two pointer arguments, one of which points to a
 .IR struct pcap_pkthdr *
-and one of which points to a 
+and one of which points to a
 .IR "const u_char" *.
 It sets the first pointer to point to a
 .I struct pcap_pkthdr
index 7cb0a8e8c05ae11962746b7c9dcf1a184aa7d64c..01bd5a2e9e91474fd2bb72cda0d5b231ef6d9cfa 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -30,7 +30,7 @@
  * bluetooth data struct
  * By Paolo Abeni <[email protected]>
  */
+
 #ifndef _PCAP_BLUETOOTH_STRUCTS_H__
 #define _PCAP_BLUETOOTH_STRUCTS_H__
 
index f71abfed0b0b06007341243e845d36bdf1cc835e..215d5ca03ad1538c4c3449c1405082f28366b185 100644 (file)
@@ -4,7 +4,7 @@
  *
  * This code is derived from the Stanford/CMU enet packet filter,
  * (net/enet.c) distributed as part of 4.3BSD, and code contributed
- * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 
+ * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
  * Berkeley Laboratory.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -88,7 +88,7 @@ typedef       u_int bpf_u_int32;
 #endif
 
 /*
- * Alignment macros.  BPF_WORDALIGN rounds up to the next 
+ * Alignment macros.  BPF_WORDALIGN rounds up to the next
  * even multiple of BPF_ALIGNMENT.
  *
  * Tcpdump's print-pflog.c uses this, so we define it here.
@@ -107,7 +107,7 @@ struct bpf_program {
        u_int bf_len;
        struct bpf_insn *bf_insns;
 };
+
 /*
  * Link-layer header type codes.
  *
@@ -429,7 +429,7 @@ struct bpf_program {
  */
 #define DLT_SUNATM             123     /* Solaris+SunATM */
 
-/* 
+/*
  * Reserved as per request from Kent Dahlgren <[email protected]>
  * for private use.
  */
@@ -672,7 +672,7 @@ struct bpf_program {
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ are used for prepending meta-information
  * like interface index, interface name
  * before standard Ethernet, PPP, Frelay & C-HDLC Frames
@@ -689,7 +689,7 @@ struct bpf_program {
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ is used for internal communication with a
  * voice Adapter Card (PIC)
  */
@@ -764,7 +764,7 @@ struct bpf_program {
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ is used for internal communication with a
  * integrated service module (ISM).
  */
@@ -807,7 +807,7 @@ struct bpf_program {
 
 /*
  * Juniper-private data link type, as per request from
- * Hannes Gredler <[email protected]>. 
+ * Hannes Gredler <[email protected]>.
  * The DLT_ is used for capturing data on a secure tunnel interface.
  */
 #define DLT_JUNIPER_ST          200
@@ -899,11 +899,11 @@ struct bpf_program {
  */
 #define DLT_IEEE802_15_4_NONASK_PHY    215
 
-/* 
+/*
  * David Gibson <[email protected]> requested this for
  * captures from the Linux kernel /dev/input/eventN devices. This
  * is used to communicate keystrokes and mouse movements from the
- * Linux kernel to display systems, such as Xorg. 
+ * Linux kernel to display systems, such as Xorg.
  */
 #define DLT_LINUX_EVDEV                216
 
@@ -1103,7 +1103,7 @@ struct bpf_program {
 #define DLT_JUNIPER_ATM_CEMIC  238
 
 /*
- * NetFilter LOG messages 
+ * NetFilter LOG messages
  * (payload of netlink NFNL_SUBSYS_ULOG/NFULNL_MSG_PACKET packets)
  *
  * Requested by Jakub Zawadzki <[email protected]>
@@ -1212,7 +1212,7 @@ struct bpf_program {
 
 /*
  * DLT type for upper-protocol layer PDU saves from wireshark.
- * 
+ *
  * the actual contents are determined by two TAGs stored with each
  * packet:
  *   EXP_PDU_TAG_LINKTYPE          the link type (LINKTYPE_ value) of the
@@ -1495,7 +1495,7 @@ struct bpf_aux_data {
 #if __STDC__ || defined(__cplusplus)
 extern int bpf_validate(const struct bpf_insn *, int);
 extern u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
-extern u_int bpf_filter_with_aux_data(const struct bpf_insn *, const u_char *, u_int, u_int, const struct bpf_aux_data *);        
+extern u_int bpf_filter_with_aux_data(const struct bpf_insn *, const u_char *, u_int, u_int, const struct bpf_aux_data *);
 #else
 extern int bpf_validate();
 extern u_int bpf_filter();
index 52cb5a322a5e61e29be643fb55daea716a007b6d..83955271f320c701d1ec0e477094379197606fc4 100644 (file)
@@ -11,8 +11,8 @@
  * 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. The name of the author may not be used to endorse or promote 
- * products derived from this software without specific prior written 
+ * 3. The name of the author may not be used to endorse or promote
+ * products derived from this software without specific prior written
  * permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  * Basic USB data struct
  * By Paolo Abeni <[email protected]>
  */
+
 #ifndef _PCAP_USB_STRUCTS_H__
 #define _PCAP_USB_STRUCTS_H__
 
-/* 
+/*
  * possible transfer mode
  */
 #define URB_TRANSFER_IN   0x80
index a39582069b69f90e8ffa1e4c248ef59cb5a32f5d..6744924d02bba2af55443c2121b6f083c4b4d630 100644 (file)
@@ -91,7 +91,7 @@ If \-2 is returned from
 .B pcap_dispatch()
 or
 .BR pcap_loop() ,
-the flag is cleared, so a subsequent call will resume reading packets. 
+the flag is cleared, so a subsequent call will resume reading packets.
 If a positive number is returned, the flag is not cleared, so a
 subsequent call will return \-2 and clear the flag.
 .SH SEE ALSO
index c7d29f5140e44035b9238b5672353173aed6cb13..95f3040a3f76ebc17ca9a75c5ca6cf78349131c6 100644 (file)
@@ -40,9 +40,9 @@ Note that its calling arguments are suitable for use with
 .B pcap_dispatch()
 or
 .BR pcap_loop() .
-If called directly, the 
+If called directly, the
 .I user
-parameter is of type 
+parameter is of type
 .B pcap_dumper_t
 as returned by
 .BR pcap_dump_open() .
index 607efdecafc07cde95f3ca92908330d27663c86a..f8493466c745cf12b08ece997bb39ad074811173 100644 (file)
@@ -38,7 +38,7 @@ is used to get a list of the supported link-layer header types of the
 interface associated with the pcap descriptor.
 .B pcap_list_datalinks()
 allocates an array to hold the list and sets
-.IR *dlt_buf 
+.IR *dlt_buf
 to point to that array.
 .LP
 The caller is responsible for freeing the array with
index 70920b174aba4f65c97a354bbba26edc17f9c00d..871a5b04acd114d5fad4b7875c30f09e36cee525 100644 (file)
@@ -37,7 +37,7 @@ is used to specify a direction that packets will be captured.
 is one of the constants
 .BR PCAP_D_IN ,
 .B PCAP_D_OUT
-or 
+or
 .BR PCAP_D_INOUT .
 .B PCAP_D_IN
 will only capture packets received by the device,
index 24c3c2e1344a155df4f506eb0d0f1830d329cfd9..06b8bd4508278384f37baa2b0945f30c40511d64 100755 (executable)
--- a/runlex.sh
+++ b/runlex.sh
@@ -177,7 +177,7 @@ else
        #
        # OK, rename lex.yy.c to the right output file.
        #
-       mv lex.yy.c "$outfile" 
+       mv lex.yy.c "$outfile"
 
        #
        # Did that succeed?
@@ -228,6 +228,6 @@ cat <<EOF >$header_file
 $prefixline
 #ifndef YY_DECL
 #define YY_DECL int yylex(void)
-#endif  
+#endif
 YY_DECL;
 EOF
index abe1d2dd63b50de5d3b1f5c071a7324902f419cd..783ec45bb0497be0b275337b9307311da55585ab 100644 (file)
@@ -218,14 +218,14 @@ pcap_t* pcap_hopen_offline_with_tstamp_precision(intptr_t osfd, u_int precision,
        FILE *file;
 
        fd = _open_osfhandle(osfd, _O_RDONLY);
-       if ( fd < 0 ) 
+       if ( fd < 0 )
        {
                snprintf(errbuf, PCAP_ERRBUF_SIZE, pcap_strerror(errno));
                return NULL;
        }
 
        file = _fdopen(fd, "rb");
-       if ( file == NULL ) 
+       if ( file == NULL )
        {
                snprintf(errbuf, PCAP_ERRBUF_SIZE, pcap_strerror(errno));
                return NULL;
index ea6215703f7f1445b601174b44893703cb2e7a0b..100f33e0b7fe1dcc5da415b7884214dd1f560ae0 100644 (file)
@@ -664,7 +664,7 @@ pcap_ng_check_header(bpf_u_int32 magic, FILE *fp, u_int precision, char *errbuf,
 
        /*
         * Check whether the first 4 bytes of the file are the block
-        * type for a pcap-ng savefile. 
+        * type for a pcap-ng savefile.
         */
        if (magic != BT_SHB) {
                /*
@@ -1000,7 +1000,7 @@ pcap_ng_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data)
                                    epbp->timestamp_low;
                        }
                        goto found;
-                       
+
                case BT_SPB:
                        /*
                         * Get a pointer to the fixed-length portion of the
@@ -1192,7 +1192,7 @@ pcap_ng_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data)
                         * Not a packet block, IDB, or SHB; ignore it.
                         */
                        break;
-               }                
+               }               
        }
 
 found:
index 3d0db1848a965119ed10118e1850543014fadfc4..eaeddfa875b81eb27dcaf813a9e21d42dc1b1d42 100644 (file)
--- a/sf-pcap.c
+++ b/sf-pcap.c
@@ -682,7 +682,7 @@ pcap_dump_open(pcap_t *p, const char *fname)
  */
 pcap_dumper_t *
 pcap_dump_fopen(pcap_t *p, FILE *f)
-{      
+{
        int linktype;
 
        linktype = dlt_to_linktype(p->linktype);
index f705d8ff89a2f39ee0c170d1ed2cbd85fcce3723..3fd2e6630e30947c3c7cdeb0dbecfb9106656048 100644 (file)
@@ -1,2 +1,2 @@
 # or pullup
-ether[12:2] = 0x800 or ether[12:2] = 0x8100 or ether[0] & 0x80 != 0 or ether[12:2] = 0x9100 
+ether[12:2] = 0x800 or ether[12:2] = 0x8100 or ether[0] & 0x80 != 0 or ether[12:2] = 0x9100
index e80ad62c6fd026f14dc13a50397c40d369c51a26..924ec732eefbc67826e06ff5e6ed724e8b97b8fd 100644 (file)
@@ -1,11 +1,11 @@
-   pcap = pcap_open_dead(link, snaplen); 
-   /* todo: hook together argv to a single string */ 
-   prog = argv[0]; 
-   if (pcap_compile(pcap, &p, prog, optimize, 0) < 0) { 
-      fprintf(stderr, pcap_geterr(pcap)); 
-      exit(1); 
-   } 
-   bpf_dump(&p, option); 
-   pcap_freecode(&p); 
-   pcap_close(pcap); 
+   pcap = pcap_open_dead(link, snaplen);
+   /* todo: hook together argv to a single string */
+   prog = argv[0];
+   if (pcap_compile(pcap, &p, prog, optimize, 0) < 0) {
+      fprintf(stderr, pcap_geterr(pcap));
+      exit(1);
+   }
+   bpf_dump(&p, option);
+   pcap_freecode(&p);
+   pcap_close(pcap);
+
index 1d883776b04e201ff7fe9b562058159c7ad1ca5d..72786e41ae6897f952ff43d3b05086a20df4ffc1 100644 (file)
@@ -231,7 +231,7 @@ main(int argc, char **argv)
        dorfmon = 0;
        useactivate = 0;
        infile = NULL;
-  
+
        if ((cp = strrchr(argv[0], '/')) != NULL)
                program_name = cp + 1;
        else
index f38531253fce23378b743cc507e835f76f544fcc..ab4f396df97d0eba7c8ee433a9df1c055fc962d0 100755 (executable)
@@ -5,7 +5,7 @@ This program parse the output from pcap_compile() to visualize the CFG after
 each optimize phase.
 
 Usage guide:
-1. Enable optimizier debugging code when configure libpcap, 
+1. Enable optimizier debugging code when configure libpcap,
    and build libpcap & filtertest
        ./configure --enable-optimizer-dbg
        make
@@ -14,23 +14,23 @@ Usage guide:
        ./filtertest EN10MB host 192.168.1.1 > a.txt
 3. Send a.txt to this program's standard input
        cat a.txt | tests/visopts.py
-4. Step 2&3 can be merged: 
+4. Step 2&3 can be merged:
        ./filtertest EN10MB host 192.168.1.1 | tests/visopts.py
 5. The standard output is something like this:
        generated files under directory: /tmp/visopts-W9ekBw
          the directory will be removed when this programs finished.
        open this link: http://localhost:39062/expr1.html
-6. Using open link at the 3rd line `http://localhost:39062/expr1.html' 
+6. Using open link at the 3rd line `http://localhost:39062/expr1.html'
 
 Note:
 1. CFG graph is translated to SVG document, expr1.html embeded them as external
-   document. If you open expr1.html as local file using file:// protocol, some 
+   document. If you open expr1.html as local file using file:// protocol, some
    browsers will deny such requests so the web pages will not shown properly.
-   For chrome, you can run it using following command to avoid this: 
+   For chrome, you can run it using following command to avoid this:
        chromium --disable-web-security
    That's why this program start a localhost http server.
-2. expr1.html use jquery from http://ajax.googleapis.com, so you need internet 
-   access to show the web page. 
+2. expr1.html use jquery from http://ajax.googleapis.com, so you need internet
+   access to show the web page.
 """
 
 import sys, os
@@ -67,9 +67,9 @@ html_template = string.Template("""
          index += 1;
          if (index < 10)
            s = "00" + index;
-         else if (index < 100) 
+         else if (index < 100)
            s = "0" + index;
-         else 
+         else
            s = "" + index;
          return "./expr" + exprid + "_g" + s + ".svg"
       }
@@ -82,7 +82,7 @@ html_template = string.Template("""
              $$(this).removeAttr('opacity');
             });
           });
-         
+
          $$(leftsvg).find("[id|='block']").each(function() {
            var has = $$(rightsvg).find("#" + this.id).length != 0;
            if (!has) $$(this).attr("opacity", "0.4");
@@ -106,7 +106,7 @@ html_template = string.Template("""
                 target.focus();
              });
            }
-          });  
+          });
       }
 
       function init_svgroot(svg) {
@@ -160,7 +160,7 @@ html_template = string.Template("""
 
       $$(document).ready(function() {
         for (var i = 0; i < gcount; i++) {
-          var opt = "<option value='" + i + "'>loop" + i + " -- " + logs[i] + "</option>"; 
+          var opt = "<option value='" + i + "'>loop" + i + " -- " + logs[i] + "</option>";
           $$("#lselect").append(opt);
           $$("#rselect").append(opt);
         }
@@ -168,7 +168,7 @@ html_template = string.Template("""
           var index = parseInt($$(this).children("option:selected").val());
           if (this.id == "lselect")
              load_left(index);
-          else 
+          else
              load_right(index);
         }
         $$("#lselect").change(on_selected);
@@ -179,7 +179,7 @@ html_template = string.Template("""
           if (index <= 0) return;
           $$("#lselect").val(index - 1).change();
           $$("#rselect").val(index).change();
-        });        
+        });
         $$("#forward").click(function() {
           var index = parseInt($$("#rselect option:selected").val());
           if (index >= gcount - 1) return;
@@ -225,7 +225,7 @@ html_template = string.Template("""
 
 def write_html(expr, gcount, logs):
     logs = map(lambda s: s.strip().replace("\n", "<br/>"), logs)
-    
+
     global html_template
     html = html_template.safe_substitute(expr=expr.encode("string-escape"), gcount=gcount, logs=json.dumps(logs).encode("string-escape"))
     with file("expr1.html", "wt") as f:
@@ -252,7 +252,7 @@ def render_on_html(infile):
                 indot = 2
         else:
             log += line
-            
+
         if indot == 2:
             p = subprocess.Popen(['dot', '-Tsvg'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
             svg = p.communicate(dot)[0]
@@ -264,7 +264,7 @@ def render_on_html(infile):
             log = ""
             dot = ""
             indot = 0
-            
+
     if indot != 0:
         #unterminated dot graph for expression
         return False
@@ -277,7 +277,7 @@ def render_on_html(infile):
 def run_httpd():
     import SimpleHTTPServer
     import SocketServer
-    
+
     class MySocketServer(SocketServer.TCPServer):
         allow_reuse_address = True
     Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
@@ -301,7 +301,7 @@ def main():
         return 1
     run_httpd()
     return 0
-    
+
 if __name__ == "__main__":
     if '-h' in sys.argv or '--help' in sys.argv:
         print __doc__