![]() |
Modules | |
Internet Control Message Protocol (ICMP) Service | |
User Datagram Protocol (UDP) Service | |
Transmission Control Protocol (TCP) Service | |
Files | |
file | tl_interface.h |
Transport layer module interface for the underlying internetwork layer. | |
file | tl_common.c |
Transport layer common functions implementation. | |
file | tl_common.h |
Transport layer common functions. | |
file | tl_messages.h |
Transport layer modules messages. | |
Enumerations | |
enum | tl_messages { NET_TL_RECEIVED = NET_TL_FIRST } |
Transport layer modules messages. More... | |
Functions | |
DEVICE_MAP_IMPLEMENT (packet_dimensions, packet_dimension_t) | |
int | tl_get_address_port (const struct sockaddr *addr, int addrlen, uint16_t *port) |
Gets the address port. | |
int | tl_get_ip_packet_dimension (int ip_phone, packet_dimensions_ref packet_dimensions, device_id_t device_id, packet_dimension_ref *packet_dimension) |
Gets IP packet dimensions. | |
int | tl_update_ip_packet_dimension (packet_dimensions_ref packet_dimensions, device_id_t device_id, size_t content) |
Updates IP device packet dimensions cache. | |
int | tl_set_address_port (struct sockaddr *addr, int addrlen, uint16_t port) |
Sets the address port. | |
int | tl_prepare_icmp_packet (int packet_phone, int icmp_phone, packet_t packet, services_t error) |
Prepares the packet for ICMP error notification. | |
int | tl_socket_read_packet_data (int packet_phone, packet_ref packet, size_t prefix, const packet_dimension_ref dimension, const struct sockaddr *addr, socklen_t addrlen) |
Receives data from the socket into a packet. | |
DEVICE_MAP_DECLARE (packet_dimensions, packet_dimension_t) | |
Device packet dimensions. | |
Transport layer module interface | |
This interface is used by other modules. | |
static int | tl_received_msg (int tl_phone, device_id_t device_id, packet_t packet, services_t target, services_t error) |
Notifies the remote transport layer modules about the received packet/s. |
enum tl_messages |
Transport layer modules messages.
NET_TL_RECEIVED |
Packet received message.
|
DEVICE_MAP_DECLARE | ( | packet_dimensions | , | |
packet_dimension_t | ||||
) |
DEVICE_MAP_IMPLEMENT | ( | packet_dimensions | , | |
packet_dimension_t | ||||
) |
int tl_get_address_port | ( | const struct sockaddr * | addr, | |
int | addrlen, | |||
uint16_t * | port | |||
) |
Gets the address port.
Supports AF_INET and AF_INET6 address families.
[in,out] | addr | The address to be updated. |
[in] | addrlen | The address length. |
[out] | port | The set port. |
Referenced by tcp_connect_core(), and udp_sendto_message().
int tl_get_ip_packet_dimension | ( | int | ip_phone, | |
packet_dimensions_ref | packet_dimensions, | |||
device_id_t | device_id, | |||
packet_dimension_ref * | packet_dimension | |||
) |
Gets IP packet dimensions.
Tries to search a cache and queries the IP module if not found. The reply is cached then.
[in] | ip_phone | The IP moduel phone for (semi)remote calls. |
[in] | packet_dimensions | The packet dimensions cache. |
[in] | device_id | The device identifier. |
[out] | packet_dimension | The IP packet dimensions. |
Referenced by tcp_accept_message(), tcp_create_notification_packet(), tcp_process_client_messages(), tcp_queue_received_packet(), tcp_send_message(), udp_process_client_messages(), and udp_process_packet().
int tl_prepare_icmp_packet | ( | int | packet_phone, | |
int | icmp_phone, | |||
packet_t | packet, | |||
services_t | error | |||
) |
Prepares the packet for ICMP error notification.
Keeps the first packet and releases all the others. Releases all the packets on error.
[in] | packet_phone | The packet server module phone. |
[in] | icmp_phone | The ICMP module phone. |
[in] | packet | The packet to be send. |
[in] | error | The packet error reporting service. Prefixes the received packet. |
Referenced by tcp_process_packet(), and udp_process_packet().
static int tl_received_msg | ( | int | tl_phone, | |
device_id_t | device_id, | |||
packet_t | packet, | |||
services_t | target, | |||
services_t | error | |||
) | [inline, static] |
Notifies the remote transport layer modules about the received packet/s.
[in] | tl_phone | The transport layer module phone used for remote calls. |
[in] | device_id | The device identifier. |
[in] | packet | The received packet or the received packet queue. The packet queue is used to carry a~fragmented datagram. The first packet contains the headers, the others contain only data. |
[in] | target | The target transport layer module service to be delivered to. |
[in] | error | The packet error reporting service. Prefixes the received packet. |
References generic_received_msg(), NET_TL_RECEIVED, and packet_get_id().
Referenced by ip_deliver_local().
int tl_set_address_port | ( | struct sockaddr * | addr, | |
int | addrlen, | |||
uint16_t | port | |||
) |
Sets the address port.
Supports AF_INET and AF_INET6 address families.
[in,out] | addr | The address to be updated. |
[in] | addrlen | The address length. |
[in] | port | The port to be set. |
Referenced by tcp_process_listen(), tcp_process_packet(), and udp_recvfrom_message().
int tl_socket_read_packet_data | ( | int | packet_phone, | |
packet_ref | packet, | |||
size_t | prefix, | |||
const packet_dimension_ref | dimension, | |||
const struct sockaddr * | addr, | |||
socklen_t | addrlen | |||
) |
Receives data from the socket into a packet.
[in] | packet_phone | The packet server module phone. |
[out] | packet | The new created packet. |
[in] | prefix | Reserved packet data prefix length. |
[in] | dimension | The packet dimension. |
[in] | addr | The destination address. |
[in] | addrlen | The address length. |
Referenced by tcp_send_message(), and udp_sendto_message().
int tl_update_ip_packet_dimension | ( | packet_dimensions_ref | packet_dimensions, | |
device_id_t | device_id, | |||
size_t | content | |||
) |