ip_packet.h
#ifndef IP_PACKET_H
#define IP_PACKET_H
#include "ethernet_packet.h"
#include <netinet/in.h>
#include <string>
#include <arpa/inet.h>
using namespace std ;
class ip_packet : public ethernet_packet
{
string ip_src,ip_dst;
char ip_p ;
unsigned short d_port ;
unsigned short s_port ;
string payload ;
public:
ip_packet();
void setIPSAddress(string) ;
void setIPDAddress(string) ;
void setIPProto(char) ;
void setIPSPort(unsigned short) ;
void setIPDPort(unsigned short) ;
void setPayload(char *, int) ;
string getIPSAddress() ;
string getIPDAddress() ;
string getPayload() ;
char getIPProto() ;
unsigned short getIPSPort() ;
unsigned short getIPDPort() ;
};
#endif // IP_PACKET_H
ethernet_packet
The ethernet_packet class contains function to change the ethernet information in bytes from the ethe...
Definition: ethernet_packet.h:14
ip_packet::ip_dst
string ip_dst
Definition: ip_packet.h:20
ip_packet
The ip_packet class contains the information extracted from a packet received using pcap for packets ...
Definition: ip_packet.h:18
std
ip_packet::s_port
unsigned short s_port
Definition: ip_packet.h:23
ip_packet::ip_p
char ip_p
Definition: ip_packet.h:21
ip_packet::payload
string payload
Definition: ip_packet.h:24
ip_packet::d_port
unsigned short d_port
Definition: ip_packet.h:22