ITS
ReceivePackets.h
Go to the documentation of this file.
1 
7 #ifndef RECEIVEPACKETS_H
8 #define RECEIVEPACKETS_H
9 
10 #include <QObject>
11 #include <pcap.h>
12 #include <ParameterConfiguration.h>
13 #include <ParameterNetwork.h>
14 
15 #define SIZE_ETHERNET 14
16 
17 /* Ethernet header */
21 typedef struct sniff_ethernet_s {
22  u_char ether_dhost[ETHER_ADDR_LEN]; /* Destination host address */
23  u_char ether_shost[ETHER_ADDR_LEN]; /* Source host address */
24  u_short ether_type; /* IP? ARP? RARP? etc */
26 
27 class ReceivePackets : public QObject
28 {
29  Q_OBJECT
30 public:
31 
32 
37  {
44  };
45 
55 
57  pcap_t *m_handle;
59 signals:
63  void packetReceived(QByteArray);
64 
65 public slots:
70  int receive();
71 
72 private:
74 };
75 
76 #endif // RECEIVEPACKETS_H
Network configuration.
u_char ether_dhost[ETHER_ADDR_LEN]
struct sniff_ethernet_s sniff_ethernet_t
The sniff_ethernet_t structure is a C style of the Ethernet header.
Global configuration initializer.
e_pcapError
The e_pcapError enum defines the PCAP errors.
~ReceivePackets()
~ReceivePackets ReceivePackets destructor.
u_char ether_shost[ETHER_ADDR_LEN]
The sniff_ethernet_t structure is a C style of the Ethernet header.
ParameterConfiguration * m_paramConf
ReceivePackets(ParameterConfiguration *paramConfig)
ReceivePackets ReceivePackets constructor.
void packetReceived(QByteArray)
packetReceived Signal used when a packet is received.
pcap_t * m_handle
int receive()
receive Slot used to receive packet from the hybrid interface.