No Description

classip__packet.tex 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. \hypertarget{classip__packet}{}\section{Referencia de la Clase ip\+\_\+packet}
  2. \label{classip__packet}\index{ip\+\_\+packet@{ip\+\_\+packet}}
  3. The \hyperlink{classip__packet}{ip\+\_\+packet} class contains the information extracted from a packet received using pcap for packets that are I\+P/\+T\+C\+P or I\+P/\+U\+D\+P. We only save src and dst addresses and ports, and type of Transport protocol. The class hinerates the fields hardware address field because every I\+P packet is part of a ethernet packet. The remaining packet is stored as payload.
  4. {\ttfamily \#include $<$ip\+\_\+packet.\+h$>$}
  5. Diagrama de herencias de ip\+\_\+packet\begin{figure}[H]
  6. \begin{center}
  7. \leavevmode
  8. \includegraphics[height=2.000000cm]{classip__packet}
  9. \end{center}
  10. \end{figure}
  11. \subsection*{Métodos públicos}
  12. \begin{DoxyCompactItemize}
  13. \item
  14. \hypertarget{classip__packet_a331b530912b6fa3b2bbc9a6f0dbe6d90}{}\hyperlink{classip__packet_a331b530912b6fa3b2bbc9a6f0dbe6d90}{ip\+\_\+packet} ()\label{classip__packet_a331b530912b6fa3b2bbc9a6f0dbe6d90}
  15. \begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item
  16. void \hyperlink{classip__packet_a5542509eb012fbf4f831dfec39f27307}{set\+I\+P\+S\+Address} (string)
  17. \begin{DoxyCompactList}\small\item\em Guarda la direccion I\+P fuente en formato de cadena de caracteres. \end{DoxyCompactList}\item
  18. void \hyperlink{classip__packet_a6083cc5d06be5bb11c266efbdd961f61}{set\+I\+P\+D\+Address} (string)
  19. \begin{DoxyCompactList}\small\item\em Guarda la direccion I\+P destino en formato de cadena de caracteres. \end{DoxyCompactList}\item
  20. void \hyperlink{classip__packet_a661b3d3c30388290ce4f479c6a00b38c}{set\+I\+P\+Proto} (char)
  21. \begin{DoxyCompactList}\small\item\em Guarda el protocolo de I\+P a (T\+C\+P$\vert$\+U\+D\+P) \end{DoxyCompactList}\item
  22. void \hyperlink{classip__packet_a33ac2122569abba5eea67bd117e3790e}{set\+I\+P\+S\+Port} (unsigned short)
  23. \begin{DoxyCompactList}\small\item\em Guarda el puerto fuente. \end{DoxyCompactList}\item
  24. void \hyperlink{classip__packet_a96103b6cecb324c633e5bd74fee281e2}{set\+I\+P\+D\+Port} (unsigned short)
  25. \begin{DoxyCompactList}\small\item\em Guarda el puerto destino. \end{DoxyCompactList}\item
  26. void \hyperlink{classip__packet_ac46158915c7d7a4a652ede4246fad8df}{set\+Payload} (char $\ast$, int)
  27. \begin{DoxyCompactList}\small\item\em Guarda la carga del paquete de una cadena de caracteres a un string. \end{DoxyCompactList}\item
  28. string \hyperlink{classip__packet_ac4baa351e90aa90ee8bedd1239d24183}{get\+I\+P\+S\+Address} ()
  29. \begin{DoxyCompactList}\small\item\em Devuelve la dirección I\+P fuente. \end{DoxyCompactList}\item
  30. string \hyperlink{classip__packet_a5396956d60ddb6a1bb1bd2f6f2b4751b}{get\+I\+P\+D\+Address} ()
  31. \begin{DoxyCompactList}\small\item\em Devuelve la dirección I\+P destino. \end{DoxyCompactList}\item
  32. string \hyperlink{classip__packet_a8b774913ecf9d9cda07dd088818ef481}{get\+Payload} ()
  33. \begin{DoxyCompactList}\small\item\em Devuelve la carga del paquete de I\+P. \end{DoxyCompactList}\item
  34. char \hyperlink{classip__packet_a78e1e0e7d107ac449fe224d95bcbd999}{get\+I\+P\+Proto} ()
  35. \begin{DoxyCompactList}\small\item\em Devuelve el tipo de protocolo I\+P. \end{DoxyCompactList}\item
  36. \hypertarget{classip__packet_a9697bad155ec10c25151a6c1f5a434b0}{}unsigned short {\bfseries get\+I\+P\+S\+Port} ()\label{classip__packet_a9697bad155ec10c25151a6c1f5a434b0}
  37. \item
  38. \hypertarget{classip__packet_a1a31307b3e7912ba3a1817041725660e}{}unsigned short {\bfseries get\+I\+P\+D\+Port} ()\label{classip__packet_a1a31307b3e7912ba3a1817041725660e}
  39. \end{DoxyCompactItemize}
  40. \subsection*{Atributos privados}
  41. \begin{DoxyCompactItemize}
  42. \item
  43. \hypertarget{classip__packet_a4225b27fe714e0a321e1dd04355e5370}{}string {\bfseries ip\+\_\+src}\label{classip__packet_a4225b27fe714e0a321e1dd04355e5370}
  44. \item
  45. string \hyperlink{classip__packet_af3a920730b654dc7d26e155d509234fc}{ip\+\_\+dst}
  46. \item
  47. char \hyperlink{classip__packet_a6d562e562de60c518542cd250d9986b0}{ip\+\_\+p}
  48. \item
  49. unsigned short \hyperlink{classip__packet_a51f1c0f6cc53460164467a7e80d849b5}{d\+\_\+port}
  50. \item
  51. unsigned short \hyperlink{classip__packet_a12b33dcaa7ab59d15f3ce4b8ca6750fd}{s\+\_\+port}
  52. \item
  53. string \hyperlink{classip__packet_a68c32f352a4f43fd910fb3bba3ddfae0}{payload}
  54. \end{DoxyCompactItemize}
  55. \subsection{Descripción detallada}
  56. The \hyperlink{classip__packet}{ip\+\_\+packet} class contains the information extracted from a packet received using pcap for packets that are I\+P/\+T\+C\+P or I\+P/\+U\+D\+P. We only save src and dst addresses and ports, and type of Transport protocol. The class hinerates the fields hardware address field because every I\+P packet is part of a ethernet packet. The remaining packet is stored as payload.
  57. \subsection{Documentación de las funciones miembro}
  58. \hypertarget{classip__packet_a5396956d60ddb6a1bb1bd2f6f2b4751b}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+I\+P\+D\+Address@{get\+I\+P\+D\+Address}}
  59. \index{get\+I\+P\+D\+Address@{get\+I\+P\+D\+Address}!ip\+\_\+packet@{ip\+\_\+packet}}
  60. \subsubsection[{get\+I\+P\+D\+Address}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::get\+I\+P\+D\+Address (
  61. \begin{DoxyParamCaption}
  62. {}
  63. \end{DoxyParamCaption}
  64. )}\label{classip__packet_a5396956d60ddb6a1bb1bd2f6f2b4751b}
  65. Devuelve la dirección I\+P destino.
  66. \begin{DoxyReturn}{Devuelve}
  67. la direccion I\+P destino
  68. \end{DoxyReturn}
  69. \hypertarget{classip__packet_a78e1e0e7d107ac449fe224d95bcbd999}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+I\+P\+Proto@{get\+I\+P\+Proto}}
  70. \index{get\+I\+P\+Proto@{get\+I\+P\+Proto}!ip\+\_\+packet@{ip\+\_\+packet}}
  71. \subsubsection[{get\+I\+P\+Proto}]{\setlength{\rightskip}{0pt plus 5cm}char ip\+\_\+packet\+::get\+I\+P\+Proto (
  72. \begin{DoxyParamCaption}
  73. {}
  74. \end{DoxyParamCaption}
  75. )}\label{classip__packet_a78e1e0e7d107ac449fe224d95bcbd999}
  76. Devuelve el tipo de protocolo I\+P.
  77. \begin{DoxyReturn}{Devuelve}
  78. el protocolo I\+P
  79. \end{DoxyReturn}
  80. \hypertarget{classip__packet_ac4baa351e90aa90ee8bedd1239d24183}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+I\+P\+S\+Address@{get\+I\+P\+S\+Address}}
  81. \index{get\+I\+P\+S\+Address@{get\+I\+P\+S\+Address}!ip\+\_\+packet@{ip\+\_\+packet}}
  82. \subsubsection[{get\+I\+P\+S\+Address}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::get\+I\+P\+S\+Address (
  83. \begin{DoxyParamCaption}
  84. {}
  85. \end{DoxyParamCaption}
  86. )}\label{classip__packet_ac4baa351e90aa90ee8bedd1239d24183}
  87. Devuelve la dirección I\+P fuente.
  88. \begin{DoxyReturn}{Devuelve}
  89. la direccion I\+P fuente
  90. \end{DoxyReturn}
  91. \hypertarget{classip__packet_a8b774913ecf9d9cda07dd088818ef481}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+Payload@{get\+Payload}}
  92. \index{get\+Payload@{get\+Payload}!ip\+\_\+packet@{ip\+\_\+packet}}
  93. \subsubsection[{get\+Payload}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::get\+Payload (
  94. \begin{DoxyParamCaption}
  95. {}
  96. \end{DoxyParamCaption}
  97. )}\label{classip__packet_a8b774913ecf9d9cda07dd088818ef481}
  98. Devuelve la carga del paquete de I\+P.
  99. \begin{DoxyReturn}{Devuelve}
  100. la carga del paquete de I\+P
  101. \end{DoxyReturn}
  102. \hypertarget{classip__packet_a6083cc5d06be5bb11c266efbdd961f61}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+D\+Address@{set\+I\+P\+D\+Address}}
  103. \index{set\+I\+P\+D\+Address@{set\+I\+P\+D\+Address}!ip\+\_\+packet@{ip\+\_\+packet}}
  104. \subsubsection[{set\+I\+P\+D\+Address}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+D\+Address (
  105. \begin{DoxyParamCaption}
  106. \item[{string}]{addr}
  107. \end{DoxyParamCaption}
  108. )}\label{classip__packet_a6083cc5d06be5bb11c266efbdd961f61}
  109. Guarda la direccion I\+P destino en formato de cadena de caracteres.
  110. \begin{DoxyParams}{Parámetros}
  111. {\em addr} & direccion I\+P destino \\
  112. \hline
  113. \end{DoxyParams}
  114. \hypertarget{classip__packet_a96103b6cecb324c633e5bd74fee281e2}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+D\+Port@{set\+I\+P\+D\+Port}}
  115. \index{set\+I\+P\+D\+Port@{set\+I\+P\+D\+Port}!ip\+\_\+packet@{ip\+\_\+packet}}
  116. \subsubsection[{set\+I\+P\+D\+Port}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+D\+Port (
  117. \begin{DoxyParamCaption}
  118. \item[{unsigned short}]{port}
  119. \end{DoxyParamCaption}
  120. )}\label{classip__packet_a96103b6cecb324c633e5bd74fee281e2}
  121. Guarda el puerto destino.
  122. \begin{DoxyParams}{Parámetros}
  123. {\em port} & puerto destino \\
  124. \hline
  125. \end{DoxyParams}
  126. \hypertarget{classip__packet_a661b3d3c30388290ce4f479c6a00b38c}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+Proto@{set\+I\+P\+Proto}}
  127. \index{set\+I\+P\+Proto@{set\+I\+P\+Proto}!ip\+\_\+packet@{ip\+\_\+packet}}
  128. \subsubsection[{set\+I\+P\+Proto}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+Proto (
  129. \begin{DoxyParamCaption}
  130. \item[{char}]{proto}
  131. \end{DoxyParamCaption}
  132. )}\label{classip__packet_a661b3d3c30388290ce4f479c6a00b38c}
  133. Guarda el protocolo de I\+P a (T\+C\+P$\vert$\+U\+D\+P)
  134. \begin{DoxyParams}{Parámetros}
  135. {\em proto} & numero de protocolo (6 $\vert$ 17) \\
  136. \hline
  137. \end{DoxyParams}
  138. \hypertarget{classip__packet_a5542509eb012fbf4f831dfec39f27307}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+S\+Address@{set\+I\+P\+S\+Address}}
  139. \index{set\+I\+P\+S\+Address@{set\+I\+P\+S\+Address}!ip\+\_\+packet@{ip\+\_\+packet}}
  140. \subsubsection[{set\+I\+P\+S\+Address}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+S\+Address (
  141. \begin{DoxyParamCaption}
  142. \item[{string}]{addr}
  143. \end{DoxyParamCaption}
  144. )}\label{classip__packet_a5542509eb012fbf4f831dfec39f27307}
  145. Guarda la direccion I\+P fuente en formato de cadena de caracteres.
  146. \begin{DoxyParams}{Parámetros}
  147. {\em addr} & direccion I\+P fuente \\
  148. \hline
  149. \end{DoxyParams}
  150. \hypertarget{classip__packet_a33ac2122569abba5eea67bd117e3790e}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+S\+Port@{set\+I\+P\+S\+Port}}
  151. \index{set\+I\+P\+S\+Port@{set\+I\+P\+S\+Port}!ip\+\_\+packet@{ip\+\_\+packet}}
  152. \subsubsection[{set\+I\+P\+S\+Port}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+S\+Port (
  153. \begin{DoxyParamCaption}
  154. \item[{unsigned short}]{port}
  155. \end{DoxyParamCaption}
  156. )}\label{classip__packet_a33ac2122569abba5eea67bd117e3790e}
  157. Guarda el puerto fuente.
  158. \begin{DoxyParams}{Parámetros}
  159. {\em port} & puerto fuente \\
  160. \hline
  161. \end{DoxyParams}
  162. \hypertarget{classip__packet_ac46158915c7d7a4a652ede4246fad8df}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+Payload@{set\+Payload}}
  163. \index{set\+Payload@{set\+Payload}!ip\+\_\+packet@{ip\+\_\+packet}}
  164. \subsubsection[{set\+Payload}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+Payload (
  165. \begin{DoxyParamCaption}
  166. \item[{char $\ast$}]{pl, }
  167. \item[{int}]{len}
  168. \end{DoxyParamCaption}
  169. )}\label{classip__packet_ac46158915c7d7a4a652ede4246fad8df}
  170. Guarda la carga del paquete de una cadena de caracteres a un string.
  171. \begin{DoxyParams}{Parámetros}
  172. {\em pl} & la carga del paquete \\
  173. \hline
  174. {\em len} & el largo del paquete \\
  175. \hline
  176. \end{DoxyParams}
  177. \subsection{Documentación de los datos miembro}
  178. \hypertarget{classip__packet_a51f1c0f6cc53460164467a7e80d849b5}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!d\+\_\+port@{d\+\_\+port}}
  179. \index{d\+\_\+port@{d\+\_\+port}!ip\+\_\+packet@{ip\+\_\+packet}}
  180. \subsubsection[{d\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}unsigned short ip\+\_\+packet\+::d\+\_\+port\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a51f1c0f6cc53460164467a7e80d849b5}
  181. destination port / puerto destino \hypertarget{classip__packet_af3a920730b654dc7d26e155d509234fc}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!ip\+\_\+dst@{ip\+\_\+dst}}
  182. \index{ip\+\_\+dst@{ip\+\_\+dst}!ip\+\_\+packet@{ip\+\_\+packet}}
  183. \subsubsection[{ip\+\_\+dst}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::ip\+\_\+dst\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_af3a920730b654dc7d26e155d509234fc}
  184. source and dest address / direccion fuente y destino \hypertarget{classip__packet_a6d562e562de60c518542cd250d9986b0}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!ip\+\_\+p@{ip\+\_\+p}}
  185. \index{ip\+\_\+p@{ip\+\_\+p}!ip\+\_\+packet@{ip\+\_\+packet}}
  186. \subsubsection[{ip\+\_\+p}]{\setlength{\rightskip}{0pt plus 5cm}char ip\+\_\+packet\+::ip\+\_\+p\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a6d562e562de60c518542cd250d9986b0}
  187. type of transport protocol (T\+C\+P$\vert$\+U\+D\+P) $\vert$ tipo de protocolo de transporte (T\+C\+P$\vert$\+U\+D\+P) \hypertarget{classip__packet_a68c32f352a4f43fd910fb3bba3ddfae0}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!payload@{payload}}
  188. \index{payload@{payload}!ip\+\_\+packet@{ip\+\_\+packet}}
  189. \subsubsection[{payload}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::payload\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a68c32f352a4f43fd910fb3bba3ddfae0}
  190. Data payload (content of the packet) / carga del paquete \hypertarget{classip__packet_a12b33dcaa7ab59d15f3ce4b8ca6750fd}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!s\+\_\+port@{s\+\_\+port}}
  191. \index{s\+\_\+port@{s\+\_\+port}!ip\+\_\+packet@{ip\+\_\+packet}}
  192. \subsubsection[{s\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}unsigned short ip\+\_\+packet\+::s\+\_\+port\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a12b33dcaa7ab59d15f3ce4b8ca6750fd}
  193. source port / puerto fuente
  194. La documentación para esta clase fue generada a partir de los siguientes ficheros\+:\begin{DoxyCompactItemize}
  195. \item
  196. ip\+\_\+packet.\+h\item
  197. ip\+\_\+packet.\+cpp\end{DoxyCompactItemize}