My Project
Public Member Functions | Private Attributes | List of all members
Packet Class Reference

A class to represent packets. More...

#include <packet.h>

Public Member Functions

 Packet ()
 Default constructor. The properties of the packet are set as follows: More...
 
 Packet (string, string, int, int, int, int)
 Constructor which accepts specification for sa(src_addr), da(dst_addr), sp(src_port), dp(dst_port), oct(octects) and pkt(packets) More...
 
string getSrcAddr ()
 Getter for the source addr. More...
 
string getDstAddr ()
 Getter for the destination addr. More...
 
int getSrcPort ()
 Getter for the source port. More...
 
int getDstPort ()
 Getter for the destination port. More...
 
int getOctects ()
 
int getPackets ()
 Getter for the packets. More...
 
void setSrcAddr (string)
 Setter for the src_addr. More...
 
void setDstAddr (string)
 Setter for the destination addr. More...
 
void setSrcPort (int)
 Setter for the source port. More...
 
void setDstPort (int)
 Setter for the destination port. More...
 
void setOctects (int)
 
void setPackets (int)
 Setter for the packets value. More...
 
void enable ()
 Sets that the packet is enabled to be displayed in GUI.
 
void disable ()
 Sets that the packet is disabled to be displayed in GUI.
 
bool isEnabled ()
 

Private Attributes

string src_addr
 
string dst_addr
 
int src_port
 
int dst_port
 
int octects
 
int packets
 
bool enabled
 

Detailed Description

A class to represent packets.

The class contains two constructurs and various functions for searching and filtering network flow packets.

Constructor & Destructor Documentation

Packet::Packet ( )

Default constructor. The properties of the packet are set as follows:

  • src_addr: set to the empty string.
  • dst_addr: set to the empty string.
  • src_port: set to 0.
  • dst_port: set to 0.
  • octects: set to 0.
  • packets: set to 0.
  • enabled: set to false.
Packet::Packet ( string  sa,
string  da,
int  sp,
int  dp,
int  oct,
int  pkt 
)

Constructor which accepts specification for sa(src_addr), da(dst_addr), sp(src_port), dp(dst_port), oct(octects) and pkt(packets)

Parameters
sasource address
dadestination address
spsource port
dpdestination port
octoctects
pktpackets

Member Function Documentation

string Packet::getDstAddr ( )

Getter for the destination addr.

Returns
dst address
string Packet::getDstPort ( )

Getter for the destination port.

Returns
dst port
string Packet::getPackets ( )

Getter for the packets.

Returns
packets
string Packet::getSrcAddr ( )

Getter for the source addr.

Returns
src address
string Packet::getSrcPort ( )

Getter for the source port.

Returns
src port
void Packet::setDstAddr ( string  addr)

Setter for the destination addr.

Parameters
addrdestination address
void Packet::setDstPort ( int  port)

Setter for the destination port.

Parameters
portdestination port
void Packet::setPackets ( int  val)

Setter for the packets value.

Parameters
valpackets
void Packet::setSrcAddr ( string  addr)

Setter for the src_addr.

Parameters
addrsource address
void Packet::setSrcPort ( int  port)

Setter for the source port.

Parameters
portsource port

Member Data Documentation

string Packet::dst_addr
private

dst_addr destination address (direccion destino)

int Packet::dst_port
private

dst_port destination port (puerto destino)

bool Packet::enabled
private

enabled in the GUI (disponible en el GUI)

int Packet::octects
private

octets/bytes value (octetos)

int Packet::packets
private

packets value (paquetes)

string Packet::src_addr
private

src_addr source address (direccion fuente)

int Packet::src_port
private

src_port source port (puerto fuente)


The documentation for this class was generated from the following files: