ETSI STF525 / Internal Testing test suite This project provides an internal testing test suite and its associated Test Adapter/Codec

Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
pcap_layer Class Reference

Forward declaration of TITAN class. More...

`#include <pcap_layer.hh>`

Inheritance diagram for pcap_layer:

## Public Member Functions
| pcap_layer (const std::string &p_type, const std::string &param)
| Specialised constructor Create a new instance of the pcap_layer class. More...
virtual | ~pcap_layer ()
| Default destructor. More...
virtual void | send_data (OCTETSTRING &data, Params &params)
| Send bytes formated data to the lower layers. More...
virtual void | receive_data (OCTETSTRING &data, Params &info)
| Receive bytes formated data from the lower layers. More...
void | Handle_Fd_Event_Readable (int fd)
Public Member Functions inherited from layer
| layer ()
| Type description, it indicates the protocol type (e.g. CAM, DENM, GN, ETH, PCAP...) More...
| layer (const std::string &p_type)
| Specialized constructor Create a new instance of the layer class with its type description. More...
virtual | ~layer ()
| Default destructor. More...
void | delete_layer ()
| Delete this layer. More...
void | add_upper_layer (layer *p_layer)
| Add a new layer in the list of the upper layer. More...
void | remove_upper_layer (layer *p_layer)
| Remove the specified upper layer protocol from the list of the upper layer. More...
const std::string & | to_string () const
| Remove the specified upper layer protocol from the list of the upper layer. More...

## Static Private Member Functions
static void * | run (void *p_this)

## Private Attributes
Params | _params
pcap_t * | _device
| Layer parameters. More...
int | _pcap_h
| Device handle. More...
std::thread * | _thread
| PCAP instance handle. More...
bool | _running
| Thread handle, used to read PCAP file instead of NIC, used in file mode. More...
std::mutex | _resume
| Set to true when the thread is running, used in file mode. More...
pcap_dumper_t * | _sent_file
std::string | _time_key
| Write file handle to save sent packet, used in file mode. More...
int | _fd [2]

## Additional Inherited Members
Protected Member Functions inherited from layer
void | to_all_layers (std::vector< layer *> &layers, OCTETSTRING &data, Params &params)
void | receive_to_all_layers (OCTETSTRING &data, Params &params)
void | send_to_all_layers (OCTETSTRING &data, Params &params)
Protected Attributes inherited from layer
std::string | type
| List of the lower protocol layers. More...

## Detailed Description

Forward declaration of TITAN class.

This class provides description of ITS PCAP port protocol layer

## Constructor & Destructor Documentation

## ◆ pcap_layer()

pcap_layer::pcap_layer | ( | const std::string & | p_type,
|  | const std::string & | param
| ) |  |

Specialised constructor Create a new instance of the pcap_layer class.

Parameters

  [in] | p_type |

## ◆ ~pcap_layer()

pcap_layer::~pcap_layer | ( |  | ) |
| virtual

Default destructor.

## Member Function Documentation

## ◆ Handle_Fd_Event_Readable()

void pcap_layer::Handle_Fd_Event_Readable | ( | int | fd | ) |

## ◆ receive_data()

void pcap_layer::receive_data | ( | OCTETSTRING & | data,
|  | Params & | params
| ) |  |
| virtual

Receive bytes formated data from the lower layers.

Parameters

  [in] | p_data | The bytes formated data received
  [in] | p_params | Some lower layers parameters values when data was received

Reimplemented from layer.

## ◆ run()

void * pcap_layer::run | ( | void * | p_this | ) |
| static private

Todo:

## ◆ send_data()

void pcap_layer::send_data | ( | OCTETSTRING & | data,
|  | Params & | params
| ) |  |
| virtual

Send bytes formated data to the lower layers.

Parameters

  [in] | p_data | The data to be sent
  [in] | p_params | Some parameters to overwrite default value of the lower layers parameters

Reimplemented from layer.

## Member Data Documentation

## ◆ _device

pcap_t* pcap_layer::_device
| private

Layer parameters.

## ◆ _fd

int pcap_layer::_fd[2]
| private

Todo:

## ◆ _params

Params pcap_layer::_params
| private

## ◆ _pcap_h

int pcap_layer::_pcap_h
| private

Device handle.

## ◆ _resume

std::mutex pcap_layer::_resume
| private

Set to true when the thread is running, used in file mode.

## ◆ _running

bool pcap_layer::_running
| private

Thread handle, used to read PCAP file instead of NIC, used in file mode.

## ◆ _sent_file

pcap_dumper_t* pcap_layer::_sent_file
| private

Todo:

## ◆ _thread

std::thread* pcap_layer::_thread
| private

PCAP instance handle.

## ◆ _time_key

std::string pcap_layer::_time_key
| private

Write file handle to save sent packet, used in file mode.

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

- /home/vagrant/TriesAndDelete/etsi_its/framework/include/pcap_layer.hh
- /home/vagrant/TriesAndDelete/etsi_its/framework/src/pcap_layer.cc