123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.9.1"/>
- <title>My Project: Sniffer Class Reference</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <script type="text/javascript">
- $(document).ready(function() { init_search(); });
- </script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td style="padding-left: 0.5em;">
- <div id="projectname">My Project
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.9.1 -->
- <script type="text/javascript">
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- </script>
- <div id="navrow1" class="tabs">
- <ul class="tablist">
- <li><a href="index.html"><span>Main Page</span></a></li>
- <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
- <li><a href="files.html"><span>Files</span></a></li>
- <li>
- <div id="MSearchBox" class="MSearchBoxInactive">
- <span class="left">
- <img id="MSearchSelect" src="search/mag_sel.png"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- alt=""/>
- <input type="text" id="MSearchField" value="Search" accesskey="S"
- onfocus="searchBox.OnSearchFieldFocus(true)"
- onblur="searchBox.OnSearchFieldFocus(false)"
- onkeyup="searchBox.OnSearchFieldChange(event)"/>
- </span><span class="right">
- <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
- </span>
- </div>
- </li>
- </ul>
- </div>
- <div id="navrow2" class="tabs2">
- <ul class="tablist">
- <li><a href="annotated.html"><span>Class List</span></a></li>
- <li><a href="classes.html"><span>Class Index</span></a></li>
- <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
- <li><a href="functions.html"><span>Class Members</span></a></li>
- </ul>
- </div>
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
-
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
-
- </div><!-- top -->
- <div class="header">
- <div class="summary">
- <a href="#pub-slots">Public Slots</a> |
- <a href="#signals">Signals</a> |
- <a href="#pub-methods">Public Member Functions</a> |
- <a href="#pri-methods">Private Member Functions</a> |
- <a href="#pri-attribs">Private Attributes</a> |
- <a href="class_sniffer-members.html">List of all members</a> </div>
- <div class="headertitle">
- <div class="title">Sniffer Class Reference</div> </div>
- </div><!--header-->
- <div class="contents">
-
- <p>The <a class="el" href="class_sniffer.html" title="The Sniffer class is the one that use the pcap library to extract the packet information. It discards any packet that is not Ethernet->IP->(TCP|UDP), and pass up to the GUI the packets that are Ethernet->IP->(TCP|UDP). ">Sniffer</a> class is the one that use the pcap library to extract the packet information. It discards any packet that is not Ethernet->IP->(TCP|UDP), and pass up to the GUI the packets that are Ethernet->IP->(TCP|UDP).
- <a href="class_sniffer.html#details">More...</a></p>
-
- <p><code>#include <<a class="el" href="sniffer_8h_source.html">sniffer.h</a>></code></p>
- <div class="dynheader">
- Inheritance diagram for Sniffer:</div>
- <div class="dyncontent">
- <div class="center">
- <img src="class_sniffer.png" usemap="#Sniffer_map" alt=""/>
- <map id="Sniffer_map" name="Sniffer_map">
- </map>
- </div></div>
- <table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
- Public Slots</h2></td></tr>
- <tr class="memitem:a6fc78b66d2f4dce0cc3662dacf171514"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6fc78b66d2f4dce0cc3662dacf171514"></a>
- void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a6fc78b66d2f4dce0cc3662dacf171514">process</a> ()</td></tr>
- <tr class="memdesc:a6fc78b66d2f4dce0cc3662dacf171514"><td class="mdescLeft"> </td><td class="mdescRight">The sniffer is run as a separate thread and the function process is the main function of the thread. It is the sniffer. <br /></td></tr>
- <tr class="separator:a6fc78b66d2f4dce0cc3662dacf171514"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
- Signals</h2></td></tr>
- <tr class="memitem:a7d0fd40379b7e5f49aff18ac20cb1c45"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7d0fd40379b7e5f49aff18ac20cb1c45"></a>
- void </td><td class="memItemRight" valign="bottom"><b>resultReady</b> (unsigned long index)</td></tr>
- <tr class="separator:a7d0fd40379b7e5f49aff18ac20cb1c45"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
- Public Member Functions</h2></td></tr>
- <tr class="memitem:a8039cbd5f487a357321d57337a664d3d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8039cbd5f487a357321d57337a664d3d"></a>
-  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a8039cbd5f487a357321d57337a664d3d">Sniffer</a> ()</td></tr>
- <tr class="memdesc:a8039cbd5f487a357321d57337a664d3d"><td class="mdescLeft"> </td><td class="mdescRight">Constructor, does nothing. <br /></td></tr>
- <tr class="separator:a8039cbd5f487a357321d57337a664d3d"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a8e5f1474f756be527b4c39a3e9a83893"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a8e5f1474f756be527b4c39a3e9a83893">Sniffer</a> (QWaitCondition *pw, QMutex *mx, int *ps)</td></tr>
- <tr class="memdesc:a8e5f1474f756be527b4c39a3e9a83893"><td class="mdescLeft"> </td><td class="mdescRight">Sets the mutexes for the inter communication between the sniffer and the GUI. <a href="#a8e5f1474f756be527b4c39a3e9a83893">More...</a><br /></td></tr>
- <tr class="separator:a8e5f1474f756be527b4c39a3e9a83893"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a8ad3b97292e2cc274f31d87701f92be2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8ad3b97292e2cc274f31d87701f92be2"></a>
-  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a8ad3b97292e2cc274f31d87701f92be2">~Sniffer</a> ()</td></tr>
- <tr class="memdesc:a8ad3b97292e2cc274f31d87701f92be2"><td class="mdescLeft"> </td><td class="mdescRight">Destructor, does nothing. <br /></td></tr>
- <tr class="separator:a8ad3b97292e2cc274f31d87701f92be2"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a791027d276cfcc5e6849132ecf8e80b6"><td class="memItemLeft" align="right" valign="top">vector< <a class="el" href="classip__packet.html">ip_packet</a> > * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a791027d276cfcc5e6849132ecf8e80b6">getPacketList</a> ()</td></tr>
- <tr class="memdesc:a791027d276cfcc5e6849132ecf8e80b6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the packet list that contains the packets that are Ethernet -> IP -> (TCP|UDP) <a href="#a791027d276cfcc5e6849132ecf8e80b6">More...</a><br /></td></tr>
- <tr class="separator:a791027d276cfcc5e6849132ecf8e80b6"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a3dd95c60c5b8554e1bedc22b36ae488c"><td class="memItemLeft" align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a3dd95c60c5b8554e1bedc22b36ae488c">format_payload</a> (const char *payload, int len)</td></tr>
- <tr class="memdesc:a3dd95c60c5b8554e1bedc22b36ae488c"><td class="mdescLeft"> </td><td class="mdescRight">Formats the payload from a byte stream into a string of ascci. <a href="#a3dd95c60c5b8554e1bedc22b36ae488c">More...</a><br /></td></tr>
- <tr class="separator:a3dd95c60c5b8554e1bedc22b36ae488c"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a02101b56a75804d1ed39a1c04ba36ab2"><td class="memItemLeft" align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a02101b56a75804d1ed39a1c04ba36ab2">format_hex_ascii_line</a> (const char *payload, int len, int offset)</td></tr>
- <tr class="memdesc:a02101b56a75804d1ed39a1c04ba36ab2"><td class="mdescLeft"> </td><td class="mdescRight">Return string with the bytes of a payload line in ascii. <a href="#a02101b56a75804d1ed39a1c04ba36ab2">More...</a><br /></td></tr>
- <tr class="separator:a02101b56a75804d1ed39a1c04ba36ab2"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a94d7cd87d0f181c3cf2e5ec851e370b6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a94d7cd87d0f181c3cf2e5ec851e370b6">find_devices</a> (vector< string > &)</td></tr>
- <tr class="memdesc:a94d7cd87d0f181c3cf2e5ec851e370b6"><td class="mdescLeft"> </td><td class="mdescRight">Find the network devices in the computer, and store them in vector devs. <a href="#a94d7cd87d0f181c3cf2e5ec851e370b6">More...</a><br /></td></tr>
- <tr class="separator:a94d7cd87d0f181c3cf2e5ec851e370b6"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ab706811aa2b285e4c0f55491703c105a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#ab706811aa2b285e4c0f55491703c105a">setDevice</a> (string)</td></tr>
- <tr class="memdesc:ab706811aa2b285e4c0f55491703c105a"><td class="mdescLeft"> </td><td class="mdescRight">Sets the device to capture packets to dev. <a href="#ab706811aa2b285e4c0f55491703c105a">More...</a><br /></td></tr>
- <tr class="separator:ab706811aa2b285e4c0f55491703c105a"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
- Private Member Functions</h2></td></tr>
- <tr class="memitem:ac05f935a6ec2830d6bf42b607f071910"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#ac05f935a6ec2830d6bf42b607f071910">print_payload</a> (const u_char *payload, int len)</td></tr>
- <tr class="memdesc:ac05f935a6ec2830d6bf42b607f071910"><td class="mdescLeft"> </td><td class="mdescRight">Prints the payload in ascii. <a href="#ac05f935a6ec2830d6bf42b607f071910">More...</a><br /></td></tr>
- <tr class="separator:ac05f935a6ec2830d6bf42b607f071910"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a70598d5001a30cc8e801f1262770cdf6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a70598d5001a30cc8e801f1262770cdf6">print_hex_ascii_line</a> (const u_char *payload, int len, int offset)</td></tr>
- <tr class="memdesc:a70598d5001a30cc8e801f1262770cdf6"><td class="mdescLeft"> </td><td class="mdescRight">Prints to std output the a payload in ascii. <a href="#a70598d5001a30cc8e801f1262770cdf6">More...</a><br /></td></tr>
- <tr class="separator:a70598d5001a30cc8e801f1262770cdf6"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a0179e32fee6a0f7c2a13f37d64a7fae0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_sniffer.html#a0179e32fee6a0f7c2a13f37d64a7fae0">got_packet</a> (const struct pcap_pkthdr *header, const u_char *packet)</td></tr>
- <tr class="memdesc:a0179e32fee6a0f7c2a13f37d64a7fae0"><td class="mdescLeft"> </td><td class="mdescRight">Disects the received packet. Takes out the info needed. <a href="#a0179e32fee6a0f7c2a13f37d64a7fae0">More...</a><br /></td></tr>
- <tr class="separator:a0179e32fee6a0f7c2a13f37d64a7fae0"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
- Private Attributes</h2></td></tr>
- <tr class="memitem:ad3ad83091913a50effd7468d8d7ca590"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad3ad83091913a50effd7468d8d7ca590"></a>
- vector< <a class="el" href="classip__packet.html">ip_packet</a> > </td><td class="memItemRight" valign="bottom"><b>packet_list</b></td></tr>
- <tr class="separator:ad3ad83091913a50effd7468d8d7ca590"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a36e1964fbc960b60a09b425a7cd1c0f6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a36e1964fbc960b60a09b425a7cd1c0f6"></a>
- QWaitCondition * </td><td class="memItemRight" valign="bottom"><b>wait_pause</b></td></tr>
- <tr class="separator:a36e1964fbc960b60a09b425a7cd1c0f6"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ae0d6a92d2224a8c927afe861d45ab182"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae0d6a92d2224a8c927afe861d45ab182"></a>
- QMutex * </td><td class="memItemRight" valign="bottom"><b>mutex</b></td></tr>
- <tr class="separator:ae0d6a92d2224a8c927afe861d45ab182"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:ac35f2e04e7f7668243a75bd9b9b44028"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac35f2e04e7f7668243a75bd9b9b44028"></a>
- string </td><td class="memItemRight" valign="bottom"><b>device</b></td></tr>
- <tr class="separator:ac35f2e04e7f7668243a75bd9b9b44028"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:abb7dd6858499a14bcf002ba86e2d3f7f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abb7dd6858499a14bcf002ba86e2d3f7f"></a>
- string </td><td class="memItemRight" valign="bottom"><b>filter</b></td></tr>
- <tr class="separator:abb7dd6858499a14bcf002ba86e2d3f7f"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a2fde6ba65f629b1c74b1fcd1b8d2c022"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2fde6ba65f629b1c74b1fcd1b8d2c022"></a>
- int * </td><td class="memItemRight" valign="bottom"><b>pause</b></td></tr>
- <tr class="separator:a2fde6ba65f629b1c74b1fcd1b8d2c022"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
- <div class="textblock"><p>The <a class="el" href="class_sniffer.html" title="The Sniffer class is the one that use the pcap library to extract the packet information. It discards any packet that is not Ethernet->IP->(TCP|UDP), and pass up to the GUI the packets that are Ethernet->IP->(TCP|UDP). ">Sniffer</a> class is the one that use the pcap library to extract the packet information. It discards any packet that is not Ethernet->IP->(TCP|UDP), and pass up to the GUI the packets that are Ethernet->IP->(TCP|UDP). </p>
- </div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
- <a class="anchor" id="a8e5f1474f756be527b4c39a3e9a83893"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">Sniffer::Sniffer </td>
- <td>(</td>
- <td class="paramtype">QWaitCondition * </td>
- <td class="paramname"><em>pw</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">QMutex * </td>
- <td class="paramname"><em>mx</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int * </td>
- <td class="paramname"><em>ps</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Sets the mutexes for the inter communication between the sniffer and the GUI. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">pw</td><td>used to pause the capture of packets </td></tr>
- <tr><td class="paramname">mx</td><td>used to protect critical region </td></tr>
- <tr><td class="paramname">ps</td><td>flag to pause the packet capture </td></tr>
- </table>
- </dd>
- </dl>
-
- </div>
- </div>
- <h2 class="groupheader">Member Function Documentation</h2>
- <a class="anchor" id="a94d7cd87d0f181c3cf2e5ec851e370b6"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void Sniffer::find_devices </td>
- <td>(</td>
- <td class="paramtype">vector< string > & </td>
- <td class="paramname"><em>devs</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Find the network devices in the computer, and store them in vector devs. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">devs</td><td>vector of string for device names </td></tr>
- </table>
- </dd>
- </dl>
-
- </div>
- </div>
- <a class="anchor" id="a02101b56a75804d1ed39a1c04ba36ab2"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">string Sniffer::format_hex_ascii_line </td>
- <td>(</td>
- <td class="paramtype">const char * </td>
- <td class="paramname"><em>payload</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>len</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>offset</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Return string with the bytes of a payload line in ascii. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">payload</td><td>payload of the packet </td></tr>
- <tr><td class="paramname">len</td><td>length of the packet </td></tr>
- <tr><td class="paramname">offset</td><td>offset of packet </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>a string with the bytes of a payload line in ascii </dd></dl>
-
- </div>
- </div>
- <a class="anchor" id="a3dd95c60c5b8554e1bedc22b36ae488c"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">string Sniffer::format_payload </td>
- <td>(</td>
- <td class="paramtype">const char * </td>
- <td class="paramname"><em>payload</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>len</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Formats the payload from a byte stream into a string of ascci. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">payload</td><td>payload of the packet </td></tr>
- <tr><td class="paramname">len</td><td>length of the packet </td></tr>
- </table>
- </dd>
- </dl>
- <dl class="section return"><dt>Returns</dt><dd>the payload in a string of ascii </dd></dl>
-
- </div>
- </div>
- <a class="anchor" id="a791027d276cfcc5e6849132ecf8e80b6"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">vector< <a class="el" href="classip__packet.html">ip_packet</a> > * Sniffer::getPacketList </td>
- <td>(</td>
- <td class="paramname"></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Returns the packet list that contains the packets that are Ethernet -> IP -> (TCP|UDP) </p>
- <dl class="section return"><dt>Returns</dt><dd>vector of packets </dd></dl>
-
- </div>
- </div>
- <a class="anchor" id="a0179e32fee6a0f7c2a13f37d64a7fae0"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void Sniffer::got_packet </td>
- <td>(</td>
- <td class="paramtype">const struct pcap_pkthdr * </td>
- <td class="paramname"><em>header</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">const u_char * </td>
- <td class="paramname"><em>packet</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">private</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Disects the received packet. Takes out the info needed. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">pcap_pkthdr</td><td>header of the pcap packet </td></tr>
- <tr><td class="paramname">packet</td><td>recieved packet </td></tr>
- </table>
- </dd>
- </dl>
-
- </div>
- </div>
- <a class="anchor" id="a70598d5001a30cc8e801f1262770cdf6"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void Sniffer::print_hex_ascii_line </td>
- <td>(</td>
- <td class="paramtype">const u_char * </td>
- <td class="paramname"><em>payload</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>len</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>offset</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">private</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Prints to std output the a payload in ascii. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">payload</td><td>payload of the packet </td></tr>
- <tr><td class="paramname">len</td><td>length of the packet </td></tr>
- <tr><td class="paramname">offset</td><td>offset </td></tr>
- </table>
- </dd>
- </dl>
-
- </div>
- </div>
- <a class="anchor" id="ac05f935a6ec2830d6bf42b607f071910"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">void Sniffer::print_payload </td>
- <td>(</td>
- <td class="paramtype">const u_char * </td>
- <td class="paramname"><em>payload</em>, </td>
- </tr>
- <tr>
- <td class="paramkey"></td>
- <td></td>
- <td class="paramtype">int </td>
- <td class="paramname"><em>len</em> </td>
- </tr>
- <tr>
- <td></td>
- <td>)</td>
- <td></td><td></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">private</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Prints the payload in ascii. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">payload</td><td>payload of the packet </td></tr>
- <tr><td class="paramname">len</td><td>payload length </td></tr>
- </table>
- </dd>
- </dl>
-
- </div>
- </div>
- <a class="anchor" id="ab706811aa2b285e4c0f55491703c105a"></a>
- <div class="memitem">
- <div class="memproto">
- <table class="memname">
- <tr>
- <td class="memname">void Sniffer::setDevice </td>
- <td>(</td>
- <td class="paramtype">string </td>
- <td class="paramname"><em>dev</em></td><td>)</td>
- <td></td>
- </tr>
- </table>
- </div><div class="memdoc">
-
- <p>Sets the device to capture packets to dev. </p>
- <dl class="params"><dt>Parameters</dt><dd>
- <table class="params">
- <tr><td class="paramname">dev</td><td>name of the device </td></tr>
- </table>
- </dd>
- </dl>
-
- </div>
- </div>
- <hr/>The documentation for this class was generated from the following files:<ul>
- <li><a class="el" href="sniffer_8h_source.html">sniffer.h</a></li>
- <li>sniffer.cpp</li>
- </ul>
- </div><!-- contents -->
- <!-- start footer part -->
- <hr class="footer"/><address class="footer"><small>
- Generated on Wed Jun 24 2015 15:25:13 for My Project by  <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/>
- </a> 1.8.9.1
- </small></address>
- </body>
- </html>
|