tcp_layer Class Reference

Forward declaration of TITAN class. More...

`#include <tcp_layer.hh>`

Inheritance diagram for tcp_layer:

## Public Member Functions

| tcp_layer (const std::string &p_type, const std::string &p_param)
| Set to true if connection shall be done when sending data. Otherwise, connection is established by the. More...
virtual | ~tcp_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...
virtual void | message_incoming (const unsigned char *p_buffer, int p_length, int p_client_id=-1)
| 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...

## Protected Member Functions

void | Add_Fd_Read_Handler (int fd)
void | Add_Fd_Write_Handler (int fd)
void | Remove_Fd_Read_Handler (int fd)
void | Remove_Fd_Write_Handler (int fd)
void | Remove_Fd_All_Handlers (int fd)
void | Handler_Uninstall ()
void | Timer_Set_Handler (double call_interval, boolean is_timeout=TRUE, boolean call_anyway=TRUE, boolean is_periodic=TRUE)
const char * | remote_address_name ()
const char * | remote_port_name ()
const char * | socket_debugging_name ()
const char * | ssl_use_ssl_name ()
void | client_connection_opened (int p_client_id)
bool | add_user_data (int p_client_id)
int | send_message_on_fd (int p_client_id, const unsigned char *message_buffer, int length_of_message)
int | send_message_on_nonblocking_fd (int client_id, const unsigned char *message_buffer, int length_of_message)
int | receive_message_on_fd (int p_client_id)
void | peer_disconnected (int p_client_id)
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)

## Private Member Functions

void | Handle_Fd_Event (int fd, boolean is_readable, boolean is_writable, boolean is_error)
void | Handle_Timeout (double time_since_last_call)

## Private Attributes

Params | _params
int | _client_id
| Layer parameters. More...
std::string | _time_key
| Connection identifier. More...
bool | _reconnect_on_send

## Additional Inherited Members

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 raw socket port protocol layer

This class provides description of ITS TCP port protocol layer

## Constructor & Destructor Documentation

## tcp_layer()

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

Set to true if connection shall be done when sending data. Otherwise, connection is established by the.

See also
  constructor

Specialised constructor Create a new instance of the tcp_layer class

Parameters

  [in] | p_type |

## ~tcp_layer()

tcp_layer::~tcp_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

## Add_Fd_Read_Handler()

void tcp_layer::Add_Fd_Read_Handler | ( | int | fd | ) |

inlineprotected

## Add_Fd_Write_Handler()

void tcp_layer::Add_Fd_Write_Handler | ( | int | fd | ) |

inlineprotected

## add_user_data()

bool tcp_layer::add_user_data | ( | int | p_client_id | ) |

protected

## client_connection_opened()

void tcp_layer::client_connection_opened | ( | int | p_client_id | ) |

protected

## Handle_Fd_Event()

void tcp_layer::Handle_Fd_Event | ( | int | fd,
|  | boolean | is_readable,
|  | boolean | is_writable,
|  | boolean | is_error
| ) |  |

private

## Handle_Timeout()

void tcp_layer::Handle_Timeout | ( | double | time_since_last_call | ) |

private

## Handler_Uninstall()

void tcp_layer::Handler_Uninstall | ( |  | ) |

inlineprotected

## message_incoming()

void tcp_layer::message_incoming | ( | const unsigned char * | message_buffer,
|  | int | length,
|  | int | client_id = `-1`
| ) |  |

virtual

Receive bytes formated data from the lower layers.

Parameters

  [in] | p_buffer | The bytes formated data received
  [in] | p_length | The number of bytes received
  [in] | p_client_id | The connection identifier.Default: -1

## peer_disconnected()

void tcp_layer::peer_disconnected | ( | int | p_client_id | ) |

protected

## receive_data()

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

## receive_message_on_fd()

int tcp_layer::receive_message_on_fd | ( | int | p_client_id | ) |

protected

## remote_address_name()

const char* tcp_layer::remote_address_name | ( |  | ) |

inlineprotected

## remote_port_name()

const char* tcp_layer::remote_port_name | ( |  | ) |

inlineprotected

## Remove_Fd_All_Handlers()

void tcp_layer::Remove_Fd_All_Handlers | ( | int | fd | ) |

inlineprotected

## Remove_Fd_Read_Handler()

void tcp_layer::Remove_Fd_Read_Handler | ( | int | fd | ) |

inlineprotected

## Remove_Fd_Write_Handler()

void tcp_layer::Remove_Fd_Write_Handler | ( | int | fd | ) |

inlineprotected

## send_data()

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

## send_message_on_fd()

int tcp_layer::send_message_on_fd | ( | int | p_client_id,
|  | const unsigned char * | message_buffer,
|  | int | length_of_message
| ) |  |

protected

## send_message_on_nonblocking_fd()

int tcp_layer::send_message_on_nonblocking_fd | ( | int | client_id,
|  | const unsigned char * | message_buffer,
|  | int | length_of_message
| ) |  |

protected

## socket_debugging_name()

const char* tcp_layer::socket_debugging_name | ( |  | ) |

inlineprotected

## ssl_use_ssl_name()

const char* tcp_layer::ssl_use_ssl_name | ( |  | ) |

inlineprotected

## Timer_Set_Handler()

void tcp_layer::Timer_Set_Handler | ( | double | call_interval,
|  | boolean | is_timeout = `TRUE`,
|  | boolean | call_anyway = `TRUE`,
|  | boolean | is_periodic = `TRUE`
| ) |  |

inlineprotected

## Member Data Documentation

## _client_id

int tcp_layer::_client_id

private

Layer parameters.

## _params

Params tcp_layer::_params

private

## _reconnect_on_send

bool tcp_layer::_reconnect_on_send

private

Todo:

## _time_key

std::string tcp_layer::_time_key

private

Connection identifier.

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

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