Packet client implementation. More...
#include <errno.h>
#include <mem.h>
#include <unistd.h>
#include <sys/mman.h>
#include "../../messages.h"
#include "packet.h"
#include "packet_header.h"
#include "packet_client.h"
Functions | |
Packet client interface | |
int | packet_copy_data (packet_t packet, const void *data, size_t length) |
Copies the specified data to the beginning of the actual packet content. | |
void * | packet_prefix (packet_t packet, size_t length) |
Allocates the specified space right before the actual packet content and returns its pointer. | |
void * | packet_suffix (packet_t packet, size_t length) |
Allocates the specified space right after the actual packet content and returns its pointer. | |
int | packet_trim (packet_t packet, size_t prefix, size_t suffix) |
Trims the actual packet content by the specified prefix and suffix lengths. | |
packet_id_t | packet_get_id (const packet_t packet) |
Returns the packet identifier. | |
int | packet_get_addr (const packet_t packet, uint8_t **src, uint8_t **dest) |
Returns the stored packet addresses and their length. | |
size_t | packet_get_data_length (const packet_t packet) |
Returns the packet content length. | |
void * | packet_get_data (const packet_t packet) |
Returns the pointer to the beginning of the packet content. | |
int | packet_set_addr (packet_t packet, const uint8_t *src, const uint8_t *dest, size_t addr_len) |
Sets the packet addresses. | |
packet_t | packet_get_copy (int phone, packet_t packet) |
Returns the packet copy. |
Packet client implementation.