#include "vfer_datagram.h"
#include "vfer.h"
Go to the source code of this file.
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_link * | Datagram_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) |
Definition in file vfer_datagram.c.
| 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)
| frames | datagram list pointer | |
| buffer | buffer to fill with the datagram contents | |
| len | max length of buffer to fill |
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.
| 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) |
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.
| 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.
| 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
| 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
| list | frame list |
Definition at line 216 of file vfer_datagram.c.
1.4.7