[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pcapy upload for Lenny?



>>>>> "Luk" == Luk Claes <luk@debian.org> writes:

    Luk>  I'm afraid  so.  The possible  memory  leak fix  can maybe  be
    Luk> coordinated with the security team?

What about uploading to stable-proposed-updates as the package currently
in unstable only fixes #500043 and #500041?

I have attached  to this mail the debdiff  between the version currently
in  stable and  the  one in  unstable (the  large  part of  the diff  is
actually the  documentation which has been regenerated  for #500041). It
is  worth noticing  that the  upstream release  (0.10.6) only  ships the
patch fixing #500043 compared to 0.10.5.

Cheers,
Arnaud Fontaine

diff -Nru pcapy-0.10.5/bpfobj.cc pcapy-0.10.6/bpfobj.cc
--- pcapy-0.10.5/bpfobj.cc	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/bpfobj.cc	2008-10-21 22:52:50.000000000 +0100
@@ -5,7 +5,7 @@
  * of the Apache Software License. See the accompanying LICENSE file
  * for more information.
  *
- * $Id: bpfobj.cc,v 1.4 2003/10/24 18:49:33 jkohen Exp $
+ * $Id: bpfobj.cc 24 2003-10-24 18:49:33Z jkohen $
  */
 
 #include <pcap.h>
diff -Nru pcapy-0.10.5/bpfobj.h pcapy-0.10.6/bpfobj.h
--- pcapy-0.10.5/bpfobj.h	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/bpfobj.h	2008-10-21 22:52:50.000000000 +0100
@@ -5,7 +5,7 @@
  * of the Apache Software License. See the accompanying LICENSE file
  * for more information.
  *
- * $Id: bpfobj.h,v 1.3 2003/10/24 18:49:33 jkohen Exp $
+ * $Id: bpfobj.h 24 2003-10-24 18:49:33Z jkohen $
  */
 
 #ifndef __bpfobj__
diff -Nru pcapy-0.10.5/debian/changelog pcapy-0.10.6/debian/changelog
--- pcapy-0.10.5/debian/changelog	2009-02-16 17:11:47.000000000 +0000
+++ pcapy-0.10.6/debian/changelog	2009-02-16 17:11:47.000000000 +0000
@@ -1,3 +1,28 @@
+pcapy (0.10.6-1) unstable; urgency=low
+
+  [ Arnaud Fontaine ]
+  * New upstream release. Closes: #500043.
+  * Add 02_remove_exception_on_next.patch, next() now returns None instead
+    of raising an exception when pcap_next() returns NULL. Closes: #500041.
+    + Add 03_regenerate_html_doc.patch as the patch updates the
+      documentation.
+  * debian/control:
+    + Add ${misc:Depends} Depends in case the result of a call to any of
+      dh_ commands cause the package to depend on another one.
+    + Update Standards-Version to 3.8.0. No change needed.
+    + Update Homepage field.
+  * debian/copyright:
+    + Update download location.
+    + Update copyright years.
+  * debian/watch:
+    + Update URL.
+
+  [ Sandro Tosi ]
+  * debian/control:
+    - Switch Vcs-Browser field to viewsvn.
+
+ -- Arnaud Fontaine <arnau@debian.org>  Mon, 15 Dec 2008 01:33:24 +0000
+
 pcapy (0.10.5-2) unstable; urgency=low
 
   [ Arnaud Fontaine ]
diff -Nru pcapy-0.10.5/debian/control pcapy-0.10.6/debian/control
--- pcapy-0.10.5/debian/control	2009-02-16 17:11:47.000000000 +0000
+++ pcapy-0.10.6/debian/control	2009-02-16 17:11:47.000000000 +0000
@@ -9,16 +9,16 @@
                python-central (>= 0.5.0),
                patchutils (>= 0.2.25),
                libpcap0.8-dev
-Homepage: http://oss.coresecurity.com/projects/pcapy.html
+Homepage: http://corelabs.coresecurity.com/index.php?module=FrontEndMod&action=view&type=tool&name=Pcapy
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/pcapy/trunk/
-Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/pcapy/trunk/?op=log
+Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/pcapy/trunk/
 XS-Python-Version: all
-Standards-Version: 3.7.3
+Standards-Version: 3.8.0
 
 Package: python-pcapy
 Architecture: any
 Provides: ${python:Provides}
-Depends: ${python:Depends}, ${shlibs:Depends}
+Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
 Recommends: python-impacket
 Suggests: doc-base
 XB-Python-Version: ${python:Versions}
diff -Nru pcapy-0.10.5/debian/copyright pcapy-0.10.6/debian/copyright
--- pcapy-0.10.5/debian/copyright	2009-02-16 17:11:47.000000000 +0000
+++ pcapy-0.10.6/debian/copyright	2009-02-16 17:11:47.000000000 +0000
@@ -1,9 +1,9 @@
 This package was debianized by Arnaud Fontaine <arnau@debian.org> on
 Tue, 11 Apr 2006 14:08:14 +0200. 
 
-It was downloaded from http://oss.coresecurity.com/projects/pcapy.html
+It was downloaded from http://corelabs.coresecurity.com/index.php?module=FrontEndMod&action=view&type=tool&name=Pcapy
 
-   Copyright (C) 2003-2008 CORE Security Technologies <oss@coresecurity.com>. 
+   Copyright (C) 2003-2009 CORE Security Technologies <oss@coresecurity.com>. 
    All rights reserved.
 
    Redistribution and use in source  and binary forms, with or without
@@ -49,7 +49,7 @@
    OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE POSSIBILITY OF
    SUCH DAMAGE.
 
-The Debian packaging is (C) 2006-2008, Arnaud Fontaine <arnau@debian.org>
-and is licensed under the GPL. On Debian systems, the complete text of
-the GNU General Public License can be found in
-`/usr/share/common-licenses/GPL'.
+The   Debian    packaging   is   (C)    2006-2009,   Arnaud   Fontaine
+<arnau@debian.org>  and  is  licensed  under  the GPL  (version  2  or
+later). On Debian systems, the complete text of the GNU General Public
+License can be found in `/usr/share/common-licenses/GPL*'.
diff -Nru pcapy-0.10.5/debian/patches/01_setup.patch pcapy-0.10.6/debian/patches/01_setup.patch
--- pcapy-0.10.5/debian/patches/01_setup.patch	2009-02-16 17:11:47.000000000 +0000
+++ pcapy-0.10.6/debian/patches/01_setup.patch	2009-02-16 17:11:47.000000000 +0000
@@ -1,9 +1,10 @@
---- setup.py.old	2006-04-11 17:01:48.000000000 +0200
-+++ setup.py	2006-04-11 17:02:08.000000000 +0200
-@@ -60,7 +60,5 @@
+--- a/setup.py	2008-12-15 01:48:04.000000000 +0000
++++ b/setup.py	2008-12-15 01:50:32.000000000 +0000
+@@ -60,8 +60,5 @@
            include_dirs = include_dirs,
            library_dirs = library_dirs,
            libraries = libraries)],
+-      scripts = ['tests/pcapytests.py', 'tests/96pings.pcap'],
 -      data_files = [(os.path.join('share', 'doc', PACKAGE_NAME),
 -                     ['README', 'LICENSE', 'pcapy.html'])],
        )
