#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdarg.h>
#include <stdlib.h>
#include "artp.h"
#include "structs.h"
#include "options.h"
#include "setting.h"
#include "config.h"
#include "rbuffers.h"
#include "sbuffers.h"
#include "abuffers.h"
#include "rwlocks.h"
#include "net.h"
Functions | |
int | artp_prepare_connection (SID_TYPE sid, struct sockaddr *receiver) |
int | artp_destroy_connection (SID_TYPE sid, struct sockaddr *receiver) |
int | artp_send_dgram (struct artp_dgram *dgram, SID_TYPE sid, struct sockaddr *receiver) |
int | artp_free_dgram (struct artp_dgram *dgram) |
int | artp_receive_dgram (SID_TYPE sid, struct sockaddr *sender, struct artp_dgram *dgram) |
int | artp_receive_any_dgram (SID_TYPE *sid, struct sockaddr **sender, struct artp_dgram *dgram) |
int | artp_get_undlvr_session (SID_TYPE *sid, struct sockaddr *receiver) |
int | artp_get_sid (struct sockaddr *receiver, SID_TYPE *sid) |
int | artp_set_session_options (SID_TYPE sid, struct sockaddr *receiver, int use, enum artp_session_options option,...) |
int | artp_set_session_params (SID_TYPE sid, struct sockaddr *receiver, enum artp_session_params param,...) |
int | artp_init (int socket, char *filename) |
ARTP)
main library.
|
Destroy session. This function destroys previously created session (all its structures and buffers are destroyed, too). This session destroying is made like a garbage collector - each session knows the count of pointers that points to it. When this count is equal to 0, the session is deleted.
|
|
Free ARTP datagram. This function unallocates space taken by ARTP dgram (the space where points ARTP dgram pointers).
|
|
Get available session identification number. This function finds out available session identification number for given receiver.
|
|
Get undeliverable session. This function returns the non-established session whose packet couldn't be sent.
|
|
Initialize ARTP library. This function makes necessary initialization steps for proper function of ARTP protocol (starts threads, buffers and other structures initialization, etc.). It MUST be called as a first function! (Before any using of this protocol).
|
|
Prepare new connection. This function prepares new connection to be established (all necessary structures and buffers are created). Then this new session is inserted to its right position in array of pointers to sessions.
|
|
Receive ARTP datagram from non-established sessions. This function receives ARTP dgram from non-established session.
|
|
Receive ARTP datagram from established sessions. This function receives ARTP datagram from given sender (sent through given session). This session must be previously established.
|
|
Send ARTP datagram. This function sends ARTP datagram to specified receiver through given session. It creates packet header and copies there its payload (the payload is fragmented if necessary). Then it's stored to proper session buffer.
|
|
Set session options. This function sets defined session options. The option value is taken from variable options list (there's taken the first one only). By proper parameter we can say if we want to use this option or not.
|
|
Set session parameters. This function sets defined session parameters. The parameter value is taken from variable options list (there's taken the first one only).
|