ETSI STF525 / Internal Testing test suite
This project provides an internal testing test suite and its associated Test Adapter/Codec
Public Member Functions | Private Attributes | List of all members
raw_socket_layer Class Reference

#include <raw_socket_layer.hh>

Inheritance diagram for raw_socket_layer:
layer

Public Member Functions

 raw_socket_layer (const std::string &p_type, const std::string &param)
 Ethernet type. More...
 
virtual ~raw_socket_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...
 

Private Attributes

Params _params
 
int _socket
 Layer parameters. More...
 
std::string _time_key
 Socket identifier. More...
 
struct ifreq _if_interface
 
struct ifreq _if_mac_addr
 NIC interface description. More...
 
std::vector< unsigned char > _mac_src
 NIC interface description. More...
 
std::vector< unsigned char > _mac_bc
 MAC address. More...
 
std::vector< unsigned char > _eth_type
 MAC broadcast address. More...
 

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...
 

Constructor & Destructor Documentation

◆ raw_socket_layer()

raw_socket_layer::raw_socket_layer ( const std::string &  p_type,
const std::string &  param 
)

Ethernet type.

Specialised constructor Create a new instance of the raw_socket_layer class

Parameters
[in]p_type

◆ ~raw_socket_layer()

raw_socket_layer::~raw_socket_layer ( )
virtual

Default destructor.

Remarks
If
See also
_reconnect_on_send is set to false, the disconnection is done by the destructor

Member Function Documentation

◆ Handle_Fd_Event_Readable()

void raw_socket_layer::Handle_Fd_Event_Readable ( int  fd)

◆ receive_data()

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

Receive bytes formated data from the lower layers.

Parameters
[in]p_dataThe bytes formated data received
[in]p_paramsSome lower layers parameters values when data was received

Reimplemented from layer.

◆ send_data()

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

Send bytes formated data to the lower layers.

Parameters
[in]p_dataThe data to be sent
[in]p_paramsSome parameters to overwrite default value of the lower layers parameters

Reimplemented from layer.

Member Data Documentation

◆ _eth_type

std::vector<unsigned char> raw_socket_layer::_eth_type
private

MAC broadcast address.

◆ _if_interface

struct ifreq raw_socket_layer::_if_interface
private

◆ _if_mac_addr

struct ifreq raw_socket_layer::_if_mac_addr
private

NIC interface description.

◆ _mac_bc

std::vector<unsigned char> raw_socket_layer::_mac_bc
private

MAC address.

◆ _mac_src

std::vector<unsigned char> raw_socket_layer::_mac_src
private

NIC interface description.

◆ _params

Params raw_socket_layer::_params
private

◆ _socket

int raw_socket_layer::_socket
private

Layer parameters.

◆ _time_key

std::string raw_socket_layer::_time_key
private

Socket identifier.


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