Transport layer
[Networking Stack]

Collaboration diagram for Transport layer:

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.

Enumeration Type Documentation

Transport layer modules messages.

Enumerator:
NET_TL_RECEIVED 

Packet received message.

See also:
tl_received_msg()

Function Documentation

DEVICE_MAP_DECLARE ( packet_dimensions  ,
packet_dimension_t   
)

Device packet dimensions.

Maps devices to the packet dimensions.

See also:
device.h
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.

Parameters:
[in,out] addr The address to be updated.
[in] addrlen The address length.
[out] port The set port.
Returns:
EOK on success.
EINVAL if the address length does not match the address family.
EAFNOSUPPORT if the address family is not supported.

Referenced by tcp_connect_core(), and udp_sendto_message().

Here is the caller graph for this function:

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.

Parameters:
[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.
Returns:
EOK on success.
EBADMEM if the packet_dimension parameter is NULL.
ENOMEM if there is not enough memory left.
EINVAL if the packet_dimensions cache is not valid.
Other codes as defined for the ip_packet_size_req() function.

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

Here is the caller graph for this function:

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.

Parameters:
[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.
Returns:
EOK on success.
ENOENT if no packet may be sent.

Referenced by tcp_process_packet(), and udp_process_packet().

Here is the caller graph for this function:

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.

Parameters:
[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.
Returns:
EOK on success.

References generic_received_msg(), NET_TL_RECEIVED, and packet_get_id().

Referenced by ip_deliver_local().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
[in,out] addr The address to be updated.
[in] addrlen The address length.
[in] port The port to be set.
Returns:
EOK on success.
EINVAL if the address length does not match the address family.
EAFNOSUPPORT if the address family is not supported.

Referenced by tcp_process_listen(), tcp_process_packet(), and udp_recvfrom_message().

Here is the caller graph for this function:

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.

Parameters:
[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.
Returns:
Number of bytes received.
EINVAL if the client does not send data.
ENOMEM if there is not enough memory left.
Other error codes as defined for the async_data_read_finalize() function.

Referenced by tcp_send_message(), and udp_sendto_message().

Here is the caller graph for this function:

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.

Parameters:
[in,out] packet_dimensions The packet dimensions cache.
[in] device_id The device identifier.
[in] content The new maximum content size.
Returns:
EOK on success.
ENOENT if the packet dimension is not cached.

Generated on Thu Mar 11 20:47:03 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1