#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_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. | |
static packet_t * | packet_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. |
Definition in file packet_server.c.
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.