socket_core.c File Reference

Socket common core implementation. More...

#include <limits.h>
#include <stdlib.h>
#include "../err.h"
#include "../include/in.h"
#include "../include/inet.h"
#include "../include/socket_codes.h"
#include "../include/socket_errno.h"
#include "../structures/dynamic_fifo.h"
#include "../structures/int_map.h"
#include "../structures/packet/packet.h"
#include "../structures/packet/packet_client.h"
#include "../modules.h"
#include "socket_core.h"
Include dependency graph for socket_core.c:

Data Structures

struct  socket_port
 Bound port sockets. More...

Defines

#define SOCKET_ID_TRIES   100
 Maximum number of random attempts to find a new socket identifier before switching to the sequence.

Functions

int socket_bind_insert (socket_ports_ref global_sockets, socket_core_ref socket, int port)
 Binds the socket to the port.
void socket_destroy_core (int packet_phone, socket_core_ref socket, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void(*socket_release)(socket_core_ref socket))
 Destroys the socket.
int socket_port_add_core (socket_port_ref socket_port, socket_core_ref socket, const char *key, size_t key_length)
 Adds the socket to a socket port.
static int socket_generate_new_id (socket_cores_ref local_sockets, int positive)
 Tries to find a new free socket identifier.
 INT_MAP_IMPLEMENT (socket_cores, socket_core_t)
 GENERIC_CHAR_MAP_IMPLEMENT (socket_port_map, socket_core_ref)
 INT_MAP_IMPLEMENT (socket_ports, socket_port_t)
void socket_cores_release (int packet_phone, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void(*socket_release)(socket_core_ref socket))
 Destroys local sockets.
int socket_bind (socket_cores_ref local_sockets, socket_ports_ref global_sockets, int socket_id, void *addr, size_t addrlen, int free_ports_start, int free_ports_end, int last_used_port)
 Binds the socket to the port.
int socket_bind_free_port (socket_ports_ref global_sockets, socket_core_ref socket, int free_ports_start, int free_ports_end, int last_used_port)
 Binds the socket to a free port.
int socket_create (socket_cores_ref local_sockets, int app_phone, void *specific_data, int *socket_id)
 Creates a new socket.
int socket_destroy (int packet_phone, int socket_id, socket_cores_ref local_sockets, socket_ports_ref global_sockets, void(*socket_release)(socket_core_ref socket))
 Destroys the socket.
int socket_reply_packets (packet_t packet, size_t *length)
 Replies the packet or the packet queue data to the application via the socket.
socket_core_ref socket_port_find (socket_ports_ref global_sockets, int port, const char *key, size_t key_length)
 Finds the bound port socket.
void socket_port_release (socket_ports_ref global_sockets, socket_core_ref socket)
 Releases the socket port.
int socket_port_add (socket_ports_ref global_sockets, int port, socket_core_ref socket, const char *key, size_t key_length)
 Adds the socket to an already bound port.

Detailed Description

Socket common core implementation.


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