Нет описания

ip__packet_8h_source.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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.h Source File</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><a href="annotated.html"><span>Classes</span></a></li>
  42. <li class="current"><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="files.html"><span>File&#160;List</span></a></li>
  64. </ul>
  65. </div>
  66. </div><!-- top -->
  67. <!-- window showing the filter options -->
  68. <div id="MSearchSelectWindow"
  69. onmouseover="return searchBox.OnSearchSelectShow()"
  70. onmouseout="return searchBox.OnSearchSelectHide()"
  71. onkeydown="return searchBox.OnSearchSelectKey(event)">
  72. </div>
  73. <!-- iframe showing the search results (closed by default) -->
  74. <div id="MSearchResultsWindow">
  75. <iframe src="javascript:void(0)" frameborder="0"
  76. name="MSearchResults" id="MSearchResults">
  77. </iframe>
  78. </div>
  79. <div class="header">
  80. <div class="headertitle">
  81. <div class="title">ip_packet.h</div> </div>
  82. </div><!--header-->
  83. <div class="contents">
  84. <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="preprocessor">#ifndef IP_PACKET_H</span></div>
  85. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="preprocessor">#define IP_PACKET_H</span></div>
  86. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;</div>
  87. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="preprocessor">#include &quot;ethernet_packet.h&quot;</span></div>
  88. <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="preprocessor">#include &lt;netinet/in.h&gt;</span></div>
  89. <div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
  90. <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="preprocessor">#include &lt;arpa/inet.h&gt;</span></div>
  91. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div>
  92. <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a> ;</div>
  93. <div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="classip__packet.html"> 18</a></span>&#160;<span class="keyword">class </span><a class="code" href="classip__packet.html">ip_packet</a> : <span class="keyword">public</span> <a class="code" href="classethernet__packet.html">ethernet_packet</a></div>
  94. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;{</div>
  95. <div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="classip__packet.html#af3a920730b654dc7d26e155d509234fc"> 20</a></span>&#160; <span class="keywordtype">string</span> ip_src,<a class="code" href="classip__packet.html#af3a920730b654dc7d26e155d509234fc">ip_dst</a>; </div>
  96. <div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classip__packet.html#a6d562e562de60c518542cd250d9986b0"> 21</a></span>&#160; <span class="keywordtype">char</span> <a class="code" href="classip__packet.html#a6d562e562de60c518542cd250d9986b0">ip_p</a> ; </div>
  97. <div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="classip__packet.html#a51f1c0f6cc53460164467a7e80d849b5"> 22</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="classip__packet.html#a51f1c0f6cc53460164467a7e80d849b5">d_port</a> ; </div>
  98. <div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classip__packet.html#a12b33dcaa7ab59d15f3ce4b8ca6750fd"> 23</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> <a class="code" href="classip__packet.html#a12b33dcaa7ab59d15f3ce4b8ca6750fd">s_port</a> ; </div>
  99. <div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classip__packet.html#a68c32f352a4f43fd910fb3bba3ddfae0"> 24</a></span>&#160; <span class="keywordtype">string</span> <a class="code" href="classip__packet.html#a68c32f352a4f43fd910fb3bba3ddfae0">payload</a> ; </div>
  100. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="keyword">public</span>:</div>
  101. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div>
  102. <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; <a class="code" href="classip__packet.html">ip_packet</a>();</div>
  103. <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div>
  104. <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordtype">void</span> setIPSAddress(<span class="keywordtype">string</span>) ;</div>
  105. <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;</div>
  106. <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordtype">void</span> setIPDAddress(<span class="keywordtype">string</span>) ;</div>
  107. <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div>
  108. <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keywordtype">void</span> setIPProto(<span class="keywordtype">char</span>) ;</div>
  109. <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div>
  110. <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordtype">void</span> setIPSPort(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>) ;</div>
  111. <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div>
  112. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <span class="keywordtype">void</span> setIPDPort(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>) ;</div>
  113. <div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div>
  114. <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="keywordtype">void</span> setPayload(<span class="keywordtype">char</span> *, <span class="keywordtype">int</span>) ;</div>
  115. <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div>
  116. <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordtype">string</span> getIPSAddress() ;</div>
  117. <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;</div>
  118. <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordtype">string</span> getIPDAddress() ;</div>
  119. <div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;</div>
  120. <div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; <span class="keywordtype">string</span> getPayload() ;</div>
  121. <div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div>
  122. <div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keywordtype">char</span> getIPProto() ;</div>
  123. <div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;</div>
  124. <div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getIPSPort() ;</div>
  125. <div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div>
  126. <div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getIPDPort() ;</div>
  127. <div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160;};</div>
  128. <div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div>
  129. <div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160;<span class="preprocessor">#endif // IP_PACKET_H</span></div>
  130. <div class="ttc" id="classethernet__packet_html"><div class="ttname"><a href="classethernet__packet.html">ethernet_packet</a></div><div class="ttdoc">The ethernet_packet class contains function to change the ethernet information in bytes from the ethe...</div><div class="ttdef"><b>Definition:</b> ethernet_packet.h:14</div></div>
  131. <div class="ttc" id="classip__packet_html_af3a920730b654dc7d26e155d509234fc"><div class="ttname"><a href="classip__packet.html#af3a920730b654dc7d26e155d509234fc">ip_packet::ip_dst</a></div><div class="ttdeci">string ip_dst</div><div class="ttdef"><b>Definition:</b> ip_packet.h:20</div></div>
  132. <div class="ttc" id="classip__packet_html"><div class="ttname"><a href="classip__packet.html">ip_packet</a></div><div class="ttdoc">The ip_packet class contains the information extracted from a packet received using pcap for packets ...</div><div class="ttdef"><b>Definition:</b> ip_packet.h:18</div></div>
  133. <div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div></div>
  134. <div class="ttc" id="classip__packet_html_a12b33dcaa7ab59d15f3ce4b8ca6750fd"><div class="ttname"><a href="classip__packet.html#a12b33dcaa7ab59d15f3ce4b8ca6750fd">ip_packet::s_port</a></div><div class="ttdeci">unsigned short s_port</div><div class="ttdef"><b>Definition:</b> ip_packet.h:23</div></div>
  135. <div class="ttc" id="classip__packet_html_a6d562e562de60c518542cd250d9986b0"><div class="ttname"><a href="classip__packet.html#a6d562e562de60c518542cd250d9986b0">ip_packet::ip_p</a></div><div class="ttdeci">char ip_p</div><div class="ttdef"><b>Definition:</b> ip_packet.h:21</div></div>
  136. <div class="ttc" id="classip__packet_html_a68c32f352a4f43fd910fb3bba3ddfae0"><div class="ttname"><a href="classip__packet.html#a68c32f352a4f43fd910fb3bba3ddfae0">ip_packet::payload</a></div><div class="ttdeci">string payload</div><div class="ttdef"><b>Definition:</b> ip_packet.h:24</div></div>
  137. <div class="ttc" id="classip__packet_html_a51f1c0f6cc53460164467a7e80d849b5"><div class="ttname"><a href="classip__packet.html#a51f1c0f6cc53460164467a7e80d849b5">ip_packet::d_port</a></div><div class="ttdeci">unsigned short d_port</div><div class="ttdef"><b>Definition:</b> ip_packet.h:22</div></div>
  138. </div><!-- fragment --></div><!-- contents -->
  139. <!-- start footer part -->
  140. <hr class="footer"/><address class="footer"><small>
  141. Generated on Wed Jun 24 2015 15:25:12 for My Project by &#160;<a href="http://www.doxygen.org/index.html">
  142. <img class="footer" src="doxygen.png" alt="doxygen"/>
  143. </a> 1.8.9.1
  144. </small></address>
  145. </body>
  146. </html>