\hypertarget{classip__packet}{}\section{Referencia de la Clase ip\+\_\+packet} \label{classip__packet}\index{ip\+\_\+packet@{ip\+\_\+packet}} 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. {\ttfamily \#include $<$ip\+\_\+packet.\+h$>$} Diagrama de herencias de ip\+\_\+packet\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2.000000cm]{classip__packet} \end{center} \end{figure} \subsection*{Métodos públicos} \begin{DoxyCompactItemize} \item \hypertarget{classip__packet_a331b530912b6fa3b2bbc9a6f0dbe6d90}{}\hyperlink{classip__packet_a331b530912b6fa3b2bbc9a6f0dbe6d90}{ip\+\_\+packet} ()\label{classip__packet_a331b530912b6fa3b2bbc9a6f0dbe6d90} \begin{DoxyCompactList}\small\item\em Constructor. \end{DoxyCompactList}\item void \hyperlink{classip__packet_a5542509eb012fbf4f831dfec39f27307}{set\+I\+P\+S\+Address} (string) \begin{DoxyCompactList}\small\item\em Guarda la direccion I\+P fuente en formato de cadena de caracteres. \end{DoxyCompactList}\item void \hyperlink{classip__packet_a6083cc5d06be5bb11c266efbdd961f61}{set\+I\+P\+D\+Address} (string) \begin{DoxyCompactList}\small\item\em Guarda la direccion I\+P destino en formato de cadena de caracteres. \end{DoxyCompactList}\item void \hyperlink{classip__packet_a661b3d3c30388290ce4f479c6a00b38c}{set\+I\+P\+Proto} (char) \begin{DoxyCompactList}\small\item\em Guarda el protocolo de I\+P a (T\+C\+P$\vert$\+U\+D\+P) \end{DoxyCompactList}\item void \hyperlink{classip__packet_a33ac2122569abba5eea67bd117e3790e}{set\+I\+P\+S\+Port} (unsigned short) \begin{DoxyCompactList}\small\item\em Guarda el puerto fuente. \end{DoxyCompactList}\item void \hyperlink{classip__packet_a96103b6cecb324c633e5bd74fee281e2}{set\+I\+P\+D\+Port} (unsigned short) \begin{DoxyCompactList}\small\item\em Guarda el puerto destino. \end{DoxyCompactList}\item void \hyperlink{classip__packet_ac46158915c7d7a4a652ede4246fad8df}{set\+Payload} (char $\ast$, int) \begin{DoxyCompactList}\small\item\em Guarda la carga del paquete de una cadena de caracteres a un string. \end{DoxyCompactList}\item string \hyperlink{classip__packet_ac4baa351e90aa90ee8bedd1239d24183}{get\+I\+P\+S\+Address} () \begin{DoxyCompactList}\small\item\em Devuelve la dirección I\+P fuente. \end{DoxyCompactList}\item string \hyperlink{classip__packet_a5396956d60ddb6a1bb1bd2f6f2b4751b}{get\+I\+P\+D\+Address} () \begin{DoxyCompactList}\small\item\em Devuelve la dirección I\+P destino. \end{DoxyCompactList}\item string \hyperlink{classip__packet_a8b774913ecf9d9cda07dd088818ef481}{get\+Payload} () \begin{DoxyCompactList}\small\item\em Devuelve la carga del paquete de I\+P. \end{DoxyCompactList}\item char \hyperlink{classip__packet_a78e1e0e7d107ac449fe224d95bcbd999}{get\+I\+P\+Proto} () \begin{DoxyCompactList}\small\item\em Devuelve el tipo de protocolo I\+P. \end{DoxyCompactList}\item \hypertarget{classip__packet_a9697bad155ec10c25151a6c1f5a434b0}{}unsigned short {\bfseries get\+I\+P\+S\+Port} ()\label{classip__packet_a9697bad155ec10c25151a6c1f5a434b0} \item \hypertarget{classip__packet_a1a31307b3e7912ba3a1817041725660e}{}unsigned short {\bfseries get\+I\+P\+D\+Port} ()\label{classip__packet_a1a31307b3e7912ba3a1817041725660e} \end{DoxyCompactItemize} \subsection*{Atributos privados} \begin{DoxyCompactItemize} \item \hypertarget{classip__packet_a4225b27fe714e0a321e1dd04355e5370}{}string {\bfseries ip\+\_\+src}\label{classip__packet_a4225b27fe714e0a321e1dd04355e5370} \item string \hyperlink{classip__packet_af3a920730b654dc7d26e155d509234fc}{ip\+\_\+dst} \item char \hyperlink{classip__packet_a6d562e562de60c518542cd250d9986b0}{ip\+\_\+p} \item unsigned short \hyperlink{classip__packet_a51f1c0f6cc53460164467a7e80d849b5}{d\+\_\+port} \item unsigned short \hyperlink{classip__packet_a12b33dcaa7ab59d15f3ce4b8ca6750fd}{s\+\_\+port} \item string \hyperlink{classip__packet_a68c32f352a4f43fd910fb3bba3ddfae0}{payload} \end{DoxyCompactItemize} \subsection{Descripción detallada} 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. \subsection{Documentación de las funciones miembro} \hypertarget{classip__packet_a5396956d60ddb6a1bb1bd2f6f2b4751b}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+I\+P\+D\+Address@{get\+I\+P\+D\+Address}} \index{get\+I\+P\+D\+Address@{get\+I\+P\+D\+Address}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{get\+I\+P\+D\+Address}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::get\+I\+P\+D\+Address ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{classip__packet_a5396956d60ddb6a1bb1bd2f6f2b4751b} Devuelve la dirección I\+P destino. \begin{DoxyReturn}{Devuelve} la direccion I\+P destino \end{DoxyReturn} \hypertarget{classip__packet_a78e1e0e7d107ac449fe224d95bcbd999}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+I\+P\+Proto@{get\+I\+P\+Proto}} \index{get\+I\+P\+Proto@{get\+I\+P\+Proto}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{get\+I\+P\+Proto}]{\setlength{\rightskip}{0pt plus 5cm}char ip\+\_\+packet\+::get\+I\+P\+Proto ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{classip__packet_a78e1e0e7d107ac449fe224d95bcbd999} Devuelve el tipo de protocolo I\+P. \begin{DoxyReturn}{Devuelve} el protocolo I\+P \end{DoxyReturn} \hypertarget{classip__packet_ac4baa351e90aa90ee8bedd1239d24183}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+I\+P\+S\+Address@{get\+I\+P\+S\+Address}} \index{get\+I\+P\+S\+Address@{get\+I\+P\+S\+Address}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{get\+I\+P\+S\+Address}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::get\+I\+P\+S\+Address ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{classip__packet_ac4baa351e90aa90ee8bedd1239d24183} Devuelve la dirección I\+P fuente. \begin{DoxyReturn}{Devuelve} la direccion I\+P fuente \end{DoxyReturn} \hypertarget{classip__packet_a8b774913ecf9d9cda07dd088818ef481}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!get\+Payload@{get\+Payload}} \index{get\+Payload@{get\+Payload}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{get\+Payload}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::get\+Payload ( \begin{DoxyParamCaption} {} \end{DoxyParamCaption} )}\label{classip__packet_a8b774913ecf9d9cda07dd088818ef481} Devuelve la carga del paquete de I\+P. \begin{DoxyReturn}{Devuelve} la carga del paquete de I\+P \end{DoxyReturn} \hypertarget{classip__packet_a6083cc5d06be5bb11c266efbdd961f61}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+D\+Address@{set\+I\+P\+D\+Address}} \index{set\+I\+P\+D\+Address@{set\+I\+P\+D\+Address}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{set\+I\+P\+D\+Address}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+D\+Address ( \begin{DoxyParamCaption} \item[{string}]{addr} \end{DoxyParamCaption} )}\label{classip__packet_a6083cc5d06be5bb11c266efbdd961f61} Guarda la direccion I\+P destino en formato de cadena de caracteres. \begin{DoxyParams}{Parámetros} {\em addr} & direccion I\+P destino \\ \hline \end{DoxyParams} \hypertarget{classip__packet_a96103b6cecb324c633e5bd74fee281e2}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+D\+Port@{set\+I\+P\+D\+Port}} \index{set\+I\+P\+D\+Port@{set\+I\+P\+D\+Port}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{set\+I\+P\+D\+Port}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+D\+Port ( \begin{DoxyParamCaption} \item[{unsigned short}]{port} \end{DoxyParamCaption} )}\label{classip__packet_a96103b6cecb324c633e5bd74fee281e2} Guarda el puerto destino. \begin{DoxyParams}{Parámetros} {\em port} & puerto destino \\ \hline \end{DoxyParams} \hypertarget{classip__packet_a661b3d3c30388290ce4f479c6a00b38c}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+Proto@{set\+I\+P\+Proto}} \index{set\+I\+P\+Proto@{set\+I\+P\+Proto}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{set\+I\+P\+Proto}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+Proto ( \begin{DoxyParamCaption} \item[{char}]{proto} \end{DoxyParamCaption} )}\label{classip__packet_a661b3d3c30388290ce4f479c6a00b38c} Guarda el protocolo de I\+P a (T\+C\+P$\vert$\+U\+D\+P) \begin{DoxyParams}{Parámetros} {\em proto} & numero de protocolo (6 $\vert$ 17) \\ \hline \end{DoxyParams} \hypertarget{classip__packet_a5542509eb012fbf4f831dfec39f27307}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+S\+Address@{set\+I\+P\+S\+Address}} \index{set\+I\+P\+S\+Address@{set\+I\+P\+S\+Address}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{set\+I\+P\+S\+Address}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+S\+Address ( \begin{DoxyParamCaption} \item[{string}]{addr} \end{DoxyParamCaption} )}\label{classip__packet_a5542509eb012fbf4f831dfec39f27307} Guarda la direccion I\+P fuente en formato de cadena de caracteres. \begin{DoxyParams}{Parámetros} {\em addr} & direccion I\+P fuente \\ \hline \end{DoxyParams} \hypertarget{classip__packet_a33ac2122569abba5eea67bd117e3790e}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+I\+P\+S\+Port@{set\+I\+P\+S\+Port}} \index{set\+I\+P\+S\+Port@{set\+I\+P\+S\+Port}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{set\+I\+P\+S\+Port}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+I\+P\+S\+Port ( \begin{DoxyParamCaption} \item[{unsigned short}]{port} \end{DoxyParamCaption} )}\label{classip__packet_a33ac2122569abba5eea67bd117e3790e} Guarda el puerto fuente. \begin{DoxyParams}{Parámetros} {\em port} & puerto fuente \\ \hline \end{DoxyParams} \hypertarget{classip__packet_ac46158915c7d7a4a652ede4246fad8df}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!set\+Payload@{set\+Payload}} \index{set\+Payload@{set\+Payload}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{set\+Payload}]{\setlength{\rightskip}{0pt plus 5cm}void ip\+\_\+packet\+::set\+Payload ( \begin{DoxyParamCaption} \item[{char $\ast$}]{pl, } \item[{int}]{len} \end{DoxyParamCaption} )}\label{classip__packet_ac46158915c7d7a4a652ede4246fad8df} Guarda la carga del paquete de una cadena de caracteres a un string. \begin{DoxyParams}{Parámetros} {\em pl} & la carga del paquete \\ \hline {\em len} & el largo del paquete \\ \hline \end{DoxyParams} \subsection{Documentación de los datos miembro} \hypertarget{classip__packet_a51f1c0f6cc53460164467a7e80d849b5}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!d\+\_\+port@{d\+\_\+port}} \index{d\+\_\+port@{d\+\_\+port}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{d\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}unsigned short ip\+\_\+packet\+::d\+\_\+port\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a51f1c0f6cc53460164467a7e80d849b5} destination port / puerto destino \hypertarget{classip__packet_af3a920730b654dc7d26e155d509234fc}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!ip\+\_\+dst@{ip\+\_\+dst}} \index{ip\+\_\+dst@{ip\+\_\+dst}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{ip\+\_\+dst}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::ip\+\_\+dst\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_af3a920730b654dc7d26e155d509234fc} source and dest address / direccion fuente y destino \hypertarget{classip__packet_a6d562e562de60c518542cd250d9986b0}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!ip\+\_\+p@{ip\+\_\+p}} \index{ip\+\_\+p@{ip\+\_\+p}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{ip\+\_\+p}]{\setlength{\rightskip}{0pt plus 5cm}char ip\+\_\+packet\+::ip\+\_\+p\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a6d562e562de60c518542cd250d9986b0} 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}} \index{payload@{payload}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{payload}]{\setlength{\rightskip}{0pt plus 5cm}string ip\+\_\+packet\+::payload\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a68c32f352a4f43fd910fb3bba3ddfae0} Data payload (content of the packet) / carga del paquete \hypertarget{classip__packet_a12b33dcaa7ab59d15f3ce4b8ca6750fd}{}\index{ip\+\_\+packet@{ip\+\_\+packet}!s\+\_\+port@{s\+\_\+port}} \index{s\+\_\+port@{s\+\_\+port}!ip\+\_\+packet@{ip\+\_\+packet}} \subsubsection[{s\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}unsigned short ip\+\_\+packet\+::s\+\_\+port\hspace{0.3cm}{\ttfamily [private]}}\label{classip__packet_a12b33dcaa7ab59d15f3ce4b8ca6750fd} source port / puerto fuente La documentación para esta clase fue generada a partir de los siguientes ficheros\+:\begin{DoxyCompactItemize} \item ip\+\_\+packet.\+h\item ip\+\_\+packet.\+cpp\end{DoxyCompactItemize}