Aucune description

packet.h 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. #ifndef PACKET_H
  2. #define PACKET_H
  3. #include <string>
  4. using namespace std ;
  5. /// \~English
  6. /// \brief A class to represent packets.
  7. ///
  8. /// The class contains two constructurs and various functions
  9. /// for searching and filtering network flow packets.
  10. /// \~Spanish
  11. /// \brief Una clase que representa paquetes.
  12. ///
  13. /// La clase contiene dos constructor y varias funciones
  14. /// para buscar y filtrar paquetes de fluidos de red.
  15. class Packet{
  16. public:
  17. /// \fn Packet::Packet()
  18. /// \~English
  19. /// \brief Default constructor. The properties of the packet are set as follows:
  20. /// * src_addr: set to the empty string.
  21. /// * dst_addr: set to the empty string.
  22. /// * src_port: set to 0.
  23. /// * dst_port: set to 0.
  24. /// * octects: set to 0.
  25. /// * packets: set to 0.
  26. /// * enabled: set to false.
  27. /// \~Spanish
  28. /// \brief Constructor por defecto. Las propiedades de el paquete se ajustan como sigue:
  29. /// * src_addr: a una cadena vacia.
  30. /// * dst_addr: a una cadena vacia.
  31. /// * src_port: a 0.
  32. /// * dst_port: a 0.
  33. /// * octects: a 0.
  34. /// * packets: a 0.
  35. /// * enabled: a falso.
  36. Packet();
  37. /// \fn Packet::Packet(string sa, string da, int sp, int dp, int oct, int pkt)
  38. /// \~English
  39. /// \brief Constructor which accepts specification for sa(src_addr),
  40. /// da(dst_addr), sp(src_port), dp(dst_port), oct(octects) and
  41. /// pkt(packets)
  42. /// \param sa source address
  43. /// \param da destination address
  44. /// \param sp source port
  45. /// \param dp destination port
  46. /// \param oct octects
  47. /// \param pkt packets
  48. /// \~Spanish
  49. /// \brief Constructor que acepta especificaciones para sa(src_addr),
  50. /// da(dst_addr), sp(src_port), dp(dst_port), oct(octects) y
  51. /// pkt(packets)
  52. /// \param sa direccion fuente
  53. /// \param da direccion destino
  54. /// \param sp puerto fuente
  55. /// \param dp puerto destino
  56. /// \param oct octetos
  57. /// \param pkt paquetes
  58. Packet(string, string, int, int, int, int) ;
  59. /// \fn string Packet::getSrcAddr()
  60. /// \~English
  61. /// \brief Getter for the source addr
  62. /// \return src address
  63. /// \~Spanish
  64. /// \brief Devuelve la direccion fuente
  65. /// \return direccion fuente
  66. string getSrcAddr() ;
  67. /// \fn string Packet::getDstAddr()
  68. /// \~English
  69. /// \brief Getter for the destination addr
  70. /// \return dst address
  71. /// \~Spanish
  72. /// \brief Devuelve la direccion destino
  73. /// \return direccion destino
  74. string getDstAddr() ;
  75. /// \fn string Packet::getSrcPort()
  76. /// \~English
  77. /// \brief Getter for the source port
  78. /// \return src port
  79. /// \~Spanish
  80. /// \brief Devuelve el puerto fuente
  81. /// \return puerto fuente
  82. int getSrcPort() ;
  83. /// \fn string Packet::getDstPort()
  84. /// \~English
  85. /// \brief Getter for the destination port
  86. /// \return dst port
  87. /// \~Spanish
  88. /// \brief Devuelve la puerto destino
  89. /// \return puerto destino
  90. int getDstPort() ;
  91. /// \fn string Packet::getOctets()
  92. /// \~English
  93. /// \brief Getter for the octets
  94. /// \return octets
  95. /// \~Spanish
  96. /// \brief Devuelve los octetos
  97. /// \return octetos
  98. int getOctects() ;
  99. /// \fn string Packet::getPackets()
  100. /// \~English
  101. /// \brief Getter for the packets
  102. /// \return packets
  103. /// \~Spanish
  104. /// \brief Devuelve los paquetes
  105. /// \return paquetes
  106. int getPackets() ;
  107. /// \fn void Packet::setSrcAddr(string addr){
  108. /// \~English
  109. /// \brief Setter for the src_addr
  110. /// \param addr source address
  111. /// \~Spanish
  112. /// \brief Ajusta la direccion fuente
  113. /// \param addr direccion fuente
  114. void setSrcAddr(string) ;
  115. /// \fn void Packet::setDstAddr(string addr){
  116. /// \~English
  117. /// \brief Setter for the destination addr
  118. /// \param addr destination address
  119. /// \~Spanish
  120. /// \brief Ajusta la direccion destino
  121. /// \param addr direccion destino
  122. void setDstAddr(string) ;
  123. /// \fn void Packet::setSrcPort(int port){
  124. /// \~English
  125. /// \brief Setter for the source port
  126. /// \param port source port
  127. /// \~Spanish
  128. /// \brief Ajusta el puerto fuente
  129. /// \param port puerto fuente
  130. void setSrcPort(int) ;
  131. /// \fn void Packet::setDstPort(int port){
  132. /// \~English
  133. /// \brief Setter for the destination port
  134. /// \param port destination port
  135. /// \~Spanish
  136. /// \brief Ajusta el puerto destino
  137. /// \param port puerto destino
  138. void setDstPort(int) ;
  139. /// \fn void Packet::setOctetes(int val){
  140. /// \~English
  141. /// \brief Setter for the octects value
  142. /// \param val octects
  143. /// \~Spanish
  144. /// \brief Ajusta el valor de los octetos
  145. /// \param val octetos
  146. void setOctects(int) ;
  147. /// \fn void Packet::setPackets(int val){
  148. /// \~English
  149. /// \brief Setter for the packets value
  150. /// \param val packets
  151. /// \~Spanish
  152. /// \brief Ajusta el valor de los paquetes
  153. /// \param val paquetes
  154. void setPackets(int) ;
  155. /// \fn void Packet::enable(){
  156. /// \~English
  157. /// \brief Sets that the packet is enabled to be displayed in GUI
  158. /// \~Spanish
  159. /// \brief Ajusta que el paquete esta disponible para ser desplegado en la inter
  160. /// fase de usuario
  161. void enable() ;
  162. /// \fn void Packet::disable(){
  163. /// \~English
  164. /// \brief Sets that the packet is disabled to be displayed in GUI
  165. /// \~Spanish
  166. /// \brief Ajusta que el paquete no esta disponible para ser desplegado en la inter
  167. /// fase de usuario
  168. void disable() ;
  169. /// \fn void Packet::isEnable(){
  170. /// \~English
  171. /// \brief Returns true if the packet is enabled, false otherwise
  172. /// \return true (enable) or false
  173. /// \~Spanish
  174. /// \brief Devuelve cierto si el paquete esta disponible, falso de lo contrario
  175. bool isEnabled() ;
  176. private:
  177. string src_addr ; /**< src_addr source address (direccion fuente)*/
  178. string dst_addr ; /**< dst_addr destination address (direccion destino)*/
  179. int src_port ; /**< src_port source port (puerto fuente)*/
  180. int dst_port ; /**< dst_port destination port (puerto destino)*/
  181. int octects ; /**< octets/bytes value (octetos)*/
  182. int packets ; /**< packets value (paquetes)*/
  183. bool enabled ;/**< enabled in the GUI (disponible en el GUI)*/
  184. };
  185. #endif // PACKET_H