packet_server.c File Reference

Packet server implementation. More...

#include <packet_server.h>
#include <align.h>
#include <assert.h>
#include <async.h>
#include <errno.h>
#include <fibril_synch.h>
#include <unistd.h>
#include <sys/mman.h>
#include <ipc/packet.h>
#include <ipc/net.h>
#include <net/packet.h>
#include <net/packet_header.h>

Go to the source code of this file.

Defines

#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.
#define FREE_QUEUES_COUNT   7

Functions

static packet_tpacket_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.
static packet_tpacket_get_local (size_t addr_len, size_t max_prefix, size_t max_content, size_t max_suffix)
 Return the packet of dimensions at least as given.
static 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.
static void packet_release (packet_t *packet)
 Release the packet and returns it to the appropriate free packet queue.
static int packet_release_wrapper (packet_id_t packet_id)
 Releases the packet queue.
static int packet_reply (packet_t *packet)
 Shares the packet memory block.
int packet_server_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, size_t *answer_count)
 Processes the packet server message.

Variables

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


Detailed Description

Packet server implementation.

Definition in file packet_server.c.


Variable Documentation

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.

Definition at line 74 of file packet_server.c.


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