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

  sa | source address
  da | destination address
  sp | source port
  dp | destination port
  oct | octects
  pkt | packets

## 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

  addr | destination address

void Packet::setDstPort | ( | int | port | ) |

Setter for the destination port.

Parameters

  port | destination port

void Packet::setPackets | ( | int | val | ) |

Setter for the packets value.

Parameters

  val | packets

void Packet::setSrcAddr | ( | string | addr | ) |

Setter for the src_addr.

Parameters

  addr | source address

void Packet::setSrcPort | ( | int | port | ) |

Setter for the source port.

Parameters

  port | source 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:

- packet.h
- packet.cpp