tcp.c File Reference

TCP module implementation. More...

#include <assert.h>
#include <async.h>
#include <fibril_synch.h>
#include <malloc.h>
#include <stdio.h>
#include <errno.h>
#include <ipc/services.h>
#include <ipc/net.h>
#include <ipc/tl.h>
#include <ipc/socket.h>
#include <net/socket_codes.h>
#include <net/ip_protocols.h>
#include <net/in.h>
#include <net/in6.h>
#include <net/inet.h>
#include <net/modules.h>
#include <adt/dynamic_fifo.h>
#include <packet_client.h>
#include <packet_remote.h>
#include <net_checksum.h>
#include <ip_client.h>
#include <ip_interface.h>
#include <icmp_client.h>
#include <icmp_remote.h>
#include <net_interface.h>
#include <socket_core.h>
#include <tl_common.h>
#include <tl_remote.h>
#include <tl_skel.h>
#include "tcp.h"
#include "tcp_header.h"

Go to the source code of this file.

Data Structures

struct  tcp_timeout
 TCP reply timeout data. More...

Defines

#define IS_IN_INTERVAL_OVERFLOW(lower, value, higher_equal)
 Returns a value indicating whether the value is in the interval respecting the possible overflow.
#define MAX_TCP_FRAGMENT_SIZE   65535
 Maximum TCP fragment size.
#define NAME   "tcp"
 TCP module name.
#define NET_DEFAULT_TCP_INITIAL_TIMEOUT   3000000L
 Initial timeout for new connections.
#define NET_DEFAULT_TCP_TIME_WAIT_TIMEOUT   2000L
 Default timeout for closing.
#define NET_DEFAULT_TCP_WINDOW   10240
 The TCP window default value.
#define TCP_FAST_RETRANSMIT_COUNT   3
 The number of acknowledgements before retransmit.
#define TCP_FREE_PORTS_END   65535
 Free ports pool end.
#define TCP_FREE_PORTS_START   1025
 Free ports pool start.
#define TCP_INITIAL_SEQUENCE_NUMBER   2999
 The initial outgoing sequence number.
#define TCP_MAX_TIMEOUTS   8
 The maximum number of timeouts in a row before singaling connection lost.
#define TCP_SYN_SENT_TIMEOUT   1000000L
 Timeout for connection initialization, SYN sent.

Typedefs

typedef tcp_timeout tcp_timeout_t
 Type definition of the TCP timeout.

Functions

int main (int argc, char *argv[])
 Main entry point.
static int tcp_accept_message (socket_cores_t *, int, int, size_t *, size_t *)
static int tcp_close_message (socket_cores_t *, int)
static int tcp_connect_core (socket_core_t *, socket_cores_t *, struct sockaddr *, socklen_t)
static int tcp_connect_message (socket_cores_t *, int, struct sockaddr *, socklen_t)
static int tcp_create_notification_packet (packet_t **, socket_core_t *, tcp_socket_data_t *, int, int)
static void tcp_free_socket_data (socket_core_t *)
static packet_ttcp_get_packets_to_send (socket_core_t *, tcp_socket_data_t *)
static void tcp_initialize_socket_data (tcp_socket_data_t *)
static int tcp_listen_message (socket_cores_t *, int, int)
static packet_ttcp_prepare_copy (socket_core_t *, tcp_socket_data_t *, packet_t *, size_t, size_t)
static void tcp_prepare_operation_header (socket_core_t *, tcp_socket_data_t *, tcp_header_t *, int synchronize, int)
int tcp_prepare_timeout (int(*timeout_function)(void *tcp_timeout_t), socket_core_t *socket, tcp_socket_data_t *socket_data, size_t sequence_number, tcp_socket_state_t state, suseconds_t timeout, int globals_read_only)
static void tcp_process_acknowledgement (socket_core_t *, tcp_socket_data_t *, tcp_header_t *)
static int tcp_process_client_messages (ipc_callid_t, ipc_call_t)
static int tcp_process_established (socket_core_t *, tcp_socket_data_t *, tcp_header_t *, packet_t *, int, size_t)
static int tcp_process_listen (socket_core_t *, tcp_socket_data_t *, tcp_header_t *, packet_t *, struct sockaddr *, struct sockaddr *, size_t)
static int tcp_process_packet (device_id_t, packet_t *, services_t)
static int tcp_process_syn_received (socket_core_t *, tcp_socket_data_t *, tcp_header_t *, packet_t *)
static int tcp_process_syn_sent (socket_core_t *, tcp_socket_data_t *, tcp_header_t *, packet_t *)
static int tcp_queue_packet (socket_core_t *, tcp_socket_data_t *, packet_t *, size_t)
static int tcp_queue_prepare_packet (socket_core_t *, tcp_socket_data_t *, packet_t *, size_t)
static void tcp_queue_received_end_of_data (socket_core_t *socket)
 Queue end-of-data marker on the socket.
static int tcp_queue_received_packet (socket_core_t *, tcp_socket_data_t *, packet_t *, int, size_t)
static int tcp_received_msg (device_id_t, packet_t *, services_t, services_t)
static void tcp_receiver (ipc_callid_t iid, ipc_call_t *icall)
 Process IPC messages from the IP module.
static int tcp_recvfrom_message (socket_cores_t *, int, int, size_t *)
static void tcp_refresh_socket_data (tcp_socket_data_t *)
static int tcp_release_after_timeout (void *)
static int tcp_release_and_return (packet_t *packet, int result)
 Releases the packet and returns the result.
void tcp_retransmit_packet (socket_core_t *, tcp_socket_data_t *, size_t)
static int tcp_send_message (socket_cores_t *, int, int, size_t *, int)
static void tcp_send_packets (device_id_t, packet_t *)
static packet_ttcp_send_prepare_packet (socket_core_t *, tcp_socket_data_t *, packet_t *, size_t, size_t)
static int tcp_timeout (void *)
void tl_connection (void)
 Per-connection module initialization.
int tl_initialize (int net_phone)
 Module initialization.
int tl_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, size_t *answer_count)
 Process the transport layer module message.

Variables

tcp_globals_t tcp_globals
 TCP global data.


Detailed Description

TCP module implementation.

See also:
tcp.h

Definition in file tcp.c.


Generated on Thu Jun 2 07:45:55 2011 for HelenOS/USB by  doxygen 1.4.7