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

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

This class provides description of ITS UDP/IP protocol layer. More...

`#include <udp_layer.hh>`

Inheritance diagram for udp_layer:

## Public Member Functions
| udp_layer (const std::string &p_type, const std::string &p_param)
| Specialised constructor Create a new instance of the udp_layer class. More...
virtual | ~udp_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...
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 Member Functions
unsigned short | inet_check_sum (const void *p_buffer, size_t p_header_length, const unsigned short p_initial_sum=0)
| Destination socket address description. More...

## Private Attributes
Params | _params
struct iphdr * | _iphdr
| Layer parameters. More...
struct udphdr * | _udphdr
| IP layer description. More...
struct sockaddr_in | _saddr
| UDP layer description. More...
struct sockaddr_in | _daddr
| Source socket address description. 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...

## Detailed Description

This class provides description of ITS UDP/IP protocol layer.

## Constructor & Destructor Documentation

## ◆ udp_layer()

udp_layer::udp_layer | ( | const std::string & | p_type,
|  | const std::string & | p_param
| ) |  |

Specialised constructor Create a new instance of the udp_layer class.

Parameters

  [in] | p_type |

## ◆ ~udp_layer()

virtual udp_layer::~udp_layer | ( |  | ) |
| inline virtual

Default destructor.

## Member Function Documentation

## ◆ inet_check_sum()

unsigned short udp_layer::inet_check_sum | ( | const void * | buf,
|  | size_t | hdr_len,
|  | const unsigned short | p_initial_sum = `0`
| ) |  |
| private

Destination socket address description.

Compute the UDP checksum

Parameters

  [in] | p_buffer | The data to be sent
  [in] | p_header_length | The UDP header length
  [in] | p_initial_sum | The initial checksum value. Default: 0

Returns
  The checksum value

## ◆ receive_data()

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

## ◆ send_data()

void udp_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

## ◆ _daddr

struct sockaddr_in udp_layer::_daddr
| private

Source socket address description.

## ◆ _iphdr

struct iphdr* udp_layer::_iphdr
| private

Layer parameters.

## ◆ _params

Params udp_layer::_params
| private

## ◆ _saddr

struct sockaddr_in udp_layer::_saddr
| private

UDP layer description.

## ◆ _udphdr

struct udphdr* udp_layer::_udphdr
| private

IP layer description.

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

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