diff -Nru pcapy-0.10.5/debian/patches/02_remove_exception_on_next.patch pcapy-0.10.6/debian/patches/02_remove_exception_on_next.patch
--- pcapy-0.10.5/debian/patches/02_remove_exception_on_next.patch	1970-01-01 01:00:00.000000000 +0100
+++ pcapy-0.10.6/debian/patches/02_remove_exception_on_next.patch	2009-02-16 17:11:47.000000000 +0000
@@ -0,0 +1,89 @@
+--- a/pcapobj.cc	2009-02-10 15:51:40.000000000 +0000
++++ b/pcapobj.cc	2009-02-10 15:58:55.000000000 +0000
+@@ -193,31 +193,59 @@
+ static PyObject*
+ p_next(register pcapobject* pp, PyObject*)
+ {
+-  struct pcap_pkthdr hdr;
+-  const unsigned char *buf;
+-
+   if (pp->ob_type != &Pcaptype)
+     {
+       PyErr_SetString(PcapError, "Not a pcap object");
+       return NULL;
+     }
+ 
++  struct pcap_pkthdr *hdr;
++  const unsigned char *buf;
++  int ret;
++
+   // allow threads as this might block
+   Py_BEGIN_ALLOW_THREADS;
+-  buf = pcap_next(pp->pcap, &hdr);
++  ret = pcap_next_ex(pp->pcap, &hdr, &buf);
+   Py_END_ALLOW_THREADS;
+ 
+-  if(!buf)
++  if (ret != 1)
+     {
+-      PyErr_SetString(PcapError, pcap_geterr(pp->pcap));
+-      return NULL;
++      // An error occurred while reading the packet
++      if (ret == -1) 
++        {
++          PyErr_SetString(PcapError, pcap_geterr(pp->pcap));
++          return NULL;
++        }
++      // ret equals to 0 if packets are being read from a live capture
++      // and the timeout expired, or -2 if packets are being read from
++      // a 'savefile' and there are no more packets to read
++      else
++        if (ret == 0)
++        {
++            PyObject *socket = PyImport_ImportModule("socket");
++            if (socket != NULL)
++            { 
++                PyObject *socket_timeout = PyObject_GetAttrString(socket, "timeout");
++                if (socket_timeout!=NULL)
++                { 
++                    PyErr_SetString(socket_timeout, "timed out");
++                    Py_DECREF(socket_timeout);
++                }
++                Py_DECREF(socket);
++            }
++            return NULL; 
++        }
++        // -2 if packets are being read from
++        // a 'savefile' and there are no more packets to read
++        Py_INCREF(Py_None);
++        return Py_BuildValue("(Os)", Py_None, "");
+     }
+ 
+-  PyObject *pkthdr = new_pcap_pkthdr(&hdr);
+-    if (pkthdr)
++  PyObject *pkthdr = new_pcap_pkthdr(hdr);
++  if (pkthdr)
+     {
+         PyObject *ret = NULL;
+-        ret = Py_BuildValue("(Os#)", pkthdr, buf, hdr.caplen);
++        ret = Py_BuildValue("(Os#)", pkthdr, buf, hdr->caplen);
+         Py_DECREF(pkthdr);
+         return ret;
+     }
+--- a/pcapy.xml	2008-10-24 19:31:12.000000000 +0100
++++ b/pcapy.xml	2009-02-10 19:51:19.000000000 +0000
+@@ -311,6 +311,14 @@
+ 	  <classname>Pkthdr</classname> instance describing the data
+ 	  passed and <parameter>data</parameter> is the data itself.
+ 	</para>
++	<note>
++	  <para>
++	    If the packet could not be read, a tuple is returned
++	    anyway but with <parameter>header</parameter>
++	    and <parameter>data</parameter> equal respectively
++	    to <constant>None</constant> and an empty string.
++	  </para>
++	</note>
+       </refsect1>
+     </refentry>
+ 
diff -Nru pcapy-0.10.5/debian/patches/03_regenerate_html_doc.patch pcapy-0.10.6/debian/patches/03_regenerate_html_doc.patch
--- pcapy-0.10.5/debian/patches/03_regenerate_html_doc.patch	1970-01-01 01:00:00.000000000 +0100
+++ pcapy-0.10.6/debian/patches/03_regenerate_html_doc.patch	2009-02-16 17:11:47.000000000 +0000
@@ -0,0 +1,574 @@
+--- a/pcapy.html	2009-02-10 19:52:35.000000000 +0000
++++ b/pcapy.html	2009-02-10 19:52:51.000000000 +0000
+@@ -1,21 +1,24 @@
+-<html><head><meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"><title>Part I. Pcapy Reference</title><meta name="generator" content="DocBook XSL Stylesheets V1.40"><meta name="keywords" content="pcap, packet, capture, python"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="part" id="id2720626"><div class="titlepage"><div><h1 class="title"><a name="id2720626"></a>Pcapy Reference</h1></div><div><h3 class="corpauthor">CORE SECURITY TECHNOLOGIES</h3></div><div><p class="copyright">Copyright © 2003 CORE SECURITY TECHNOLOGIES</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision $Revision: 1.2 $</td><td align="left">$Date: 2003/10/23 17:24:27 $</td><td align="left">$Author: jkohen $</td></tr><tr><td align="left" colspan="3">Initial revision</td></tr></table></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt>I <a href="#id2720790">Pcapy Module Reference</a></dt><dd><dl><dt><a href="#id2720796">open_live</a></dt><dt><a href="#id2720974">open_offline</a></dt><dt><a href="#id2721096">lookupdev</a></dt><dt><a href="#id2716618">findalldevs</a></dt><dt><a href="#id2766688">compile</a></dt></dl></dd><dt>II <a href="#id2720711">Reader Object Reference</a></dt><dd><dl><dt><a href="#id2720717">dispatch</a></dt><dt><a href="#id2723103">next</a></dt><dt><a href="#id2723279">setfilter</a></dt><dt><a href="#id2723348">getnet</a></dt><dt><a href="#id2723448">datalink</a></dt><dt><a href="#id2718490">getnonblock</a></dt><dt><a href="#id2718128">dump_open</a></dt></dl></dd><dt>III <a href="#id2718727">Dumper Object Reference</a></dt><dd><dl><dt><a href="#id2718732">dump</a></dt></dl></dd><dt>IV <a href="#id2718829">Pkthdr Object Reference</a></dt><dd><dl><dt><a href="#id2718835">getts</a></dt></dl></dd><dt>V <a href="#id2781073">Bpf Object Reference</a></dt><dd><dl><dt><a href="#id2781080">filter</a></dt></dl></dd><dt><a href="#id2781178">Bibliography</a></dt></dl></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="id2720790"></a>Pcapy Module Reference</h1></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2720796">open_live</a></dt><dt><a href="#id2720974">open_offline</a></dt><dt><a href="#id2721096">lookupdev</a></dt><dt><a href="#id2716618">findalldevs</a></dt><dt><a href="#id2766688">compile</a></dt></dl></div><div class="refentry"><h1 class="title"><a name="id2720796"></a>open_live</h1><div class="refnamediv"><a name="id2720799"></a><h2>Name</h2>open_live &#8212; Obtain a packet capture descriptor to look at packets on the network</div><div class="refsynopsisdiv"><a name="id2720813"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2720817"><a name="id2720817"></a><p><code><code class="funcdef">Reader <b class="fsfunc">open_live</b></code>(<var class="pdparam">device</var>, <var class="pdparam">snaplen</var>, <var class="pdparam">promisc</var>, <var class="pdparam">to_ms</var>);<br>string <var class="pdparam">device</var>;<br>int <var class="pdparam">snaplen</var>;<br>int <var class="pdparam">promisc</var>;<br>int <var class="pdparam">to_ms</var>;</code></p></div></div><div class="refsect1"><a name="id2720875"></a><h2><a name="id2720875"></a>DESCRIPTION</h2><p>
+-	  <tt>open_live</tt> is used to obtain a packet
++<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Part I. Pcapy Reference</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><meta name="keywords" content="pcap, packet, capture, python"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="part" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2478659"></a>Part I. Pcapy Reference</h1></div><div><h3 class="corpauthor">CORE SECURITY TECHNOLOGIES</h3></div><div><p class="copyright">Copyright © 2003 CORE SECURITY TECHNOLOGIES</p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision $Revision: 15 $</td><td align="left">$Date: 2003-10-23 14:24:27 -0300 (Jue, 23 Oct 2003) $</td><td align="left">$Author: jkohen $</td></tr><tr><td align="left" colspan="3">Initial revision</td></tr></table></div></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="reference"><a href="#id2516741">I. Pcapy Module Reference</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="#id2516746">open_live</a></span><span class="refpurpose"> &#8212; Obtain a packet capture descriptor to look at packets on the network</span></dt><dt><span class="refentrytitle"><a href="#id2478772">open_offline</a></span><span class="refpurpose"> &#8212; Obtain a packet capture descriptor to look at packets on a <em class="glossterm">savefile</em></span></dt><dt><span class="refentrytitle"><a href="#id2478050">lookupdev</a></span><span class="refpurpose"> &#8212; Return a network device suitable for use with
++	  <code class="function">open_live</code></span></dt><dt><span class="refentrytitle"><a href="#id2478114">findalldevs</a></span><span class="refpurpose"> &#8212; Obtain the list of available network devices</span></dt><dt><span class="refentrytitle"><a href="#id2483035">compile</a></span><span class="refpurpose"> &#8212; Compile a BPF filter</span></dt></dl></dd><dt><span class="reference"><a href="#id2478329">II. Reader Object Reference</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="#id2478333">dispatch</a></span><span class="refpurpose"> &#8212; Collect and process packets</span></dt><dt><span class="refentrytitle"><a href="#id2482554">next</a></span><span class="refpurpose"> &#8212; Collect the next packet</span></dt><dt><span class="refentrytitle"><a href="#id2482666">setfilter</a></span><span class="refpurpose"> &#8212; Specify a filter</span></dt><dt><span class="refentrytitle"><a href="#id2482722">getnet</a></span><span class="refpurpose"> &#8212; Get the associated network number and mask</span></dt><dt><span class="refentrytitle"><a href="#id2525980">datalink</a></span><span class="refpurpose"> &#8212; Obtain the link layer type</span></dt><dt><span class="refentrytitle"><a href="#id2526809">getnonblock</a></span><span class="refpurpose"> &#8212; Manipulate the
++	  <em class="firstterm">non&#8211;blocking</em> flag</span></dt><dt><span class="refentrytitle"><a href="#id2526958">dump_open</a></span><span class="refpurpose"> &#8212; Create a Dumper object</span></dt></dl></dd><dt><span class="reference"><a href="#id2527039">III. Dumper Object Reference</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="#id2527043">dump</a></span><span class="refpurpose"> &#8212; Dump a packet to a <em class="glossterm">savefile</em></span></dt></dl></dd><dt><span class="reference"><a href="#id2527116">IV. Pkthdr Object Reference</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="#id2527121">getts</a></span><span class="refpurpose"> &#8212; Obtain packet header information</span></dt></dl></dd><dt><span class="reference"><a href="#id2527233">V. Bpf Object Reference</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="#id2527238">filter</a></span><span class="refpurpose"> &#8212; Test a packet against a compiled filter</span></dt></dl></dd><dt><span class="bibliography"><a href="#id2527316">Bibliography</a></span></dt></dl></div><div class="reference" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2516741"></a>Pcapy Module Reference</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="#id2516746">open_live</a></span><span class="refpurpose"> &#8212; Obtain a packet capture descriptor to look at packets on the network</span></dt><dt><span class="refentrytitle"><a href="#id2478772">open_offline</a></span><span class="refpurpose"> &#8212; Obtain a packet capture descriptor to look at packets on a <em class="glossterm">savefile</em></span></dt><dt><span class="refentrytitle"><a href="#id2478050">lookupdev</a></span><span class="refpurpose"> &#8212; Return a network device suitable for use with
++	  <code class="function">open_live</code></span></dt><dt><span class="refentrytitle"><a href="#id2478114">findalldevs</a></span><span class="refpurpose"> &#8212; Obtain the list of available network devices</span></dt><dt><span class="refentrytitle"><a href="#id2483035">compile</a></span><span class="refpurpose"> &#8212; Compile a BPF filter</span></dt></dl></div><div class="refentry" lang="en"><a name="id2516746"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>open_live &#8212; Obtain a packet capture descriptor to look at packets on the network</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">Reader <b class="fsfunc">open_live</b>(</code></td><td><var class="pdparam">device</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">snaplen</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">promisc</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">to_ms</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>string </code> </td><td><code><var class="pdparam">device</var>;</code></td></tr><tr><td><code>int </code> </td><td><code><var class="pdparam">snaplen</var>;</code></td></tr><tr><td><code>int </code> </td><td><code><var class="pdparam">promisc</var>;</code></td></tr><tr><td><code>int </code> </td><td><code><var class="pdparam">to_ms</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2478673"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">open_live</code> is used to obtain a packet
+ 	  capture descriptor to look at packets on the network.
+-	  <i><tt>device</tt></i> is a string that specifies the
++	  <em class="parameter"><code>device</code></em> is a string that specifies the
+ 	  network device to open; on Linux systems with 2.2 or later
+-	  kernels, a device argument of <tt>any</tt> or
+-	  <tt>NULL</tt> can be used to capture packets
+-	  from all interfaces. <i><tt>snaplen</tt></i>
++	  kernels, a device argument of <code class="literal">any</code> or
++	  <code class="constant">NULL</code> can be used to capture packets
++	  from all interfaces. <em class="parameter"><code>snaplen</code></em>
+ 	  specifies the maximum number of bytes to capture.
+-	  <i><tt>promisc</tt></i> specifies if the interface is
++	  <em class="parameter"><code>promisc</code></em> specifies if the interface is
+ 	  to be put into promiscuous mode. (Note that even if this
+ 	  parameter is false, the interface could well be in
+ 	  promiscuous mode for some other reason.) For now, this
+-	  doesn't work on the <tt>any</tt> device; if an
+-	  argument of <tt>any</tt> or
+-	  <tt>NULL</tt> is supplied, the
+-	  <i><tt>promisc</tt></i> flag is ignored.
+-	  <i><tt>to_ms</tt></i> specifies the read timeout in
++	  doesn't work on the <code class="literal">any</code> device; if an
++	  argument of <code class="literal">any</code> or
++	  <code class="constant">NULL</code> is supplied, the
++	  <em class="parameter"><code>promisc</code></em> flag is ignored.
++	  <em class="parameter"><code>to_ms</code></em> specifies the read timeout in
+ 	  milliseconds. The read timeout is used to arrange that the
+ 	  read not necessarily return immediately when a packet is
+ 	  seen, but that it wait for some amount of time to allow more
+@@ -23,305 +26,309 @@
+ 	  kernel in one operation. Not all platforms support a read
+ 	  timeout; on platforms that don't, the read timeout is
+ 	  ignored.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2720974"></a>open_offline</h1><div class="refnamediv"><a name="id2720977"></a><h2>Name</h2>open_offline &#8212; Obtain a packet capture descriptor to look at packets on a <i>savefile</i></div><div class="refsynopsisdiv"><a name="id2720994"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2720997"><a name="id2720997"></a><p><code><code class="funcdef">Reader <b class="fsfunc">open_offline</b></code>(<var class="pdparam">filename</var>);<br>string <var class="pdparam">filename</var>;</code></p></div></div><div class="refsect1"><a name="id2721028"></a><h2><a name="id2721028"></a>DESCRIPTION</h2><p>
+-	  <tt>open_offline</tt> is called to open a
+-	  <i>savefile</i> for reading. <i><tt>filename</tt></i>
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2478772"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>open_offline &#8212; Obtain a packet capture descriptor to look at packets on a <em class="glossterm">savefile</em></p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">Reader <b class="fsfunc">open_offline</b>(</code></td><td><var class="pdparam">filename</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>string </code> </td><td><code><var class="pdparam">filename</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2477988"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">open_offline</code> is called to open a
++	  <em class="glossterm">savefile</em> for reading. <em class="parameter"><code>filename</code></em>
+ 	  specifies the name of the file to open. The file has the
+ 	  same format as those used by
+-	  tcpdump(8) and
+-	  tcpslice(8). The name
+-	  <tt>-</tt> is a synonym for
+-	  <tt>stdin</tt>.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2721096"></a>lookupdev</h1><div class="refnamediv"><a name="id2721099"></a><h2>Name</h2>lookupdev &#8212; Return a network device suitable for use with
+-	  <tt>open_live</tt></div><div class="refsynopsisdiv"><a name="id2721118"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2721121"><a name="id2721121"></a><p><code><code class="funcdef">string <b class="fsfunc">lookupdev</b></code>();</code></p></div></div><div class="refsect1"><a name="id2721144"></a><h2><a name="id2721144"></a>DESCRIPTION</h2><p>
+-	  <tt>lookupdev</tt> returns the name of a network
+-	  device suitable for use with <tt>open_live</tt>.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2716618"></a>findalldevs</h1><div class="refnamediv"><a name="id2766659"></a><h2>Name</h2>findalldevs &#8212; Obtain the list of available network devices</div><div class="refsynopsisdiv"><a name="id2780797"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2780800"><a name="id2780800"></a><p><code><code class="funcdef">string[] <b class="fsfunc">findalldevs</b></code>();</code></p></div></div><div class="refsect1"><a name="id2766782"></a><h2><a name="id2766782"></a>DESCRIPTION</h2><p>
+-	  <tt>findalldevs</tt> constructs a list of
++	  <span class="citerefentry"><span class="refentrytitle">tcpdump</span>(8)</span> and
++	  <span class="citerefentry"><span class="refentrytitle">tcpslice</span>(8)</span>. The name
++	  <code class="filename">-</code> is a synonym for
++	  <code class="filename">stdin</code>.
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2478050"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>lookupdev &#8212; Return a network device suitable for use with
++	  <code class="function">open_live</code></p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">string <b class="fsfunc">lookupdev</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2478089"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">lookupdev</code> returns the name of a network
++	  device suitable for use with <code class="function">open_live</code>.
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2478114"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>findalldevs &#8212; Obtain the list of available network devices</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">string[] <b class="fsfunc">findalldevs</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2482999"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">findalldevs</code> constructs a list of
+ 	  network devices that can be opened with
+-	  <tt>open_live</tt>. (Note that there may be
++	  <code class="function">open_live</code>. (Note that there may be
+ 	  network devices that cannot be opened with
+-	  <tt>open_live</tt>, because, for example, that
++	  <code class="function">open_live</code>, because, for example, that
+ 	  process might not have sufficient privileges to open them
+ 	  for capturing; if so, those devices will not appear on the
+ 	  list.)
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2766688"></a>compile</h1><div class="refnamediv"><a name="id2766691"></a><h2>Name</h2>compile &#8212; Compile a BPF filter</div><div class="refsynopsisdiv"><a name="id2766704"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2766707"><a name="id2766707"></a><p><code><code class="funcdef">Bpf <b class="fsfunc">compile</b></code>(<var class="pdparam">linktype</var>, <var class="pdparam">snaplen</var>, <var class="pdparam">filter</var>, <var class="pdparam">optimize</var>, <var class="pdparam">netmask</var>);<br>int <var class="pdparam">linktype</var>;<br>int <var class="pdparam">snaplen</var>;<br>string <var class="pdparam">filter</var>;<br>int <var class="pdparam">optimize</var>;<br>int32 <var class="pdparam">netmask</var>;</code></p></div></div><div class="refsect1"><a name="id2720660"></a><h2><a name="id2720660"></a>DESCRIPTION</h2><p>
+-	  <tt>compile</tt> is used to compile the
+-	  <i><tt>filter</tt></i> into a filter program.
+-	  <tt>snaplen</tt> specifies the maximum number of
+-	  bytes to capture. <i><tt>optimize</tt></i> controls
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2483035"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>compile &#8212; Compile a BPF filter</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">Bpf <b class="fsfunc">compile</b>(</code></td><td><var class="pdparam">linktype</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">snaplen</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">filter</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">optimize</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">netmask</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>int </code> </td><td><code><var class="pdparam">linktype</var>;</code></td></tr><tr><td><code>int </code> </td><td><code><var class="pdparam">snaplen</var>;</code></td></tr><tr><td><code>string </code> </td><td><code><var class="pdparam">filter</var>;</code></td></tr><tr><td><code>int </code> </td><td><code><var class="pdparam">optimize</var>;</code></td></tr><tr><td><code>int32 </code> </td><td><code><var class="pdparam">netmask</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2483106"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">compile</code> is used to compile the
++	  <em class="parameter"><code>filter</code></em> into a filter program.
++	  <code class="function">snaplen</code> specifies the maximum number of
++	  bytes to capture. <em class="parameter"><code>optimize</code></em> controls
+ 	  whether optimization on the resulting code is performed.
+-	  <i><tt>netmask</tt></i> specifies the netmask of the
++	  <em class="parameter"><code>netmask</code></em> specifies the netmask of the
+ 	  local network.
+-	</p></div></div></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="id2720711"></a>Reader Object Reference</h1></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2720717">dispatch</a></dt><dt><a href="#id2723103">next</a></dt><dt><a href="#id2723279">setfilter</a></dt><dt><a href="#id2723348">getnet</a></dt><dt><a href="#id2723448">datalink</a></dt><dt><a href="#id2718490">getnonblock</a></dt><dt><a href="#id2718128">dump_open</a></dt></dl></div><div class="refentry"><h1 class="title"><a name="id2720717"></a>dispatch</h1><div class="refnamediv"><a name="id2720720"></a><h2>Name</h2>dispatch, loop &#8212; Collect and process packets</div><div class="refsynopsisdiv"><a name="id2718931"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2718935"><a name="id2718935"></a><p><code><code class="funcdef">int <b class="fsfunc">dispatch</b></code>(<var class="pdparam">maxcant</var>, <var class="pdparam">(* callback)</var>);<br>int <var class="pdparam">maxcant</var>;<br>void <var class="pdparam">(* callback)</var>
+-	      (Pkthdr, string);</code></p><p><code><code class="funcdef">int <b class="fsfunc">loop</b></code>(<var class="pdparam">maxcant</var>, <var class="pdparam">(* callback)</var>);<br>int <var class="pdparam">maxcant</var>;<br>void <var class="pdparam">(* callback)</var>
+-	      (Pkthdr, string);</code></p></div></div><div class="refsect1"><a name="id2719017"></a><h2><a name="id2719017"></a>DESCRIPTION</h2><p>
+-	  <tt>dispatch</tt> is used to collect and process
+-	  packets. <i><tt>maxcant</tt></i> specifies the
++	</p></div></div></div><div class="reference" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2478329"></a>Reader Object Reference</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="#id2478333">dispatch</a></span><span class="refpurpose"> &#8212; Collect and process packets</span></dt><dt><span class="refentrytitle"><a href="#id2482554">next</a></span><span class="refpurpose"> &#8212; Collect the next packet</span></dt><dt><span class="refentrytitle"><a href="#id2482666">setfilter</a></span><span class="refpurpose"> &#8212; Specify a filter</span></dt><dt><span class="refentrytitle"><a href="#id2482722">getnet</a></span><span class="refpurpose"> &#8212; Get the associated network number and mask</span></dt><dt><span class="refentrytitle"><a href="#id2525980">datalink</a></span><span class="refpurpose"> &#8212; Obtain the link layer type</span></dt><dt><span class="refentrytitle"><a href="#id2526809">getnonblock</a></span><span class="refpurpose"> &#8212; Manipulate the
++	  <em class="firstterm">non&#8211;blocking</em> flag</span></dt><dt><span class="refentrytitle"><a href="#id2526958">dump_open</a></span><span class="refpurpose"> &#8212; Create a Dumper object</span></dt></dl></div><div class="refentry" lang="en"><a name="id2478333"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>dispatch, loop &#8212; Collect and process packets</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">dispatch</b>(</code></td><td><var class="pdparam">maxcant</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">(* callback)</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code>int </code> </td><td><code><var class="pdparam">maxcant</var>;</code></td></tr><tr><td><code>void </code> </td><td><code><var class="pdparam">(* callback)</var><code>(</code>Pkthdr, string<code>)</code>;</code></td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">loop</b>(</code></td><td><var class="pdparam">maxcant</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">(* callback)</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>int </code> </td><td><code><var class="pdparam">maxcant</var>;</code></td></tr><tr><td><code>void </code> </td><td><code><var class="pdparam">(* callback)</var><code>(</code>Pkthdr, string<code>)</code>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2478419"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">dispatch</code> is used to collect and process
++	  packets. <em class="parameter"><code>maxcant</code></em> specifies the
+ 	  maximum number of packets to process before returning. This
+ 	  is not a minimum number; when reading a live capture, only
+ 	  one bufferful of packets is read at a time, so fewer than
+-	  <i><tt>maxcant</tt></i> packets may be processed. A
+-	  <i><tt>cnt</tt></i> of <tt>-1</tt>
++	  <em class="parameter"><code>maxcant</code></em> packets may be processed. A
++	  <em class="parameter"><code>cnt</code></em> of <code class="literal">-1</code>
+ 	  processes all the packets received in one buffer when
+ 	  reading a live capture, or all the packets in the file when
+-	  reading a <i>savefile</i>. <i><tt>callback</tt></i>
++	  reading a <em class="glossterm">savefile</em>. <em class="parameter"><code>callback</code></em>
+ 	  specifies a routine to be called with two arguments: a
+-	  <tt>Pkthdr</tt> instance describing the data
++	  <code class="classname">Pkthdr</code> instance describing the data
+ 	  passed and the data itself.
+ 	</p><p>
+ 	  The number of packets read is returned.
+-	  0 is returned if no packets were
++	  <span class="returnvalue">0</span> is returned if no packets were
+ 	  read from a live capture (if, for example, they were
+ 	  discarded because they didn't pass the packet filter, or if,
+ 	  on platforms that support a read timeout that starts before
+ 	  any packets arrive, the timeout expires before any  packets
+ 	  arrive, or if the file descriptor for the capture device is
+ 	  in non&#8211;blocking mode and no packets were available to be
+-	  read) or if no more packets are available in a <i>savefile</i>.
+-	</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a name="id2723188"></a>Note</h3><p>
+-	    When reading a live capture, <tt>dispatch</tt>
++	  read) or if no more packets are available in a <em class="glossterm">savefile</em>.
++	</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
++	    When reading a live capture, <code class="function">dispatch</code>
+ 	    will not necessarily return when the read times out; on
+ 	    some platforms, the read timeout isn't supported, and, on
+ 	    other platforms, the timer doesn't start until at least
+ 	    one packet arrives. This means that the read timeout
+-	    should <i>not</i> be used in, for example,
++	    should <span class="emphasis"><em>not</em></span> be used in, for example,
+ 	    an interactive application, to allow the packet capture
+ 	    loop to poll for user input periodically, as there's no
+-	    guarantee that <tt>dispatch</tt> will return
++	    guarantee that <code class="function">dispatch</code> will return
+ 	    after the timeout expires.
+ 	  </p></div><p>
+-	  <tt>loop</tt> is similar to
+-	  <tt>dispatch</tt> except it keeps reading
+-	  packets until <i><tt>maxcant</tt></i> packets are
++	  <code class="function">loop</code> is similar to
++	  <code class="function">dispatch</code> except it keeps reading
++	  packets until <em class="parameter"><code>maxcant</code></em> packets are
+ 	  processed or an error occurs. It does
+-	  <i>not</i> return when live read timeouts
++	  <span class="emphasis"><em>not</em></span> return when live read timeouts
+ 	  occur. Rather, specifying a non&#8211;zero read timeout to
+-	  <tt>open_live</tt> and then calling
+-	  <tt>dispatch</tt> allows the reception and
++	  <code class="function">open_live</code> and then calling
++	  <code class="function">dispatch</code> allows the reception and
+ 	  processing of any packets that arrive when the timeout
+-	  occurs. A negative <i><tt>maxcant</tt></i> causes
+-	  <tt>loop</tt> to loop forever (or at least until
+-	  an error occurs). 0 is returned
+-	  if <i><tt>maxcant</tt></i> is exhausted.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2723103"></a>next</h1><div class="refnamediv"><a name="id2723106"></a><h2>Name</h2>next &#8212; Collect the next packet</div><div class="refsynopsisdiv"><a name="id2723120"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2723123"><a name="id2723123"></a><p><code><code class="funcdef">(Pkthdr, string) <b class="fsfunc">next</b></code>();</code></p></div></div><div class="refsect1"><a name="id2723147"></a><h2><a name="id2723147"></a>DESCRIPTION</h2><p>
+-	  <tt>next</tt> reads the next packet (by calling
+-	  <tt>dispatch</tt> with a
+-	  <i><tt>maxcant</tt></i> of <tt>1</tt>)
++	  occurs. A negative <em class="parameter"><code>maxcant</code></em> causes
++	  <code class="function">loop</code> to loop forever (or at least until
++	  an error occurs). <span class="returnvalue">0</span> is returned
++	  if <em class="parameter"><code>maxcant</code></em> is exhausted.
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2482554"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>next &#8212; Collect the next packet</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">(Pkthdr, string) <b class="fsfunc">next</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2482586"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">next</code> reads the next packet (by calling
++	  <code class="function">dispatch</code> with a
++	  <em class="parameter"><code>maxcant</code></em> of <code class="constant">1</code>)
+ 	  and returns a tuple (header, data) where
+-	  <i><tt>header</tt></i> is a
+-	  <tt>Pkthdr</tt> instance describing the data
+-	  passed and <i><tt>data</tt></i> is the data itself.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2723279"></a>setfilter</h1><div class="refnamediv"><a name="id2723282"></a><h2>Name</h2>setfilter &#8212; Specify a filter</div><div class="refsynopsisdiv"><a name="id2723294"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2723298"><a name="id2723298"></a><p><code><code class="funcdef"><b class="fsfunc">setfilter</b></code>(<var class="pdparam">filter</var>);<br>string <var class="pdparam">filter</var>;</code></p></div></div><div class="refsect1"><a name="id2723327"></a><h2><a name="id2723327"></a>DESCRIPTION</h2><p>
+-	  <tt>setfilter</tt> is used to specify a filter
++	  <em class="parameter"><code>header</code></em> is a
++	  <code class="classname">Pkthdr</code> instance describing the data
++	  passed and <em class="parameter"><code>data</code></em> is the data itself.
++	</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
++	    If the packet could not be read, a tuple is returned
++	    anyway but with <em class="parameter"><code>header</code></em>
++	    and <em class="parameter"><code>data</code></em> equal respectively
++	    to <code class="constant">None</code> and an empty string.
++	  </p></div></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2482666"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>setfilter &#8212; Specify a filter</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef"><b class="fsfunc">setfilter</b>(</code></td><td><var class="pdparam">filter</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>string </code> </td><td><code><var class="pdparam">filter</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2482703"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">setfilter</code> is used to specify a filter
+ 	  for this object.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2723348"></a>getnet</h1><div class="refnamediv"><a name="id2723351"></a><h2>Name</h2>getnet, getmask &#8212; Get the associated network number and mask</div><div class="refsynopsisdiv"><a name="id2723367"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2723370"><a name="id2723370"></a><p><code><code class="funcdef">int32 <b class="fsfunc">getnet</b></code>();</code></p></div><div class="funcsynopsis" id="id2723392"><a name="id2723392"></a><p><code><code class="funcdef">int32 <b class="fsfunc">getmask</b></code>();</code></p></div></div><div class="refsect1"><a name="id2723415"></a><h2><a name="id2723415"></a>DESCRIPTION</h2><p>
+-	  <tt>getnet</tt> and <tt>getmask</tt>
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2482722"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>getnet, getmask &#8212; Get the associated network number and mask</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int32 <b class="fsfunc">getnet</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int32 <b class="fsfunc">getmask</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2482775"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">getnet</code> and <code class="function">getmask</code>
+ 	  are used to determine the network number and mask associated
+ 	  with the network device attached to this
+-	  <tt>Reader</tt>.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2723448"></a>datalink</h1><div class="refnamediv"><a name="id2723451"></a><h2>Name</h2>datalink &#8212; Obtain the link layer type</div><div class="refsynopsisdiv"><a name="id2723463"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2723466"><a name="id2723466"></a><p><code><code class="funcdef">int <b class="fsfunc">datalink</b></code>();</code></p></div></div><div class="refsect1"><a name="id2723489"></a><h2><a name="id2723489"></a>DESCRIPTION</h2><p>
+-	  <tt>datalink</tt> returns the link layer type; link layer types it can return include:
+-	  <div class="variablelist"><dl><dt><a name="id2723510"></a><span class="term"><tt>DLT_NULL</tt></span></dt><dd><p>
+-		  BSD loopback encapsulation; the
++	  <code class="classname">Reader</code>.
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2525980"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>datalink &#8212; Obtain the link layer type</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">datalink</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2526011"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">datalink</code> returns the link layer type; link layer types it can return include:
++	  </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">DLT_NULL</code></span></dt><dd><p>
++		  <acronym class="acronym">BSD</acronym> loopback encapsulation; the
+ 		  link layer header is a 4&#8211;byte field, in host
+-		  byte order, containing a <tt>PF_</tt>
+-		  value from <tt>socket.h</tt> for the
++		  byte order, containing a <code class="constant">PF_</code>
++		  value from <code class="filename">socket.h</code> for the
+ 		  network&#8211;layer protocol of the packet.
+-		</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a name="id2723550"></a>Note</h3><p>
+-		    &#8220;host byte order&#8221; is the byte order
++		</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
++		    &#8220;<span class="quote">host byte order</span>&#8221; is the byte order
+ 		    of the machine on which the packets are captured,
+-		    and the <tt>PF_</tt> values are for
+-		    the OS of the machine on which
++		    and the <code class="constant">PF_</code> values are for
++		    the <acronym class="acronym">OS</acronym> of the machine on which
+ 		    the packets are captured; if a live capture is
+-		    being done, &#8220;host byte order&#8221; is the
++		    being done, &#8220;<span class="quote">host byte order</span>&#8221; is the
+ 		    byte order of the machine capturing the packets,
+-		    and the <tt>PF_</tt> values are those
+-		    of the OS of the machine
+-		    capturing the packets, but if a <i>savefile</i> is being
+-		    read, the byte order and <tt>PF_</tt>
+-		    values are <i>not</i> necessarily
++		    and the <code class="constant">PF_</code> values are those
++		    of the <acronym class="acronym">OS</acronym> of the machine
++		    capturing the packets, but if a <em class="glossterm">savefile</em> is being
++		    read, the byte order and <code class="constant">PF_</code>
++		    values are <span class="emphasis"><em>not</em></span> necessarily
+ 		    those of the machine reading the capture file.
+-		  </p></div></dd><dt><a name="id2723606"></a><span class="term"><tt>DLT_EN10MB</tt></span></dt><dd><p>Ethernet (10Mb, 100Mb, 1000Mb, and up)</p></dd><dt><a name="id2723624"></a><span class="term"><tt>DLT_IEEE802</tt></span></dt><dd><p>IEEE 802.5 Token Ring</p></dd><dt><a name="id2723645"></a><span class="term"><tt>DLT_ARCNET</tt></span></dt><dd><p>ARCNET</p></dd><dt><a name="id2723536"></a><span class="term"><tt>DLT_SLIP</tt></span></dt><dd><p><a name="id2717681"></a>
+-		  SLIP; the link layer header contains, in order:
+-		  <div class="itemizedlist"><ul><li><a name="id2717695"></a><p>
++		  </p></div></dd><dt><span class="term"><code class="constant">DLT_EN10MB</code></span></dt><dd>Ethernet (10Mb, 100Mb, 1000Mb, and up)</dd><dt><span class="term"><code class="constant">DLT_IEEE802</code></span></dt><dd><acronym class="acronym">IEEE</acronym> 802.5 Token Ring</dd><dt><span class="term"><code class="constant">DLT_ARCNET</code></span></dt><dd><acronym class="acronym">ARCNET</acronym></dd><dt><span class="term"><code class="constant">DLT_SLIP</code></span></dt><dd><p>
++		  <acronym class="acronym">SLIP</acronym>; the link layer header contains, in order:
++		  </p><div class="itemizedlist"><ul type="disc"><li>
+ 			a 1&#8211;byte flag, which is
+-			<tt>0</tt> for packets received by
+-			the machine and <tt>1</tt> for
++			<code class="literal">0</code> for packets received by
++			the machine and <code class="literal">1</code> for
+ 			packets sent by the machine.
+-		      </p></li><li><p><a name="id2717721"></a>
+-			a 1&#8211;byte field, the upper 4 bits of which indicate the type of packet, as per RFC 1144:
++		      </li><li><p>
++			a 1&#8211;byte field, the upper 4 bits of which indicate the type of packet, as per <acronym class="acronym">RFC</acronym> 1144:
+ 
+-			<div class="itemizedlist"><ul><li><a name="id2717736"></a><p>
+-			      <tt>0x40</tt>; an unmodified
+-			      IP datagram
+-			      (<tt>TYPE_IP</tt>)
+-			    </p></li><li><a name="id2717760"></a><p>
+-			      <tt>0x70</tt>; an
+-			      uncompressed&#8211;TCP/IP
++			</p><div class="itemizedlist"><ul type="circle"><li>
++			      <code class="literal">0x40</code>; an unmodified
++			      <acronym class="acronym">IP</acronym> datagram
++			      (<code class="constant">TYPE_IP</code>)
++			    </li><li>
++			      <code class="literal">0x70</code>; an
++			      uncompressed&#8211;<acronym class="acronym">TCP/IP</acronym>
+ 			      datagram
+-			      (<tt>UNCOMPRESSED_TCP</tt>),
++			      (<code class="constant">UNCOMPRESSED_TCP</code>),
+ 			      with that byte being the first byte of
+-			      the raw IP header on
++			      the raw <acronym class="acronym">IP</acronym> header on
+ 			      the wire, containing the connection
+ 			      number in the protocol field
+-			    </p></li><li><a name="id2717791"></a><p>
+-			      <tt>0x80</tt>; a
+-			      compressed&#8211;TCP/IP
++			    </li><li>
++			      <code class="literal">0x80</code>; a
++			      compressed&#8211;<acronym class="acronym">TCP/IP</acronym>
+ 			      datagram
+-			      (<tt>COMPRESSED_TCP</tt>),
++			      (<code class="constant">COMPRESSED_TCP</code>),
+ 			      with that byte being the first byte of
+-			      the compressed TCP/IP
++			      the compressed <acronym class="acronym">TCP/IP</acronym>
+ 			      datagram header
+-			    </p></li></ul></div>
+-		      </p></li><li><a name="id2717824"></a><p>
+-			for <tt>UNCOMPRESSED_TCP</tt>, the
+-			rest of the modified IP
++			    </li></ul></div><p>
++		      </p></li><li>
++			for <code class="constant">UNCOMPRESSED_TCP</code>, the
++			rest of the modified <acronym class="acronym">IP</acronym>
+ 			header, and for
+-			<tt>COMPRESSED_TCP</tt>, the
+-			compressed TCP/IP datagram
++			<code class="constant">COMPRESSED_TCP</code>, the
++			compressed <acronym class="acronym">TCP/IP</acronym> datagram
+ 			header
+-		      </p></li></ul></div>
+-		  for a total of 16 bytes; the uncompressed IP datagram follows the header.
+-		</p></dd><dt><a name="id2717860"></a><span class="term"><tt>DLT_PPP</tt></span></dt><dd><p>
+-		  PPP; if the first 2 bytes are
+-		  <tt>0xff</tt> and <tt>0x03</tt>,
+-		  it's PPP in
+-		  HDLC&#8211;like framing, with the
+-		  PPP header following those two
+-		  bytes, otherwise it's PPP without
++		      </li></ul></div><p>
++		  for a total of 16 bytes; the uncompressed <acronym class="acronym">IP</acronym> datagram follows the header.
++		</p></dd><dt><span class="term"><code class="constant">DLT_PPP</code></span></dt><dd>
++		  <acronym class="acronym">PPP</acronym>; if the first 2 bytes are
++		  <code class="literal">0xff</code> and <code class="literal">0x03</code>,
++		  it's <acronym class="acronym">PPP</acronym> in
++		  <acronym class="acronym">HDLC</acronym>&#8211;like framing, with the
++		  <acronym class="acronym">PPP</acronym> header following those two
++		  bytes, otherwise it's <acronym class="acronym">PPP</acronym> without
+ 		  framing, and the packet begins with the
+-		  PPP header.
+-		</p></dd><dt><a name="id2717919"></a><span class="term"><tt>DLT_FDDI</tt></span></dt><dd><p>FDDI</p></dd><dt><a name="id2717938"></a><span class="term"><tt>DLT_ATM_RFC1483</tt></span></dt><dd><p>
+-		  RFC 1483
+-		  LLC/SNAP&#8211;encapsulated
+-		  ATM; the packet begins with an
+-		  IEEE 802.2 LLC
++		  <acronym class="acronym">PPP</acronym> header.
++		</dd><dt><span class="term"><code class="constant">DLT_FDDI</code></span></dt><dd><acronym class="acronym">FDDI</acronym></dd><dt><span class="term"><code class="constant">DLT_ATM_RFC1483</code></span></dt><dd>
++		  <acronym class="acronym">RFC</acronym> 1483
++		  <acronym class="acronym">LLC/SNAP</acronym>&#8211;encapsulated
++		  <acronym class="acronym">ATM</acronym>; the packet begins with an
++		  <acronym class="acronym">IEEE</acronym> 802.2 <acronym class="acronym">LLC</acronym>
+ 		  header.
+-		</p></dd><dt><a name="id2717976"></a><span class="term"><tt>DLT_RAW</tt></span></dt><dd><p>
+-		  Raw IP; the packet begins with an
+-		  IP header.
+-		</p></dd><dt><a name="id2718002"></a><span class="term"><tt>DLT_PPP_SERIAL</tt></span></dt><dd><p>
+-		  PPP in
+-		  HDLC&#8211;like framing, as per
+-		  RFC 1662, or Cisco
+-		  PPP with HDLC
++		</dd><dt><span class="term"><code class="constant">DLT_RAW</code></span></dt><dd>
++		  Raw <acronym class="acronym">IP</acronym>; the packet begins with an
++		  <acronym class="acronym">IP</acronym> header.
++		</dd><dt><span class="term"><code class="constant">DLT_PPP_SERIAL</code></span></dt><dd>
++		  <acronym class="acronym">PPP</acronym> in
++		  <acronym class="acronym">HDLC</acronym>&#8211;like framing, as per
++		  <acronym class="acronym">RFC</acronym> 1662, or Cisco
++		  <acronym class="acronym">PPP</acronym> with <acronym class="acronym">HDLC</acronym>
+ 		  framing, as per section §4.3.1 of
+-		  RFC 1547; the first byte will be
+-		  <tt>0xFF</tt> for PPP
+-		  in HDLC&#8211;like framing, and
+-		  will be <tt>0x0F</tt> or
+-		  <tt>0x8F</tt> for Cisco
+-		  PPP with HDLC
++		  <acronym class="acronym">RFC</acronym> 1547; the first byte will be
++		  <code class="literal">0xFF</code> for <acronym class="acronym">PPP</acronym>
++		  in <acronym class="acronym">HDLC</acronym>&#8211;like framing, and
++		  will be <code class="literal">0x0F</code> or
++		  <code class="literal">0x8F</code> for Cisco
++		  <acronym class="acronym">PPP</acronym> with <acronym class="acronym">HDLC</acronym>
+ 		  framing.
+-		</p></dd><dt><a name="id2718179"></a><span class="term"><tt>DLT_PPP_ETHER</tt></span></dt><dd><p>
+-		  PPPoE; the packet begins with a
+-		  PPPoE header, as per
+-		  RFC 2516.
+-		</p></dd><dt><a name="id2718208"></a><span class="term"><tt>DLT_C_HDLC</tt></span></dt><dd><p>
+-		  Cisco PPP with
+-		  HDLC framing, as per section
+-		  § 4.3.1 of RFC 1547.
+-		</p></dd><dt><a name="id2718045"></a><span class="term"><tt>DLT_IEEE802_11</tt></span></dt><dd><p>
+-		  IEEE 802.11 wireless
+-		  LAN.
+-		</p></dd><dt><a name="id2718071"></a><span class="term"><tt>DLT_LOOP</tt></span></dt><dd><p>
++		</dd><dt><span class="term"><code class="constant">DLT_PPP_ETHER</code></span></dt><dd>
++		  <acronym class="acronym">PPPoE</acronym>; the packet begins with a
++		  <acronym class="acronym">PPPoE</acronym> header, as per
++		  <acronym class="acronym">RFC</acronym> 2516.
++		</dd><dt><span class="term"><code class="constant">DLT_C_HDLC</code></span></dt><dd>
++		  Cisco <acronym class="acronym">PPP</acronym> with
++		  <acronym class="acronym">HDLC</acronym> framing, as per section
++		  § 4.3.1 of <acronym class="acronym">RFC</acronym> 1547.
++		</dd><dt><span class="term"><code class="constant">DLT_IEEE802_11</code></span></dt><dd>
++		  <acronym class="acronym">IEEE</acronym> 802.11 wireless
++		  <acronym class="acronym">LAN</acronym>.
++		</dd><dt><span class="term"><code class="constant">DLT_LOOP</code></span></dt><dd><p>
+ 		  OpenBSD loopback encapsulation; the link layer
+ 		  header is a 4&#8211;byte field, in network byte
+-		  order, containing a <tt>PF_</tt> value
+-		  from OpenBSD's <tt>socket.h</tt> for the
++		  order, containing a <code class="constant">PF_</code> value
++		  from OpenBSD's <code class="filename">socket.h</code> for the
+ 		  network&#8211;layer protocol of the packet.
+-		</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a name="id2718249"></a>Note</h3><p>
+-		    Note that, if a <i>savefile</i> is being read, those
+-		    <tt>PF_</tt> values are
+-		    <i>not</i> necessarily those of the
++		</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
++		    Note that, if a <em class="glossterm">savefile</em> is being read, those
++		    <code class="constant">PF_</code> values are
++		    <span class="emphasis"><em>not</em></span> necessarily those of the
+ 		    machine reading the capture file.
+-		  </p></div></dd><dt><a name="id2718273"></a><span class="term"><tt>DLT_LINUX_SLL</tt></span></dt><dd><p><a name="id2718281"></a>
++		  </p></div></dd><dt><span class="term"><code class="constant">DLT_LINUX_SLL</code></span></dt><dd><p>
+ 		  Linux cooked capture encapsulation; the link layer
+ 		  header contains, in order:
+ 
+-		  <div class="itemizedlist"><ul><li><p><a name="id2718292"></a>
+-			a 2&#8211;byte &quot;packet  type&quot;,  in  network
++		  </p><div class="itemizedlist"><ul type="disc"><li><p>
++			a 2&#8211;byte "packet  type",  in  network
+ 			byte order, which is one of:
+ 
+-			<div class="itemizedlist"><ul><li><a name="id2718303"></a><p>
+-			      <tt>0</tt>; packet was sent to
++			</p><div class="itemizedlist"><ul type="circle"><li>
++			      <code class="literal">0</code>; packet was sent to
+ 			      us by somebody else.
+-			    </p></li><li><a name="id2718320"></a><p>
+-			      <tt>1</tt>; packet was
++			    </li><li>
++			      <code class="literal">1</code>; packet was
+ 			      broadcast by somebody else.
+-			    </p></li><li><a name="id2718336"></a><p>
+-			      <tt>2</tt>; packet was
++			    </li><li>
++			      <code class="literal">2</code>; packet was
+ 			      multicast, but not broadcast, by
+ 			      somebody else.
+-			    </p></li><li><a name="id2718353"></a><p>
+-			      <tt>3</tt>; packet was sent by
++			    </li><li>
++			      <code class="literal">3</code>; packet was sent by
+ 			      somebody else to somebody else.
+-			    </p></li><li><a name="id2718369"></a><p>
+-			      <tt>4</tt>; packet was sent by
++			    </li><li>
++			      <code class="literal">4</code>; packet was sent by
+ 			      us.
+-			    </p></li></ul></div>
+-		      </p></li><li><a name="id2718388"></a><p>
++			    </li></ul></div><p>
++		      </p></li><li>
+ 			a 2&#8211;byte field, in network byte order,
+ 			containing a Linux
+-			<tt>ARPHRD_</tt> value for the
++			<code class="constant">ARPHRD_</code> value for the
+ 			link layer device type.
+-		      </p></li><li><a name="id2718403"></a><p>
++		      </li><li>
+ 			a 2&#8211;byte field, in network byte order,
+ 			containing the length of the link layer
+ 			address of the sender of the packet (which
+ 			could be 0).
+-		      </p></li><li><a name="id2718414"></a><p>
++		      </li><li>
+ 			an 8&#8211;byte field containing that number
+ 			of bytes of the link layer header (if there
+ 			are more than 8 bytes, only the first 8 are
+ 			present).
+-		      </p></li><li><a name="id2718426"></a><p>
++		      </li><li>
+ 			a 2&#8211;byte field containing an Ethernet
+ 			protocol type, in network byte order, or
+-			containing <tt>1</tt> for Novell
++			containing <code class="literal">1</code> for Novell
+ 			802.3 frames without an 802.2
+-			LLC header or
+-			<tt>4</tt> for frames beginning with
+-			an 802.2 LLC header.
+-		      </p></li></ul></div>
+-		</p></dd><dt><a name="id2718463"></a><span class="term"><tt>DLT_LTALK</tt></span></dt><dd><p>
++			<acronym class="acronym">LLC</acronym> header or
++			<code class="literal">4</code> for frames beginning with
++			an 802.2 <acronym class="acronym">LLC</acronym> header.
++		      </li></ul></div><p>
++		</p></dd><dt><span class="term"><code class="constant">DLT_LTALK</code></span></dt><dd>
+ 		  Apple LocalTalk; the packet begins with an AppleTalk
+-		  LLAP header.
+-		</p></dd></dl></div>
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2718490"></a>getnonblock</h1><div class="refnamediv"><a name="id2718494"></a><h2>Name</h2>getnonblock, setnonblock &#8212; Manipulate the
+-	  <i>non&#8211;blocking</i> flag</div><div class="refsynopsisdiv"><a name="id2718514"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2718516"><a name="id2718516"></a><p><code><code class="funcdef">int <b class="fsfunc">getnonblock</b></code>();</code></p></div><div class="funcsynopsis" id="id2718538"><a name="id2718538"></a><p><code><code class="funcdef"><b class="fsfunc">setnonblock</b></code>(<var class="pdparam">state</var>);<br>int <var class="pdparam">state</var>;</code></p></div></div><div class="refsect1"><a name="id2718567"></a><h2><a name="id2718567"></a>DESCRIPTION</h2><p>
+-	  <tt>getnonblock</tt> returns the current
++		  <acronym class="acronym">LLAP</acronym> header.
++		</dd></dl></div><p>
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2526809"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>getnonblock, setnonblock &#8212; Manipulate the
++	  <em class="firstterm">non&#8211;blocking</em> flag</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">getnonblock</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef"><b class="fsfunc">setnonblock</b>(</code></td><td><var class="pdparam">state</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>int </code> </td><td><code><var class="pdparam">state</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2526867"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">getnonblock</code> returns the current
+ 	  non&#8211;blocking state of the capture descriptor; it
+-	  always returns 0 on <i>savefile</i>s.
+-	</p></div><div class="refsect1"><a name="id2718596"></a><h2><a name="id2718596"></a>DESCRIPTION</h2><p>
+-	  <tt>setnonblock</tt> puts a capture descriptor,
+-	  opened with <tt>open_live</tt>, into
++	  always returns <span class="returnvalue">0</span> on <em class="glossterm">savefile</em>s.
++	</p></div><div class="refsect1" lang="en"><a name="id2526892"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">setnonblock</code> puts a capture descriptor,
++	  opened with <code class="function">open_live</code>, into
+ 	  non&#8211;blocking mode, or takes it out of
+ 	  non&#8211;blocking mode, depending on whether the
+-	  <i><tt>state</tt></i> argument is non&#8211;zero or
+-	  zero. It has no effect on <i>savefile</i>s. In non&#8211;blocking
++	  <em class="parameter"><code>state</code></em> argument is non&#8211;zero or
++	  zero. It has no effect on <em class="glossterm">savefile</em>s. In non&#8211;blocking
+ 	  mode, an attempt to read from the capture descriptor with
+-	  <tt>dispatch</tt> will, if no packets are
++	  <code class="function">dispatch</code> will, if no packets are
+ 	  currently available to be read, return
+-	  0 immediately rather than
++	  <span class="returnvalue">0</span> immediately rather than
+ 	  blocking waiting for packets to arrive.
+-	  <tt>loop</tt> and <tt>next</tt> will
++	  <code class="function">loop</code> and <code class="function">next</code> will
+ 	  not work in non&#8211;blocking mode.
+-	</p></div></div><div class="refentry"><h1 class="title"><a name="id2718128"></a>dump_open</h1><div class="refnamediv"><a name="id2718622"></a><h2>Name</h2>dump_open &#8212; Create a Dumper object</div><div class="refsynopsisdiv"><a name="id2718635"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2718639"><a name="id2718639"></a><p><code><code class="funcdef">Dumper <b class="fsfunc">dump_open</b></code>(<var class="pdparam">filename</var>);<br>string <var class="pdparam">filename</var>;</code></p></div></div><div class="refsect1"><a name="id2718669"></a><h2><a name="id2718669"></a>DESCRIPTION</h2><p>
+-	  <tt>dump_open</tt> is called to open a <i>savefile</i>
++	</p></div></div><div class="refentry" lang="en"><div class="refentry.separator"><hr></div><a name="id2526958"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>dump_open &#8212; Create a Dumper object</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">Dumper <b class="fsfunc">dump_open</b>(</code></td><td><var class="pdparam">filename</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>string </code> </td><td><code><var class="pdparam">filename</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2526994"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">dump_open</code> is called to open a <em class="glossterm">savefile</em>
+ 	  for writing and associate it to a newly created
+-	  <tt>Dumper</tt> instance. The name
+-	  <tt>-</tt> is a synonym for <tt>stdout</tt>.
+-	  <i><tt>filename</tt></i> specifies the name of the
++	  <code class="classname">Dumper</code> instance. The name
++	  <code class="filename">-</code> is a synonym for <code class="filename">stdout</code>.
++	  <em class="parameter"><code>filename</code></em> specifies the name of the
+ 	  file to open.
+-	</p></div></div></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="id2718727"></a>Dumper Object Reference</h1></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2718732">dump</a></dt></dl></div><div class="refentry"><h1 class="title"><a name="id2718732"></a>dump</h1><div class="refnamediv"><a name="id2718735"></a><h2>Name</h2>dump &#8212; Dump a packet to a <i>savefile</i></div><div class="refsynopsisdiv"><a name="id2718751"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2718755"><a name="id2718755"></a><p><code><code class="funcdef"><b class="fsfunc">dump</b></code>(<var class="pdparam">header</var>, <var class="pdparam">data</var>);<br>Pkthdr <var class="pdparam">header</var>;<br>string <var class="pdparam">data</var>;</code></p></div></div><div class="refsect1"><a name="id2718793"></a><h2><a name="id2718793"></a>DESCRIPTION</h2><p>
+-	  <tt>dump</tt> outputs a packet to the <i>savefile</i>
+-	  opened with <tt>dump_open</tt> from type
+-	  <tt>Reader</tt>.
+-	</p></div></div></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="id2718829"></a>Pkthdr Object Reference</h1></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2718835">getts</a></dt></dl></div><div class="refentry"><h1 class="title"><a name="id2718835"></a>getts</h1><div class="refnamediv"><a name="id2718838"></a><h2>Name</h2>getts, getcaplen, getlen &#8212; Obtain packet header information</div><div class="refsynopsisdiv"><a name="id2780956"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2780959"><a name="id2780959"></a><p><code><code class="funcdef">(long, long) <b class="fsfunc">getts</b></code>();</code></p></div><div class="funcsynopsis" id="id2780980"><a name="id2780980"></a><p><code><code class="funcdef">long <b class="fsfunc">getcaplen</b></code>();</code></p></div><div class="funcsynopsis" id="id2781001"><a name="id2781001"></a><p><code><code class="funcdef">long <b class="fsfunc">getlen</b></code>();</code></p></div></div><div class="refsect1"><a name="id2781024"></a><h2><a name="id2781024"></a>DESCRIPTION</h2><p>
+-	  <tt>getts</tt>, <tt>getcaplen</tt>
+-	  and <tt>getlen</tt> return the timestamp,
++	</p></div></div></div><div class="reference" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2527039"></a>Dumper Object Reference</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="#id2527043">dump</a></span><span class="refpurpose"> &#8212; Dump a packet to a <em class="glossterm">savefile</em></span></dt></dl></div><div class="refentry" lang="en"><a name="id2527043"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>dump &#8212; Dump a packet to a <em class="glossterm">savefile</em></p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef"><b class="fsfunc">dump</b>(</code></td><td><var class="pdparam">header</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">data</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>Pkthdr </code> </td><td><code><var class="pdparam">header</var>;</code></td></tr><tr><td><code>string </code> </td><td><code><var class="pdparam">data</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2527088"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">dump</code> outputs a packet to the <em class="glossterm">savefile</em>
++	  opened with <code class="function">dump_open</code> from type
++	  <code class="classname">Reader</code>.
++	</p></div></div></div><div class="reference" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2527116"></a>Pkthdr Object Reference</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="#id2527121">getts</a></span><span class="refpurpose"> &#8212; Obtain packet header information</span></dt></dl></div><div class="refentry" lang="en"><a name="id2527121"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>getts, getcaplen, getlen &#8212; Obtain packet header information</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">(long, long) <b class="fsfunc">getts</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">long <b class="fsfunc">getcaplen</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">long <b class="fsfunc">getlen</b>(</code></td><td><code>)</code>;</td><td> </td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2527190"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">getts</code>, <code class="function">getcaplen</code>
++	  and <code class="function">getlen</code> return the timestamp,
+ 	  capture length and total length fields of the packet header,
+ 	  respectively.
+ 	</p><p>
+@@ -333,17 +340,17 @@
+ 	  bytes (which might be more than the number of bytes
+ 	  available from the capture, if the length of the packet is
+ 	  larger than the maximum number of bytes to capture).
+-	</p></div></div></div><div class="reference"><div class="titlepage"><div><h1 class="title"><a name="id2781073"></a>Bpf Object Reference</h1></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2781080">filter</a></dt></dl></div><div class="refentry"><h1 class="title"><a name="id2781080"></a>filter</h1><div class="refnamediv"><a name="id2781083"></a><h2>Name</h2>filter &#8212; Test a packet against a compiled filter</div><div class="refsynopsisdiv"><a name="id2781096"></a><h2>Synopsis</h2><div class="funcsynopsis" id="id2781099"><a name="id2781099"></a><p><code><code class="funcdef">int <b class="fsfunc">filter</b></code>(<var class="pdparam">packet</var>);<br>string <var class="pdparam">packet</var>;</code></p></div></div><div class="refsect1"><a name="id2781129"></a><h2><a name="id2781129"></a>DESCRIPTION</h2><p>
+-	  <tt>filter</tt> tests a packet against a
++	</p></div></div></div><div class="reference" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2527233"></a>Bpf Object Reference</h1></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="#id2527238">filter</a></span><span class="refpurpose"> &#8212; Test a packet against a compiled filter</span></dt></dl></div><div class="refentry" lang="en"><a name="id2527238"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>filter &#8212; Test a packet against a compiled filter</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">filter</b>(</code></td><td><var class="pdparam">packet</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td><code>string </code> </td><td><code><var class="pdparam">packet</var>;</code></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id2527274"></a><h2>DESCRIPTION</h2><p>
++	  <code class="function">filter</code> tests a packet against a
+ 	  compiled filter as returned by
+-	  <tt>pcapy</tt>'s <tt>compile</tt>.
++	  <code class="classname">pcapy</code>'s <code class="function">compile</code>.
+ 	  If the packet is allowed to pass through
+-	  -1 is returned, otherwise
+-	  <tt>filter</tt> returns
+-	  0.
+-	</p></div></div></div><div id="id2781178" class="bibliography"><div class="titlepage"><div><h2 class="title"><a name="id2781178"></a>Bibliography</h2></div></div><div class="bibliodiv"><h3 class="title"><a name="id2781186">Sources</a></h3><div id="id2781192" class="biblioentry"><a name="id2781192"></a><p><span class="bibliomisc">
++	  <span class="returnvalue">-1</span> is returned, otherwise
++	  <code class="function">filter</code> returns
++	  <span class="returnvalue">0</span>.
++	</p></div></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a name="id2527316"></a>Bibliography</h2></div></div></div><div class="bibliodiv"><h3 class="title">Sources</h3><div class="biblioentry"><a name="id2527326"></a><p><span class="bibliomisc">
+ 	  Portions of this work based on
+-	  pcap(3) by the Lawrence
++	  <span class="citerefentry"><span class="refentrytitle">pcap</span>(3)</span> by the Lawrence
+ 	  Berkeley National Laboratory, University of California,
+ 	  Berkeley, CA.
+ 	. </span></p></div></div></div></div></body></html>
diff -Nru pcapy-0.10.5/debian/watch pcapy-0.10.6/debian/watch
--- pcapy-0.10.5/debian/watch	2009-02-16 17:11:47.000000000 +0000
+++ pcapy-0.10.6/debian/watch	2009-02-16 17:11:47.000000000 +0000
@@ -1,2 +1,4 @@
 version=3
-http://oss.coresecurity.com/projects/pcapy.html \.\./repo/pcapy-(.*)\.tar\.gz
+opts=filenamemangle=s/.*=(.*)/$1/ \
+  http://corelabs.coresecurity.com/index.php?module=FrontEndMod&action=view&type=tool&name=Pcapy \
+  /attachment.php\?type=tool&page=Pcapy&file=pcapy-(\d[\d\.]*)\.tar\.gz
diff -Nru pcapy-0.10.5/pcapobj.cc pcapy-0.10.6/pcapobj.cc
--- pcapy-0.10.5/pcapobj.cc	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/pcapobj.cc	2008-10-24 19:50:26.000000000 +0100
@@ -5,7 +5,7 @@
  * of the Apache Software License. See the accompanying LICENSE file
  * for more information.
  *
- * $Id: pcapobj.cc,v 1.10 2007/03/27 17:26:13 max Exp $
+ * $Id: pcapobj.cc 41 2008-10-24 18:51:34Z aweil $
  */
 
 #include <Python.h>
@@ -50,7 +50,7 @@
 static PyObject* p_getnet(register pcapobject* pp, PyObject* args);
 static PyObject* p_getmask(register pcapobject* pp, PyObject* args);
 static PyObject* p_setfilter( register pcapobject* pp, PyObject* args );
-static PyObject* p_next(register pcapobject* pp, PyObject* args);
+static PyObject* p_next(register pcapobject* pp, PyObject*);
 static PyObject* p_dispatch(register pcapobject* pp, PyObject* args);
 static PyObject* p_loop(register pcapobject* pp, PyObject* args);
 static PyObject* p_datalink(register pcapobject* pp, PyObject* args);
@@ -63,7 +63,7 @@
 static PyMethodDef p_methods[] = {
   {"loop", (PyCFunction) p_loop, METH_VARARGS, "loops packet dispatching"},
   {"dispatch", (PyCFunction) p_dispatch, METH_VARARGS, "dispatchs packets"},
-  {"next", (PyCFunction) p_next, METH_VARARGS, "returns next packet"},
+  {"next", (PyCFunction) p_next, METH_NOARGS, "returns next packet"},
   {"setfilter", (PyCFunction) p_setfilter, METH_VARARGS, "compiles and sets a BPF capture filter"},
   {"getnet", (PyCFunction) p_getnet, METH_VARARGS, "returns the network address for the device"},
   {"getmask", (PyCFunction) p_getmask, METH_VARARGS, "returns the netmask for the device"},
@@ -191,7 +191,7 @@
 }
 
 static PyObject*
-p_next(register pcapobject* pp, PyObject* args)
+p_next(register pcapobject* pp, PyObject*)
 {
   struct pcap_pkthdr hdr;
   const unsigned char *buf;
@@ -214,11 +214,18 @@
     }
 
   PyObject *pkthdr = new_pcap_pkthdr(&hdr);
+    if (pkthdr)
+    {
+        PyObject *ret = NULL;
+        ret = Py_BuildValue("(Os#)", pkthdr, buf, hdr.caplen);
+        Py_DECREF(pkthdr);
+        return ret;
+    }
 
-  return Py_BuildValue("(Os#)", pkthdr, buf, hdr.caplen);
+  PyErr_SetString(PcapError, "Can't build pkthdr");
+  return NULL;
 }
 
-
 struct PcapCallbackContext {
   PcapCallbackContext(pcap_t* p, PyObject* f, PyThreadState* ts)
     : ppcap_t(p), pyfunc(f), thread_state(ts)
diff -Nru pcapy-0.10.5/pcap_pkthdr.cc pcapy-0.10.6/pcap_pkthdr.cc
--- pcapy-0.10.5/pcap_pkthdr.cc	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/pcap_pkthdr.cc	2008-10-24 19:30:30.000000000 +0100
@@ -5,7 +5,7 @@
  * of the Apache Software License. See the accompanying LICENSE file
  * for more information.
  *
- * $Id: pcap_pkthdr.cc,v 1.3 2003/10/23 20:00:53 jkohen Exp $
+ * $Id: pcap_pkthdr.cc 21 2003-10-23 20:00:54Z jkohen $
  */
 
 #include <Python.h>
diff -Nru pcapy-0.10.5/pcapy.xml pcapy-0.10.6/pcapy.xml
--- pcapy-0.10.5/pcapy.xml	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/pcapy.xml	2008-10-24 19:31:12.000000000 +0100
@@ -3,7 +3,7 @@
                "docbook/dtd/xml/4.1.2/docbookx.dtd" [
 <!ENTITY corest "CORE SECURITY TECHNOLOGIES">
 ]>
-<!-- $Id: pcapy.xml,v 1.2 2003/10/23 17:24:27 jkohen Exp $ -->
+<!-- $Id: pcapy.xml 15 2003-10-23 17:24:27Z jkohen $ -->
 <part>
   <partinfo>
     <copyright>
@@ -19,8 +19,8 @@
     </keywordset>
     <revhistory>
       <revision>
-	<revnumber>$Revision: 1.2 $</revnumber>
-	<date>$Date: 2003/10/23 17:24:27 $</date>
+	<revnumber>$Revision: 15 $</revnumber>
+	<date>$Date: 2003-10-23 14:24:27 -0300 (Jue, 23 Oct 2003) $</date>
 	<authorinitials>$Author: jkohen $</authorinitials>
 	<revremark>Initial revision</revremark>
       </revision>
diff -Nru pcapy-0.10.5/PKG-INFO pcapy-0.10.6/PKG-INFO
--- pcapy-0.10.5/PKG-INFO	2007-03-28 14:59:48.000000000 +0100
+++ pcapy-0.10.6/PKG-INFO	2008-10-24 22:46:31.000000000 +0100
@@ -1,10 +1,10 @@
-Metadata-Version: 1.0
-Name: pcapy
-Version: 0.10.5
-Summary: Python pcap extension
-Home-page: http://oss.coresecurity.com/projects/pcapy.html
-Author: Maximiliano Caceres
-Author-email: max@coresecurity.com
-License: UNKNOWN
-Description: UNKNOWN
-Platform: UNKNOWN
+Metadata-Version: 1.0
+Name: pcapy
+Version: 0.10.6
+Summary: Python pcap extension
+Home-page: http://oss.coresecurity.com/projects/pcapy.html
+Author: Core Security Technologies
+Author-email: oss@coresecurity.com
+License: UNKNOWN
+Description: UNKNOWN
+Platform: UNKNOWN
diff -Nru pcapy-0.10.5/README pcapy-0.10.6/README
--- pcapy-0.10.5/README	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/README	2008-10-21 22:52:50.000000000 +0100
@@ -82,4 +82,4 @@
 suggestions on this package, drop us a few lines at
 oss@coresecurity.com.
 
-$Id: README,v 1.3 2003/10/27 17:45:51 jkohen Exp $
+$Id: README 31 2003-10-27 17:45:51Z jkohen $
diff -Nru pcapy-0.10.5/setup.py pcapy-0.10.6/setup.py
--- pcapy-0.10.5/setup.py	2007-03-28 14:59:36.000000000 +0100
+++ pcapy-0.10.6/setup.py	2008-10-24 19:50:26.000000000 +0100
@@ -1,4 +1,4 @@
-# $Id: setup.py,v 1.11 2007/03/27 17:26:13 max Exp $
+# $Id: setup.py 41 2008-10-24 18:51:34Z aweil $
 
 from distutils.core import setup, Extension
 import sys, os
@@ -12,9 +12,9 @@
 
 if sys.platform =='win32':
     # WinPcap include files
-    include_dirs.append(r'c:\devel\wpdpack\Include')
+    include_dirs.append(r'c:\devel\oss\wpdpack\Include')
     # WinPcap library files
-    library_dirs.append(r'c:\devel\wpdpack\Lib')
+    library_dirs.append(r'c:\devel\oss\wpdpack\Lib')
     libraries = ['wpcap', 'packet', 'ws2_32']
 else:
     libraries = ['pcap']
@@ -46,12 +46,12 @@
 sysconfig._init_posix = my_init_posix
 
 setup(name = PACKAGE_NAME,
-      version = "0.10.5",
+      version = "0.10.6",
       url = "http://oss.coresecurity.com/projects/pcapy.html";,
       author = "Maximiliano Caceres",
-      author_email = "max@coresecurity.com",
-      maintainer = "Maximiliano Caceres",
-      maintainer_email = "max@coresecurity.com",
+      author_email = "oss@coresecurity.com",
+      maintainer = "Core Security Technologies",
+      maintainer_email = "oss@coresecurity.com",
       description = "Python pcap extension",
       ext_modules = [Extension(
           name = PACKAGE_NAME,
@@ -60,6 +60,7 @@
           include_dirs = include_dirs,
           library_dirs = library_dirs,
           libraries = libraries)],
+      scripts = ['tests/pcapytests.py', 'tests/96pings.pcap'],
       data_files = [(os.path.join('share', 'doc', PACKAGE_NAME),
                      ['README', 'LICENSE', 'pcapy.html'])],
       )
Les fichiers /tmp/Oa8ZaaGKr3/pcapy-0.10.5/tests/96pings.pcap et /tmp/rqqWxHrwbx/pcapy-0.10.6/tests/96pings.pcap sont différents.
diff -Nru pcapy-0.10.5/tests/pcapytests.py pcapy-0.10.6/tests/pcapytests.py
--- pcapy-0.10.5/tests/pcapytests.py	1970-01-01 01:00:00.000000000 +0100
+++ pcapy-0.10.6/tests/pcapytests.py	2008-10-24 19:35:14.000000000 +0100
@@ -0,0 +1,24 @@
+## Copyright (c) 2003 CORE Security Technologies
+##
+## This software is provided under under a slightly modified version
+## of the Apache Software License. See the accompanying LICENSE file
+## for more information.
+##
+## $Id: test.py 21 2003-10-23 20:00:54Z jkohen $
+import pcapy
+import sys
+import unittest
+
+class TestPcapy(unittest.TestCase):
+    _96PINGS = '96pings.pcap'
+    def testPacketHeaderRefCount(self):
+        """#1:when next() creates a pkthdr it make one extra reference"""
+        class _Simple: pass
+        #r = pcapy.open_live("en1", 65000, 0, 1000)
+        r = pcapy.open_offline(TestPcapy._96PINGS)
+        #get one & check its refcount
+        self.assertEqual( sys.getrefcount(r.next()[0]),
+                          sys.getrefcount(_Simple()) )
+
+suite = unittest.TestLoader().loadTestsFromTestCase(TestPcapy)
+unittest.TextTestRunner(verbosity=2).run(suite)
diff -Nru pcapy-0.10.5/win32/dllmain.cc pcapy-0.10.6/win32/dllmain.cc
--- pcapy-0.10.5/win32/dllmain.cc	2007-03-28 14:59:04.000000000 +0100
+++ pcapy-0.10.6/win32/dllmain.cc	2008-10-21 22:52:50.000000000 +0100
@@ -7,7 +7,7 @@
  *
  * Win32 DLL entry point.
  *
- * $Id: dllmain.cc,v 1.2 2003/10/23 20:00:54 jkohen Exp $
+ * $Id: dllmain.cc 21 2003-10-23 20:00:54Z jkohen $
  */
 
 #include <windows.h>

Attachment: pgpr1jRInkKUm.pgp
Description: PGP signature


Reply to: