The ip_packet class contains the information extracted from a packet received using pcap for packets that are IP/TCP or IP/UDP. We only save src and dst addresses and ports, and type of Transport protocol. The class hinerates the fields hardware address field because every IP packet is part of a ethernet packet. The remaining packet is stored as payload.
More...
#include <ip_packet.h>
The ip_packet class contains the information extracted from a packet received using pcap for packets that are IP/TCP or IP/UDP. We only save src and dst addresses and ports, and type of Transport protocol. The class hinerates the fields hardware address field because every IP packet is part of a ethernet packet. The remaining packet is stored as payload.
string ip_packet::getIPDAddress |
( |
| ) |
|
Returns the destination IP address.
- Returns
- the destination IP address
unsigned short ip_packet::getIPDPort |
( |
| ) |
|
Returns the destination port.
- Returns
- the destination port
Devuelve el puerto destino
- Returns
- el puerto destino
char ip_packet::getIPProto |
( |
| ) |
|
Returns the IP protocol type.
- Returns
- the IP protocol
string ip_packet::getIPSAddress |
( |
| ) |
|
Returns the source IP address.
- Returns
- the source IP address
unsigned short ip_packet::getIPSPort |
( |
| ) |
|
Returns the source port.
- Returns
- the source port
Devuelve el puerto fuente
- Returns
- el puerto fuente
string ip_packet::getPayload |
( |
| ) |
|
Returns the IP packet payload.
- Returns
- the IP packet payload
void ip_packet::setIPDAddress |
( |
string |
addr | ) |
|
Saves the destination IP address in std string format.
- Parameters
-
addr | destination IP address |
void ip_packet::setIPDPort |
( |
unsigned short |
port | ) |
|
Saves the destinaation port.
- Parameters
-
void ip_packet::setIPProto |
( |
char |
proto | ) |
|
Saves the IP protocol to (TCP|UDP)
- Parameters
-
proto | protocol number (6 | 17) |
void ip_packet::setIPSAddress |
( |
string |
addr | ) |
|
Saves the source IP address in std string format.
- Parameters
-
void ip_packet::setIPSPort |
( |
unsigned short |
port | ) |
|
Saves the source port.
- Parameters
-
void ip_packet::setPayload |
( |
char * |
pl, |
|
|
int |
len |
|
) |
| |
Saves the payload string of bytes into a string.
- Parameters
-
pl | the packet payload |
len | length of the payload |
unsigned short ip_packet::d_port |
|
private |
destination port / puerto destino
source and dest address / direccion fuente y destino
type of transport protocol (TCP|UDP) | tipo de protocolo de transporte (TCP|UDP)
string ip_packet::payload |
|
private |
Data payload (content of the packet) / carga del paquete
unsigned short ip_packet::s_port |
|
private |
source port / puerto fuente
The documentation for this class was generated from the following files: