src/vfer_datagram.h File Reference

Header file for use by datagram.c defines datagrams and datagrams list. More...

#include <sys/uio.h>
#include <stdio.h>
#include <netinet/in.h>
#include <arpa/inet.h>

Go to the source code of this file.

Data Structures

struct  frame
 Frame structure holding fragments, their indicators, and other info. More...
struct  frame_link
 Frame link in a frames linked list. More...
struct  frame_list
 Frames linked list such as recvd frames, or send frames. More...
struct  frame_stats
 Frame stats structure used by the context_t structure for functional reliability. More...
struct  interval
 Interval structure to track which intervals have not received any data yet (missing data intervals). More...
struct  intervals
 Interval structure to track which intervals have not received any data yet (missing data intervals). More...

Defines

#define MAX_VECS   3

Typedefs

typedef interval interval_t
 Interval structure to track which intervals have not received any data yet (missing data intervals).
typedef intervals intervals_t
 Interval structure to track which intervals have not received any data yet (missing data intervals).

Functions

int Datagram_Dequeue (frame_list *frames, void *buffer, int len)
int Datagram_Enqueue (frame_list *frames, const void *buffer, int len, int frame_num)
void Datagram_Insert (frame_list *list, frame_link *prev, frame_link *insert)
frame_linkDatagram_Insert_Phantom (frame_list *list, frame_link *prev, int frame_num)
void Datagram_Remove (frame_list *list, frame_link *prev, frame_link *remove)
void Datagrams_Clear (frame_list *list)
void Datagrams_Print (frame_list *list)


Detailed Description

Header file for use by datagram.c defines datagrams and datagrams list.

Author:
Ivan Beschastnikh

Definition in file vfer_datagram.h.


Define Documentation

#define MAX_VECS   3

Definition at line 35 of file vfer_datagram.h.


Typedef Documentation

typedef struct interval interval_t

Interval structure to track which intervals have not received any data yet (missing data intervals).

typedef struct intervals intervals_t

Interval structure to track which intervals have not received any data yet (missing data intervals).


Function Documentation

int Datagram_Dequeue ( frame_list frames,
void *  buffer,
int  len 
) [inline]

Dequeues a frame from the frames list and fills in the buffer with it's data. Returns -1 if the buffer is not large enough to hold the frame's data.

For now we assume that there are frames in the list (has to be checked before the call)

Parameters:
frames datagram list pointer
buffer buffer to fill with the datagram contents
len max length of buffer to fill
Returns:
-1 on error, buffer is too small

size of the datagram written to buffer on success

Definition at line 95 of file vfer_datagram.c.

int Datagram_Enqueue ( frame_list frames,
const void *  buffer,
int  len,
int  frame_num 
) [inline]

Creates a new datagram entry, copies the buffer data into the entry and enqueues the datagram into the datagram list.

Parameters:
frames datagram list pointer
buffer buffer to include into this datagram (unchanged by this function)
len length of buffer
frame_num frame number to assign to this frame (used in control.c)
Returns:
-1 on error, if allocation of new datagram failed

0 on succes

Definition at line 31 of file vfer_datagram.c.

void Datagram_Insert ( frame_list list,
frame_link prev,
frame_link insert 
) [inline]

Inserts a frame into a frame list

Maintains the last_frame_num, first_frame_num, count, and the data byte length of frames in the frame list.

Parameters:
list frame list pointer to insert the new frame link into
prev frame link before the one to insert
insert frame link to insert

Definition at line 162 of file vfer_datagram.c.

frame_link* Datagram_Insert_Phantom ( frame_list list,
frame_link prev,
int  frame_num 
) [inline]

Definition at line 197 of file vfer_datagram.c.

void Datagram_Remove ( frame_list list,
frame_link prev,
frame_link remove 
) [inline]

Remove a frame from a frame list

Maintains the last_frame_num, first_frame_num, count, and data byte length of frames in the frame list.

Parameters:
list frame list pointer to remove the frame from
prev previous frame pointer
remove the frame pointer to remove from the list

Definition at line 129 of file vfer_datagram.c.

void Datagrams_Clear ( frame_list list  )  [inline]

Clears out the datagrams from the frame list

Parameters:
list frame list

Definition at line 240 of file vfer_datagram.c.

void Datagrams_Print ( frame_list list  ) 

Useful internal function to print a frame_list to stdout

Parameters:
list frame list

Definition at line 216 of file vfer_datagram.c.


Generated on Tue Aug 8 16:07:21 2006 for VFER by  doxygen 1.4.7