#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "rbuffers.h"
#include "setting.h"
#include "net.h"
#include "errors.h"
#include "config.h"
Data Structures | |
struct | ext_item |
struct | fragment_item |
struct | item |
struct | Tdupple |
struct | Trcving_buffers |
Functions | |
int | rbuffers_init (void) |
int | rbuffers_create (int id_buffer) |
int | rbuffers_destroy (int id_buffer) |
int | rbuffers_get_size (int id_buffer, unsigned long int *buffer_size) |
int | rbuffers_add_packet (int id_buffer, char *value, int payload_size, struct sockaddr *sender, SID_TYPE sid, enum packet_type type, SEQ_TYPE seq, DSEQ_TYPE dseq, FRAGMENTS_TYPE frag_id, FRAGMENTS_TYPE frag_count, double current_time, unsigned int retransmits_timeout) |
int | rbuffers_get_dgram (int id_buffer, char **value, int *payload_size, enum packet_type *type, DSEQ_TYPE *dseq, struct sockaddr **sender, SID_TYPE *sid) |
ARTP
library for receive buffers.
|
Add incoming packet payload into receive buffer. This function adds packet payload into receive buffer. If the whole datagram consists of 1 fragment, it's immediately saved into complete datagrams buffer. If that datagram consists of more than one fragment, the packet is saved into incomplete datagrams buffer. After coming of the last fragment the whole datagram is moved to complete datagrams buffer.
|
|
Create receive buffer. This function allocates place for relevant buffer and initializes its parameters.
|
|
Destroy receive buffer. This function destroys relevant receive buffer. It unallocates place used by that buffer and makes some other clearing steps (deletes all completely and incompletely received datagrams, destroys all its structures, etc.).
|
|
Obtain completely received datagram. This functions gets one completely received datagram (if any). If that datagram consists of more than one fragment it will be assembled from all its fragments.
|
|
Return identified receive buffer size. This function finds out receive buffer size and returns it.
|
|
Initialize receive buffers. This function doesn't include any code this time. It is defined for further purposes.
|