ITS
ReceivePackets Class Reference

#include <ReceivePackets.h>

Inheritance diagram for ReceivePackets:
[legend]
Collaboration diagram for ReceivePackets:
[legend]

Public Types

enum  e_pcapError {
  pcapError_success, pcapError_interfaceNotFound, pcapError_interfaceNotOpen, pcapError_ethernetHeader,
  pcapError_filtreCompile, pcapError_filtreInstall
}
 The e_pcapError enum defines the PCAP errors. More...
 

Public Slots

int receive ()
 receive Slot used to receive packet from the hybrid interface. More...
 

Signals

void packetReceived (QByteArray)
 packetReceived Signal used when a packet is received. More...
 

Public Member Functions

 ReceivePackets (ParameterConfiguration *paramConfig)
 ReceivePackets ReceivePackets constructor. More...
 
 ~ReceivePackets ()
 ~ReceivePackets ReceivePackets destructor. More...
 

Public Attributes

bool m_changeFilter
 
pcap_t * m_handle
 

Private Attributes

ParameterConfigurationm_paramConf
 

Detailed Description

Definition at line 27 of file ReceivePackets.h.

Member Enumeration Documentation

◆ e_pcapError

The e_pcapError enum defines the PCAP errors.

Enumerator
pcapError_success 

Success.

pcapError_interfaceNotFound 

The ITS-G5 interface is not found.

pcapError_interfaceNotOpen 

The ITS-G5 interface can't be opened.

pcapError_ethernetHeader 

The Ethernet header can't be set.

pcapError_filtreCompile 

The PCAP filter can't compile.

pcapError_filtreInstall 

The PCAP filter can't be installed.

Definition at line 36 of file ReceivePackets.h.

Constructor & Destructor Documentation

◆ ReceivePackets()

ReceivePackets::ReceivePackets ( ParameterConfiguration paramConfig)

ReceivePackets ReceivePackets constructor.

Parameters
paramConfigGlobal configuration.

Definition at line 3 of file ReceivePackets.cpp.

References m_paramConf.

◆ ~ReceivePackets()

ReceivePackets::~ReceivePackets ( )

~ReceivePackets ReceivePackets destructor.

Definition at line 8 of file ReceivePackets.cpp.

Member Function Documentation

◆ packetReceived

void ReceivePackets::packetReceived ( QByteArray  )
signal

packetReceived Signal used when a packet is received.

Referenced by receive().

Here is the caller graph for this function:

◆ receive

int ReceivePackets::receive ( )
slot

receive Slot used to receive packet from the hybrid interface.

Returns
The receiving success or failure code.

Definition at line 13 of file ReceivePackets.cpp.

References BUF_SIZ, ParameterConfiguration::interface(), m_changeFilter, m_handle, m_paramConf, ParameterConfiguration::mid(), packetReceived(), pcapError_ethernetHeader, pcapError_filtreCompile, pcapError_filtreInstall, pcapError_interfaceNotFound, pcapError_interfaceNotOpen, and pcapError_success.

Here is the call graph for this function:

Member Data Documentation

◆ m_changeFilter

◆ m_handle

pcap_t* ReceivePackets::m_handle

The PCAP handle.

Definition at line 57 of file ReceivePackets.h.

Referenced by receive().

◆ m_paramConf

ParameterConfiguration* ReceivePackets::m_paramConf
private

Global configuration.

Definition at line 73 of file ReceivePackets.h.

Referenced by receive(), and ReceivePackets().


The documentation for this class was generated from the following files: