Nenhuma descrição

classip__packet.html 31KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.9.1"/>
  7. <title>My Project: ip_packet Class Reference</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="search/searchdata.js"></script>
  13. <script type="text/javascript" src="search/search.js"></script>
  14. <script type="text/javascript">
  15. $(document).ready(function() { init_search(); });
  16. </script>
  17. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  18. </head>
  19. <body>
  20. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  21. <div id="titlearea">
  22. <table cellspacing="0" cellpadding="0">
  23. <tbody>
  24. <tr style="height: 56px;">
  25. <td style="padding-left: 0.5em;">
  26. <div id="projectname">My Project
  27. </div>
  28. </td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. </div>
  33. <!-- end header part -->
  34. <!-- Generated by Doxygen 1.8.9.1 -->
  35. <script type="text/javascript">
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. </script>
  38. <div id="navrow1" class="tabs">
  39. <ul class="tablist">
  40. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  41. <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
  42. <li><a href="files.html"><span>Files</span></a></li>
  43. <li>
  44. <div id="MSearchBox" class="MSearchBoxInactive">
  45. <span class="left">
  46. <img id="MSearchSelect" src="search/mag_sel.png"
  47. onmouseover="return searchBox.OnSearchSelectShow()"
  48. onmouseout="return searchBox.OnSearchSelectHide()"
  49. alt=""/>
  50. <input type="text" id="MSearchField" value="Search" accesskey="S"
  51. onfocus="searchBox.OnSearchFieldFocus(true)"
  52. onblur="searchBox.OnSearchFieldFocus(false)"
  53. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  54. </span><span class="right">
  55. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  56. </span>
  57. </div>
  58. </li>
  59. </ul>
  60. </div>
  61. <div id="navrow2" class="tabs2">
  62. <ul class="tablist">
  63. <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
  64. <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
  65. <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
  66. <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
  67. </ul>
  68. </div>
  69. <!-- window showing the filter options -->
  70. <div id="MSearchSelectWindow"
  71. onmouseover="return searchBox.OnSearchSelectShow()"
  72. onmouseout="return searchBox.OnSearchSelectHide()"
  73. onkeydown="return searchBox.OnSearchSelectKey(event)">
  74. </div>
  75. <!-- iframe showing the search results (closed by default) -->
  76. <div id="MSearchResultsWindow">
  77. <iframe src="javascript:void(0)" frameborder="0"
  78. name="MSearchResults" id="MSearchResults">
  79. </iframe>
  80. </div>
  81. </div><!-- top -->
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-methods">Public Member Functions</a> &#124;
  85. <a href="#pri-attribs">Private Attributes</a> &#124;
  86. <a href="classip__packet-members.html">List of all members</a> </div>
  87. <div class="headertitle">
  88. <div class="title">ip_packet Class Reference</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <p>The <a class="el" href="classip__packet.html" title="The ip_packet class contains the information extracted from a packet received using pcap for packets ...">ip_packet</a> class contains the information extracted from a packet received using pcap for packets that are IP/TCP or IP/UDP. We only save src and dst addresses and ports, and type of Transport protocol. The class hinerates the fields hardware address field because every IP packet is part of a ethernet packet. The remaining packet is stored as payload.
  92. <a href="classip__packet.html#details">More...</a></p>
  93. <p><code>#include &lt;<a class="el" href="ip__packet_8h_source.html">ip_packet.h</a>&gt;</code></p>
  94. <div class="dynheader">
  95. Inheritance diagram for ip_packet:</div>
  96. <div class="dyncontent">
  97. <div class="center">
  98. <img src="classip__packet.png" usemap="#ip_packet_map" alt=""/>
  99. <map id="ip_packet_map" name="ip_packet_map">
  100. <area href="classethernet__packet.html" title="The ethernet_packet class contains function to change the ethernet information in bytes from the ethe..." alt="ethernet_packet" shape="rect" coords="0,0,102,24"/>
  101. </map>
  102. </div></div>
  103. <table class="memberdecls">
  104. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  105. Public Member Functions</h2></td></tr>
  106. <tr class="memitem:a331b530912b6fa3b2bbc9a6f0dbe6d90"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a331b530912b6fa3b2bbc9a6f0dbe6d90"></a>
  107. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a331b530912b6fa3b2bbc9a6f0dbe6d90">ip_packet</a> ()</td></tr>
  108. <tr class="memdesc:a331b530912b6fa3b2bbc9a6f0dbe6d90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
  109. <tr class="separator:a331b530912b6fa3b2bbc9a6f0dbe6d90"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:a5542509eb012fbf4f831dfec39f27307"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a5542509eb012fbf4f831dfec39f27307">setIPSAddress</a> (string)</td></tr>
  111. <tr class="memdesc:a5542509eb012fbf4f831dfec39f27307"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the source IP address in std string format. <a href="#a5542509eb012fbf4f831dfec39f27307">More...</a><br /></td></tr>
  112. <tr class="separator:a5542509eb012fbf4f831dfec39f27307"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:a6083cc5d06be5bb11c266efbdd961f61"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a6083cc5d06be5bb11c266efbdd961f61">setIPDAddress</a> (string)</td></tr>
  114. <tr class="memdesc:a6083cc5d06be5bb11c266efbdd961f61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the destination IP address in std string format. <a href="#a6083cc5d06be5bb11c266efbdd961f61">More...</a><br /></td></tr>
  115. <tr class="separator:a6083cc5d06be5bb11c266efbdd961f61"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. <tr class="memitem:a661b3d3c30388290ce4f479c6a00b38c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a661b3d3c30388290ce4f479c6a00b38c">setIPProto</a> (char)</td></tr>
  117. <tr class="memdesc:a661b3d3c30388290ce4f479c6a00b38c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the IP protocol to (TCP|UDP) <a href="#a661b3d3c30388290ce4f479c6a00b38c">More...</a><br /></td></tr>
  118. <tr class="separator:a661b3d3c30388290ce4f479c6a00b38c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. <tr class="memitem:a33ac2122569abba5eea67bd117e3790e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a33ac2122569abba5eea67bd117e3790e">setIPSPort</a> (unsigned short)</td></tr>
  120. <tr class="memdesc:a33ac2122569abba5eea67bd117e3790e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the source port. <a href="#a33ac2122569abba5eea67bd117e3790e">More...</a><br /></td></tr>
  121. <tr class="separator:a33ac2122569abba5eea67bd117e3790e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  122. <tr class="memitem:a96103b6cecb324c633e5bd74fee281e2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a96103b6cecb324c633e5bd74fee281e2">setIPDPort</a> (unsigned short)</td></tr>
  123. <tr class="memdesc:a96103b6cecb324c633e5bd74fee281e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the destinaation port. <a href="#a96103b6cecb324c633e5bd74fee281e2">More...</a><br /></td></tr>
  124. <tr class="separator:a96103b6cecb324c633e5bd74fee281e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. <tr class="memitem:ac46158915c7d7a4a652ede4246fad8df"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#ac46158915c7d7a4a652ede4246fad8df">setPayload</a> (char *, int)</td></tr>
  126. <tr class="memdesc:ac46158915c7d7a4a652ede4246fad8df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Saves the payload string of bytes into a string. <a href="#ac46158915c7d7a4a652ede4246fad8df">More...</a><br /></td></tr>
  127. <tr class="separator:ac46158915c7d7a4a652ede4246fad8df"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. <tr class="memitem:ac4baa351e90aa90ee8bedd1239d24183"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#ac4baa351e90aa90ee8bedd1239d24183">getIPSAddress</a> ()</td></tr>
  129. <tr class="memdesc:ac4baa351e90aa90ee8bedd1239d24183"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the source IP address. <a href="#ac4baa351e90aa90ee8bedd1239d24183">More...</a><br /></td></tr>
  130. <tr class="separator:ac4baa351e90aa90ee8bedd1239d24183"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:a5396956d60ddb6a1bb1bd2f6f2b4751b"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a5396956d60ddb6a1bb1bd2f6f2b4751b">getIPDAddress</a> ()</td></tr>
  132. <tr class="memdesc:a5396956d60ddb6a1bb1bd2f6f2b4751b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the destination IP address. <a href="#a5396956d60ddb6a1bb1bd2f6f2b4751b">More...</a><br /></td></tr>
  133. <tr class="separator:a5396956d60ddb6a1bb1bd2f6f2b4751b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  134. <tr class="memitem:a8b774913ecf9d9cda07dd088818ef481"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a8b774913ecf9d9cda07dd088818ef481">getPayload</a> ()</td></tr>
  135. <tr class="memdesc:a8b774913ecf9d9cda07dd088818ef481"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the IP packet payload. <a href="#a8b774913ecf9d9cda07dd088818ef481">More...</a><br /></td></tr>
  136. <tr class="separator:a8b774913ecf9d9cda07dd088818ef481"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:a78e1e0e7d107ac449fe224d95bcbd999"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a78e1e0e7d107ac449fe224d95bcbd999">getIPProto</a> ()</td></tr>
  138. <tr class="memdesc:a78e1e0e7d107ac449fe224d95bcbd999"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the IP protocol type. <a href="#a78e1e0e7d107ac449fe224d95bcbd999">More...</a><br /></td></tr>
  139. <tr class="separator:a78e1e0e7d107ac449fe224d95bcbd999"><td class="memSeparator" colspan="2">&#160;</td></tr>
  140. <tr class="memitem:a9697bad155ec10c25151a6c1f5a434b0"><td class="memItemLeft" align="right" valign="top">unsigned short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a9697bad155ec10c25151a6c1f5a434b0">getIPSPort</a> ()</td></tr>
  141. <tr class="memdesc:a9697bad155ec10c25151a6c1f5a434b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the source port. <a href="#a9697bad155ec10c25151a6c1f5a434b0">More...</a><br /></td></tr>
  142. <tr class="separator:a9697bad155ec10c25151a6c1f5a434b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:a1a31307b3e7912ba3a1817041725660e"><td class="memItemLeft" align="right" valign="top">unsigned short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a1a31307b3e7912ba3a1817041725660e">getIPDPort</a> ()</td></tr>
  144. <tr class="memdesc:a1a31307b3e7912ba3a1817041725660e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the destination port. <a href="#a1a31307b3e7912ba3a1817041725660e">More...</a><br /></td></tr>
  145. <tr class="separator:a1a31307b3e7912ba3a1817041725660e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  146. <tr class="inherit_header pub_methods_classethernet__packet"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classethernet__packet')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classethernet__packet.html">ethernet_packet</a></td></tr>
  147. <tr class="memitem:a4986a171f2710d2f7385adc9698be32c inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4986a171f2710d2f7385adc9698be32c"></a>
  148. &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#a4986a171f2710d2f7385adc9698be32c">ethernet_packet</a> ()</td></tr>
  149. <tr class="memdesc:a4986a171f2710d2f7385adc9698be32c inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor, does nothing. <br /></td></tr>
  150. <tr class="separator:a4986a171f2710d2f7385adc9698be32c inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  151. <tr class="memitem:acd600b879a9ea2b3753680c5e8a3ef88 inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#acd600b879a9ea2b3753680c5e8a3ef88">setEtherDHost</a> (u_char[])</td></tr>
  152. <tr class="memdesc:acd600b879a9ea2b3753680c5e8a3ef88 inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receives the array of 6 bytes of a destination host. <a href="#acd600b879a9ea2b3753680c5e8a3ef88">More...</a><br /></td></tr>
  153. <tr class="separator:acd600b879a9ea2b3753680c5e8a3ef88 inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  154. <tr class="memitem:aab9239c39e891929b316654b77ff9c38 inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#aab9239c39e891929b316654b77ff9c38">setEtherSHost</a> (u_char[])</td></tr>
  155. <tr class="memdesc:aab9239c39e891929b316654b77ff9c38 inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Receives the array of 6 bytes of a source host. <a href="#aab9239c39e891929b316654b77ff9c38">More...</a><br /></td></tr>
  156. <tr class="separator:aab9239c39e891929b316654b77ff9c38 inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  157. <tr class="memitem:ad42d30ecbabfbce466fbbf9153977fc8 inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#ad42d30ecbabfbce466fbbf9153977fc8">setEtherType</a> (u_short)</td></tr>
  158. <tr class="memdesc:ad42d30ecbabfbce466fbbf9153977fc8 inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the Ethernet type. <a href="#ad42d30ecbabfbce466fbbf9153977fc8">More...</a><br /></td></tr>
  159. <tr class="separator:ad42d30ecbabfbce466fbbf9153977fc8 inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  160. <tr class="memitem:affa9f0bd4139a1b435e00401da1085f1 inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#affa9f0bd4139a1b435e00401da1085f1">getEtherDHost</a> ()</td></tr>
  161. <tr class="memdesc:affa9f0bd4139a1b435e00401da1085f1 inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the destination HA in string format. <a href="#affa9f0bd4139a1b435e00401da1085f1">More...</a><br /></td></tr>
  162. <tr class="separator:affa9f0bd4139a1b435e00401da1085f1 inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  163. <tr class="memitem:aa86115cbbf7baab794766ced8b27edb3 inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#aa86115cbbf7baab794766ced8b27edb3">getEtherSHost</a> ()</td></tr>
  164. <tr class="memdesc:aa86115cbbf7baab794766ced8b27edb3 inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the source HA in string format. <a href="#aa86115cbbf7baab794766ced8b27edb3">More...</a><br /></td></tr>
  165. <tr class="separator:aa86115cbbf7baab794766ced8b27edb3 inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  166. <tr class="memitem:a29151c42a4d2bbbec4909d7bed7592a6 inherit pub_methods_classethernet__packet"><td class="memItemLeft" align="right" valign="top">u_short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classethernet__packet.html#a29151c42a4d2bbbec4909d7bed7592a6">getEtherType</a> ()</td></tr>
  167. <tr class="memdesc:a29151c42a4d2bbbec4909d7bed7592a6 inherit pub_methods_classethernet__packet"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the Ethernet type. <a href="#a29151c42a4d2bbbec4909d7bed7592a6">More...</a><br /></td></tr>
  168. <tr class="separator:a29151c42a4d2bbbec4909d7bed7592a6 inherit pub_methods_classethernet__packet"><td class="memSeparator" colspan="2">&#160;</td></tr>
  169. </table><table class="memberdecls">
  170. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
  171. Private Attributes</h2></td></tr>
  172. <tr class="memitem:a4225b27fe714e0a321e1dd04355e5370"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4225b27fe714e0a321e1dd04355e5370"></a>
  173. string&#160;</td><td class="memItemRight" valign="bottom"><b>ip_src</b></td></tr>
  174. <tr class="separator:a4225b27fe714e0a321e1dd04355e5370"><td class="memSeparator" colspan="2">&#160;</td></tr>
  175. <tr class="memitem:af3a920730b654dc7d26e155d509234fc"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#af3a920730b654dc7d26e155d509234fc">ip_dst</a></td></tr>
  176. <tr class="separator:af3a920730b654dc7d26e155d509234fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:a6d562e562de60c518542cd250d9986b0"><td class="memItemLeft" align="right" valign="top">char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a6d562e562de60c518542cd250d9986b0">ip_p</a></td></tr>
  178. <tr class="separator:a6d562e562de60c518542cd250d9986b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  179. <tr class="memitem:a51f1c0f6cc53460164467a7e80d849b5"><td class="memItemLeft" align="right" valign="top">unsigned short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a51f1c0f6cc53460164467a7e80d849b5">d_port</a></td></tr>
  180. <tr class="separator:a51f1c0f6cc53460164467a7e80d849b5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  181. <tr class="memitem:a12b33dcaa7ab59d15f3ce4b8ca6750fd"><td class="memItemLeft" align="right" valign="top">unsigned short&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a12b33dcaa7ab59d15f3ce4b8ca6750fd">s_port</a></td></tr>
  182. <tr class="separator:a12b33dcaa7ab59d15f3ce4b8ca6750fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  183. <tr class="memitem:a68c32f352a4f43fd910fb3bba3ddfae0"><td class="memItemLeft" align="right" valign="top">string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classip__packet.html#a68c32f352a4f43fd910fb3bba3ddfae0">payload</a></td></tr>
  184. <tr class="separator:a68c32f352a4f43fd910fb3bba3ddfae0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  185. </table>
  186. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  187. <div class="textblock"><p>The <a class="el" href="classip__packet.html" title="The ip_packet class contains the information extracted from a packet received using pcap for packets ...">ip_packet</a> class contains the information extracted from a packet received using pcap for packets that are IP/TCP or IP/UDP. We only save src and dst addresses and ports, and type of Transport protocol. The class hinerates the fields hardware address field because every IP packet is part of a ethernet packet. The remaining packet is stored as payload. </p>
  188. </div><h2 class="groupheader">Member Function Documentation</h2>
  189. <a class="anchor" id="a5396956d60ddb6a1bb1bd2f6f2b4751b"></a>
  190. <div class="memitem">
  191. <div class="memproto">
  192. <table class="memname">
  193. <tr>
  194. <td class="memname">string ip_packet::getIPDAddress </td>
  195. <td>(</td>
  196. <td class="paramname"></td><td>)</td>
  197. <td></td>
  198. </tr>
  199. </table>
  200. </div><div class="memdoc">
  201. <p>Returns the destination IP address. </p>
  202. <dl class="section return"><dt>Returns</dt><dd>the destination IP address </dd></dl>
  203. </div>
  204. </div>
  205. <a class="anchor" id="a1a31307b3e7912ba3a1817041725660e"></a>
  206. <div class="memitem">
  207. <div class="memproto">
  208. <table class="memname">
  209. <tr>
  210. <td class="memname">unsigned short ip_packet::getIPDPort </td>
  211. <td>(</td>
  212. <td class="paramname"></td><td>)</td>
  213. <td></td>
  214. </tr>
  215. </table>
  216. </div><div class="memdoc">
  217. <p>Returns the destination port. </p>
  218. <dl class="section return"><dt>Returns</dt><dd>the destination port</dd></dl>
  219. <p>Devuelve el puerto destino </p><dl class="section return"><dt>Returns</dt><dd>el puerto destino </dd></dl>
  220. </div>
  221. </div>
  222. <a class="anchor" id="a78e1e0e7d107ac449fe224d95bcbd999"></a>
  223. <div class="memitem">
  224. <div class="memproto">
  225. <table class="memname">
  226. <tr>
  227. <td class="memname">char ip_packet::getIPProto </td>
  228. <td>(</td>
  229. <td class="paramname"></td><td>)</td>
  230. <td></td>
  231. </tr>
  232. </table>
  233. </div><div class="memdoc">
  234. <p>Returns the IP protocol type. </p>
  235. <dl class="section return"><dt>Returns</dt><dd>the IP protocol </dd></dl>
  236. </div>
  237. </div>
  238. <a class="anchor" id="ac4baa351e90aa90ee8bedd1239d24183"></a>
  239. <div class="memitem">
  240. <div class="memproto">
  241. <table class="memname">
  242. <tr>
  243. <td class="memname">string ip_packet::getIPSAddress </td>
  244. <td>(</td>
  245. <td class="paramname"></td><td>)</td>
  246. <td></td>
  247. </tr>
  248. </table>
  249. </div><div class="memdoc">
  250. <p>Returns the source IP address. </p>
  251. <dl class="section return"><dt>Returns</dt><dd>the source IP address </dd></dl>
  252. </div>
  253. </div>
  254. <a class="anchor" id="a9697bad155ec10c25151a6c1f5a434b0"></a>
  255. <div class="memitem">
  256. <div class="memproto">
  257. <table class="memname">
  258. <tr>
  259. <td class="memname">unsigned short ip_packet::getIPSPort </td>
  260. <td>(</td>
  261. <td class="paramname"></td><td>)</td>
  262. <td></td>
  263. </tr>
  264. </table>
  265. </div><div class="memdoc">
  266. <p>Returns the source port. </p>
  267. <dl class="section return"><dt>Returns</dt><dd>the source port</dd></dl>
  268. <p>Devuelve el puerto fuente </p><dl class="section return"><dt>Returns</dt><dd>el puerto fuente </dd></dl>
  269. </div>
  270. </div>
  271. <a class="anchor" id="a8b774913ecf9d9cda07dd088818ef481"></a>
  272. <div class="memitem">
  273. <div class="memproto">
  274. <table class="memname">
  275. <tr>
  276. <td class="memname">string ip_packet::getPayload </td>
  277. <td>(</td>
  278. <td class="paramname"></td><td>)</td>
  279. <td></td>
  280. </tr>
  281. </table>
  282. </div><div class="memdoc">
  283. <p>Returns the IP packet payload. </p>
  284. <dl class="section return"><dt>Returns</dt><dd>the IP packet payload </dd></dl>
  285. </div>
  286. </div>
  287. <a class="anchor" id="a6083cc5d06be5bb11c266efbdd961f61"></a>
  288. <div class="memitem">
  289. <div class="memproto">
  290. <table class="memname">
  291. <tr>
  292. <td class="memname">void ip_packet::setIPDAddress </td>
  293. <td>(</td>
  294. <td class="paramtype">string&#160;</td>
  295. <td class="paramname"><em>addr</em></td><td>)</td>
  296. <td></td>
  297. </tr>
  298. </table>
  299. </div><div class="memdoc">
  300. <p>Saves the destination IP address in std string format. </p>
  301. <dl class="params"><dt>Parameters</dt><dd>
  302. <table class="params">
  303. <tr><td class="paramname">addr</td><td>destination IP address </td></tr>
  304. </table>
  305. </dd>
  306. </dl>
  307. </div>
  308. </div>
  309. <a class="anchor" id="a96103b6cecb324c633e5bd74fee281e2"></a>
  310. <div class="memitem">
  311. <div class="memproto">
  312. <table class="memname">
  313. <tr>
  314. <td class="memname">void ip_packet::setIPDPort </td>
  315. <td>(</td>
  316. <td class="paramtype">unsigned short&#160;</td>
  317. <td class="paramname"><em>port</em></td><td>)</td>
  318. <td></td>
  319. </tr>
  320. </table>
  321. </div><div class="memdoc">
  322. <p>Saves the destinaation port. </p>
  323. <dl class="params"><dt>Parameters</dt><dd>
  324. <table class="params">
  325. <tr><td class="paramname">port</td><td>destination port </td></tr>
  326. </table>
  327. </dd>
  328. </dl>
  329. </div>
  330. </div>
  331. <a class="anchor" id="a661b3d3c30388290ce4f479c6a00b38c"></a>
  332. <div class="memitem">
  333. <div class="memproto">
  334. <table class="memname">
  335. <tr>
  336. <td class="memname">void ip_packet::setIPProto </td>
  337. <td>(</td>
  338. <td class="paramtype">char&#160;</td>
  339. <td class="paramname"><em>proto</em></td><td>)</td>
  340. <td></td>
  341. </tr>
  342. </table>
  343. </div><div class="memdoc">
  344. <p>Saves the IP protocol to (TCP|UDP) </p>
  345. <dl class="params"><dt>Parameters</dt><dd>
  346. <table class="params">
  347. <tr><td class="paramname">proto</td><td>protocol number (6 | 17) </td></tr>
  348. </table>
  349. </dd>
  350. </dl>
  351. </div>
  352. </div>
  353. <a class="anchor" id="a5542509eb012fbf4f831dfec39f27307"></a>
  354. <div class="memitem">
  355. <div class="memproto">
  356. <table class="memname">
  357. <tr>
  358. <td class="memname">void ip_packet::setIPSAddress </td>
  359. <td>(</td>
  360. <td class="paramtype">string&#160;</td>
  361. <td class="paramname"><em>addr</em></td><td>)</td>
  362. <td></td>
  363. </tr>
  364. </table>
  365. </div><div class="memdoc">
  366. <p>Saves the source IP address in std string format. </p>
  367. <dl class="params"><dt>Parameters</dt><dd>
  368. <table class="params">
  369. <tr><td class="paramname">addr</td><td>source IP address </td></tr>
  370. </table>
  371. </dd>
  372. </dl>
  373. </div>
  374. </div>
  375. <a class="anchor" id="a33ac2122569abba5eea67bd117e3790e"></a>
  376. <div class="memitem">
  377. <div class="memproto">
  378. <table class="memname">
  379. <tr>
  380. <td class="memname">void ip_packet::setIPSPort </td>
  381. <td>(</td>
  382. <td class="paramtype">unsigned short&#160;</td>
  383. <td class="paramname"><em>port</em></td><td>)</td>
  384. <td></td>
  385. </tr>
  386. </table>
  387. </div><div class="memdoc">
  388. <p>Saves the source port. </p>
  389. <dl class="params"><dt>Parameters</dt><dd>
  390. <table class="params">
  391. <tr><td class="paramname">port</td><td>source port </td></tr>
  392. </table>
  393. </dd>
  394. </dl>
  395. </div>
  396. </div>
  397. <a class="anchor" id="ac46158915c7d7a4a652ede4246fad8df"></a>
  398. <div class="memitem">
  399. <div class="memproto">
  400. <table class="memname">
  401. <tr>
  402. <td class="memname">void ip_packet::setPayload </td>
  403. <td>(</td>
  404. <td class="paramtype">char *&#160;</td>
  405. <td class="paramname"><em>pl</em>, </td>
  406. </tr>
  407. <tr>
  408. <td class="paramkey"></td>
  409. <td></td>
  410. <td class="paramtype">int&#160;</td>
  411. <td class="paramname"><em>len</em>&#160;</td>
  412. </tr>
  413. <tr>
  414. <td></td>
  415. <td>)</td>
  416. <td></td><td></td>
  417. </tr>
  418. </table>
  419. </div><div class="memdoc">
  420. <p>Saves the payload string of bytes into a string. </p>
  421. <dl class="params"><dt>Parameters</dt><dd>
  422. <table class="params">
  423. <tr><td class="paramname">pl</td><td>the packet payload </td></tr>
  424. <tr><td class="paramname">len</td><td>length of the payload </td></tr>
  425. </table>
  426. </dd>
  427. </dl>
  428. </div>
  429. </div>
  430. <h2 class="groupheader">Member Data Documentation</h2>
  431. <a class="anchor" id="a51f1c0f6cc53460164467a7e80d849b5"></a>
  432. <div class="memitem">
  433. <div class="memproto">
  434. <table class="mlabels">
  435. <tr>
  436. <td class="mlabels-left">
  437. <table class="memname">
  438. <tr>
  439. <td class="memname">unsigned short ip_packet::d_port</td>
  440. </tr>
  441. </table>
  442. </td>
  443. <td class="mlabels-right">
  444. <span class="mlabels"><span class="mlabel">private</span></span> </td>
  445. </tr>
  446. </table>
  447. </div><div class="memdoc">
  448. <p>destination port / puerto destino </p>
  449. </div>
  450. </div>
  451. <a class="anchor" id="af3a920730b654dc7d26e155d509234fc"></a>
  452. <div class="memitem">
  453. <div class="memproto">
  454. <table class="mlabels">
  455. <tr>
  456. <td class="mlabels-left">
  457. <table class="memname">
  458. <tr>
  459. <td class="memname">string ip_packet::ip_dst</td>
  460. </tr>
  461. </table>
  462. </td>
  463. <td class="mlabels-right">
  464. <span class="mlabels"><span class="mlabel">private</span></span> </td>
  465. </tr>
  466. </table>
  467. </div><div class="memdoc">
  468. <p>source and dest address / direccion fuente y destino </p>
  469. </div>
  470. </div>
  471. <a class="anchor" id="a6d562e562de60c518542cd250d9986b0"></a>
  472. <div class="memitem">
  473. <div class="memproto">
  474. <table class="mlabels">
  475. <tr>
  476. <td class="mlabels-left">
  477. <table class="memname">
  478. <tr>
  479. <td class="memname">char ip_packet::ip_p</td>
  480. </tr>
  481. </table>
  482. </td>
  483. <td class="mlabels-right">
  484. <span class="mlabels"><span class="mlabel">private</span></span> </td>
  485. </tr>
  486. </table>
  487. </div><div class="memdoc">
  488. <p>type of transport protocol (TCP|UDP) | tipo de protocolo de transporte (TCP|UDP) </p>
  489. </div>
  490. </div>
  491. <a class="anchor" id="a68c32f352a4f43fd910fb3bba3ddfae0"></a>
  492. <div class="memitem">
  493. <div class="memproto">
  494. <table class="mlabels">
  495. <tr>
  496. <td class="mlabels-left">
  497. <table class="memname">
  498. <tr>
  499. <td class="memname">string ip_packet::payload</td>
  500. </tr>
  501. </table>
  502. </td>
  503. <td class="mlabels-right">
  504. <span class="mlabels"><span class="mlabel">private</span></span> </td>
  505. </tr>
  506. </table>
  507. </div><div class="memdoc">
  508. <p>Data payload (content of the packet) / carga del paquete </p>
  509. </div>
  510. </div>
  511. <a class="anchor" id="a12b33dcaa7ab59d15f3ce4b8ca6750fd"></a>
  512. <div class="memitem">
  513. <div class="memproto">
  514. <table class="mlabels">
  515. <tr>
  516. <td class="mlabels-left">
  517. <table class="memname">
  518. <tr>
  519. <td class="memname">unsigned short ip_packet::s_port</td>
  520. </tr>
  521. </table>
  522. </td>
  523. <td class="mlabels-right">
  524. <span class="mlabels"><span class="mlabel">private</span></span> </td>
  525. </tr>
  526. </table>
  527. </div><div class="memdoc">
  528. <p>source port / puerto fuente </p>
  529. </div>
  530. </div>
  531. <hr/>The documentation for this class was generated from the following files:<ul>
  532. <li><a class="el" href="ip__packet_8h_source.html">ip_packet.h</a></li>
  533. <li>ip_packet.cpp</li>
  534. </ul>
  535. </div><!-- contents -->
  536. <!-- start footer part -->
  537. <hr class="footer"/><address class="footer"><small>
  538. Generated on Wed Jun 24 2015 15:25:12 for My Project by &#160;<a href="http://www.doxygen.org/index.html">
  539. <img class="footer" src="doxygen.png" alt="doxygen"/>
  540. </a> 1.8.9.1
  541. </small></address>
  542. </body>
  543. </html>