Click here to Skip to main content
15,896,379 members
Articles / Programming Languages / C#

TCP Session Reconstruction Tool

Rate me:
Please Sign up or sign in to vote.
4.65/5 (17 votes)
21 Sep 2007CPOL6 min read 166.5K   8.2K   74  
A TCP session reconstruction tool for C#.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>WinPcap: pcap.h File Reference</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul></div>
<h1>pcap.h File Reference</h1><code>#include &lt;pcap-stdinc.h&gt;</code><br>
<code>#include &lt;net/bpf.h&gt;</code><br>
<code>#include &lt;stdio.h&gt;</code><br>

<p>
<a href="incs_2pcap_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcap__file__header.html">pcap_file_header</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Header of a libpcap dump file.  <a href="structpcap__file__header.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcap__pkthdr.html">pcap_pkthdr</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Header of a packet in the dump file.  <a href="structpcap__pkthdr.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcap__stat.html">pcap_stat</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Structure that keeps statistical values on an interface.  <a href="structpcap__stat.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcap__if.html">pcap_if</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Item in a list of interfaces, used by <a class="el" href="group__wpcapfunc.html#g7b128eaeef627b408f6a6e2a2f5eb45d">pcap_findalldevs()</a>.  <a href="structpcap__if.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcap__addr.html">pcap_addr</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of an interface address, used by <a class="el" href="group__wpcapfunc.html#g7b128eaeef627b408f6a6e2a2f5eb45d">pcap_findalldevs()</a>.  <a href="structpcap__addr.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#gac031371d41e21ff96e80409e05a7ddb">PCAP_VERSION_MAJOR</a>&nbsp;&nbsp;&nbsp;2</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Major libpcap dump file version.  <a href="group__wpcap__def.html#gac031371d41e21ff96e80409e05a7ddb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g9c200b070c9f626d38184588b16849c2">PCAP_VERSION_MINOR</a>&nbsp;&nbsp;&nbsp;4</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Minor libpcap dump file version.  <a href="group__wpcap__def.html#g9c200b070c9f626d38184588b16849c2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#gcd448353957d92c98fccc29e1fc8d927">PCAP_ERRBUF_SIZE</a>&nbsp;&nbsp;&nbsp;256</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Size to use when allocating the buffer that contains the libpcap errors.  <a href="group__wpcap__def.html#gcd448353957d92c98fccc29e1fc8d927"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g43a6601bfd438efc02b0ba71c5439647">PCAP_IF_LOOPBACK</a>&nbsp;&nbsp;&nbsp;0x00000001</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">interface is loopback  <a href="group__wpcap__def.html#g43a6601bfd438efc02b0ba71c5439647"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#gc93c0a6ad1d2a3143b1115bdab3ac04d">MODE_CAPT</a>&nbsp;&nbsp;&nbsp;0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Capture mode, to be used when calling <a class="el" href="group__wpcapfunc.html#gef07ef49d3c75644f3fd34518e2fe720">pcap_setmode()</a>.  <a href="group__wpcap__def.html#gc93c0a6ad1d2a3143b1115bdab3ac04d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g503326906a62e96c147ae6af31fb5659">MODE_STAT</a>&nbsp;&nbsp;&nbsp;1</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Statistical mode, to be used when calling <a class="el" href="group__wpcapfunc.html#gef07ef49d3c75644f3fd34518e2fe720">pcap_setmode()</a>.  <a href="group__wpcap__def.html#g503326906a62e96c147ae6af31fb5659"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g759c6336c1d9abb462d9248c5ca5c437">bpf_int32</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">32-bit integer  <a href="group__wpcap__def.html#g759c6336c1d9abb462d9248c5ca5c437"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef u_int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482">bpf_u_int32</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">32-bit unsigned integer  <a href="group__wpcap__def.html#g37fdbc8313e90fb2041203a2e40cd482"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef pcap&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7">pcap_t</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Descriptor of an open capture instance. This structure is <b>opaque</b> to the user, that handles its content through the functions provided by wpcap.dll.  <a href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef pcap_dumper&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8">pcap_dumper_t</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">libpcap savefile descriptor.  <a href="group__wpcap__def.html#gb8c7858aa3a7e3158d9d58cb113a2ae8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="structpcap__if.html">pcap_if</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#g3a6e7cbf8d9752da3add4676c7cd4c58">pcap_if_t</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Item in a list of interfaces, see <a class="el" href="structpcap__if.html">pcap_if</a>.  <a href="group__wpcap__def.html#g3a6e7cbf8d9752da3add4676c7cd4c58"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="structpcap__addr.html">pcap_addr</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wpcap__def.html#gd5c2e491e2ca9d8eefe4217021c99bdc">pcap_addr_t</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Representation of an interface address, see <a class="el" href="structpcap__addr.html">pcap_addr</a>.  <a href="group__wpcap__def.html#gd5c2e491e2ca9d8eefe4217021c99bdc"></a><br></td></tr>
</table>

<hr>
<p align="right"><img border="0" src="winpcap_small.gif" align="absbottom" width="91" height="27">
documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2007 
CACE Technologies. All rights reserved.</p>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer Microsoft
Israel Israel
Saar, has been programing since 1997. He enjoys taking things a part and designing simple solutions to complex problems. Currently, works for Microsoft writing in a variety of languages and flavors. During the last year he is taking a closer look into mobile and web development.

Comments and Discussions