packet_server.c File Reference

Packet server implementation. More...

#include <align.h>
#include <assert.h>
#include <async.h>
#include <errno.h>
#include <fibril_synch.h>
#include <unistd.h>
#include <ipc/ipc.h>
#include <sys/mman.h>
#include "../../err.h"
#include "../../messages.h"
#include "packet.h"
#include "packet_client.h"
#include "packet_header.h"
#include "packet_messages.h"
#include "packet_server.h"
Include dependency graph for packet_server.c:

Defines

#define FREE_QUEUES_COUNT   7
#define DEFAULT_ADDR_LEN   32
 The default address length reserved for new packets.
#define DEFAULT_PREFIX   64
 The default prefix reserved for new packets.
#define DEFAULT_SUFFIX   64
 The default suffix reserved for new packets.

Functions

int packet_server_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 Processes the packet server message.
Packet server support functions



packet_t packet_get (size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix)
 Returns the packet of dimensions at least as given.
int packet_release_wrapper (packet_id_t packet_id)
 Releases the packet queue.
void packet_release (packet_t packet)
 Releases the packet and returns it to the appropriate free packet queue.
packet_t packet_create (size_t length, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix)
 Creates a new packet of dimensions at least as given.
void packet_init (packet_t packet, size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix)
 Clears and initializes the packet according to the given dimensions.
int packet_reply (const packet_t packet)
 Shares the packet memory block.
Packet client interface



int packet_translate (int phone, packet_ref packet, packet_id_t packet_id)
 Translates the packet identifier to the packet reference.
packet_t packet_get_4 (int phone, size_t max_content, size_t addr_len, size_t max_prefix, size_t max_suffix)
 Obtains the packet of the given dimensions.
packet_t packet_get_1 (int phone, size_t content)
 Obtains the packet of the given content size.
void pq_release (int phone, packet_id_t packet_id)
 Releases the packet queue.

Variables

struct {
   fibril_mutex_t   lock
 Safety lock.
   packet_t   free [FREE_QUEUES_COUNT]
 Free packet queues.
   size_t   sizes [FREE_QUEUES_COUNT]
 Packet length upper bounds of the free packet queues.
   unsigned int   count
 Total packets allocated.
ps_globals
 Packet server global data.

Detailed Description

Packet server implementation.


Variable Documentation

unsigned int count
packet_t free[FREE_QUEUES_COUNT]
fibril_mutex_t lock

Safety lock.

size_t sizes[FREE_QUEUES_COUNT]

Packet length upper bounds of the free packet queues.

The maximal lengths of packets in each queue in the ascending order. The last queue is not limited.


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