My Project
ip_packet.h
1 #ifndef IP_PACKET_H
2 #define IP_PACKET_H
3 
4 #include "ethernet_packet.h"
5 #include <netinet/in.h>
6 #include <string>
7 #include <arpa/inet.h>
8 
9 using namespace std ;
18 class ip_packet : public ethernet_packet
19 {
20  string ip_src,ip_dst;
21  char ip_p ;
22  unsigned short d_port ;
23  unsigned short s_port ;
24  string payload ;
26 public:
27 
33  ip_packet();
34 
42  void setIPSAddress(string) ;
43 
51  void setIPDAddress(string) ;
52 
60  void setIPProto(char) ;
61 
69  void setIPSPort(unsigned short) ;
70 
78  void setIPDPort(unsigned short) ;
79 
89  void setPayload(char *, int) ;
90 
98  string getIPSAddress() ;
99 
107  string getIPDAddress() ;
108 
116  string getPayload() ;
117 
125  char getIPProto() ;
126 
134  unsigned short getIPSPort() ;
135 
143  unsigned short getIPDPort() ;
144 };
145 
146 #endif // IP_PACKET_H
The ethernet_packet class contains function to change the ethernet information in bytes from the ethe...
Definition: ethernet_packet.h:14
string ip_dst
Definition: ip_packet.h:20
The ip_packet class contains the information extracted from a packet received using pcap for packets ...
Definition: ip_packet.h:18
unsigned short s_port
Definition: ip_packet.h:23
char ip_p
Definition: ip_packet.h:21
string payload
Definition: ip_packet.h:24
unsigned short d_port
Definition: ip_packet.h:22