CORDET Framework - C2 Implementation
|
Implementation of Packet Queue Management. More...
Go to the source code of this file.
Functions | |
CrFwPckt_t | CrFwPcktQueuePop (CrFwPcktQueue_t pcktQueue) |
Pop a packet from the packet queue. More... | |
CrFwPckt_t | CrFwPcktQueueGetOldest (CrFwPcktQueue_t pcktQueue) |
Return the oldest packet from the queue without removing it from the queue. More... | |
CrFwBool_t | CrFwPcktQueuePush (CrFwPcktQueue_t pcktQueue, CrFwPckt_t pckt) |
Push a packet onto the packet queue. More... | |
void | CrFwPcktQueueReset (CrFwPcktQueue_t pcktQueue) |
Reset the packet queue. More... | |
void | CrFwPcktQueueInit (CrFwPcktQueue_t pcktQueue, CrFwCounterU1_t size) |
Initializes the packet queue. More... | |
void | CrFwPcktQueueShutdown (CrFwPcktQueue_t pcktQueue) |
Shutdown the packet queue. More... | |
CrFwBool_t | CrFwPcktQueueIsEmpty (CrFwPcktQueue_t pcktQueue) |
Return 1 if the packet queue is empty and 0 otherwise. More... | |
CrFwCounterU1_t | CrFwPcktQueueGetNOfPckts (CrFwPcktQueue_t pcktQueue) |
Return the number of packets currently in the packet queue. More... | |
CrFwCounterU1_t | CrFwPcktQueueGetSize (CrFwPcktQueue_t pcktQueue) |
Return the size of the packet queue. More... | |
Implementation of Packet Queue Management.
This file is part of the CORDET Framework.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
For information on alternative licensing, please contact P&P Software GmbH.
Definition in file CrFwPcktQueue.c.
CrFwCounterU1_t CrFwPcktQueueGetNOfPckts | ( | CrFwPcktQueue_t | pcktQueue | ) |
Return the number of packets currently in the packet queue.
pcktQueue | the packet queue |
Definition at line 124 of file CrFwPcktQueue.c.
CrFwPckt_t CrFwPcktQueueGetOldest | ( | CrFwPcktQueue_t | pcktQueue | ) |
Return the oldest packet from the queue without removing it from the queue.
If the packet queue is not empty, this function returns the oldest packet in the queue but does not remove the packet from queue. If the packet queue is empty, this function returns NULL.
pcktQueue | the packet queue. |
Definition at line 44 of file CrFwPcktQueue.c.
CrFwCounterU1_t CrFwPcktQueueGetSize | ( | CrFwPcktQueue_t | pcktQueue | ) |
Return the size of the packet queue.
pcktQueue | the packet queue |
Definition at line 136 of file CrFwPcktQueue.c.
void CrFwPcktQueueInit | ( | CrFwPcktQueue_t | pcktQueue, |
CrFwCounterU1_t | size | ||
) |
Initializes the packet queue.
This function allocates the memory for the packet queue and then initializes it to represent an empty packet queue. The initialization of a packet queue can only be done once. If the packet queue has already been initialized, this function returns without doing anything. The situation where the memory allocation operation for the packet queue fails is not handled and will result in undefined behaviour (probably, a run-time exception).
pcktQueue | the packet queue. |
size | the size of the packet queue |
Definition at line 95 of file CrFwPcktQueue.c.
CrFwBool_t CrFwPcktQueueIsEmpty | ( | CrFwPcktQueue_t | pcktQueue | ) |
Return 1 if the packet queue is empty and 0 otherwise.
pcktQueue | the packet queue. |
Definition at line 119 of file CrFwPcktQueue.c.
CrFwPckt_t CrFwPcktQueuePop | ( | CrFwPcktQueue_t | pcktQueue | ) |
Pop a packet from the packet queue.
If the packet queue is not empty, this function returns the oldest packet in the queue. If the packet queue is empty, this function returns NULL.
pcktQueue | the packet queue. |
Definition at line 25 of file CrFwPcktQueue.c.
CrFwBool_t CrFwPcktQueuePush | ( | CrFwPcktQueue_t | pcktQueue, |
CrFwPckt_t | pckt | ||
) |
Push a packet onto the packet queue.
If the packet queue is not full, this function adds the packet to the packet queue and return 1. If the packet queue is full, this function does nothing and returns 0.
pcktQueue | the packet queue |
pckt | the packet to be pushed onto the packet queue. |
Definition at line 52 of file CrFwPcktQueue.c.
void CrFwPcktQueueReset | ( | CrFwPcktQueue_t | pcktQueue | ) |
Reset the packet queue.
This function clears all entries in the packet queue and releases all packets which are in the packet queue.
pcktQueue | the packet queue. |
Definition at line 73 of file CrFwPcktQueue.c.
void CrFwPcktQueueShutdown | ( | CrFwPcktQueue_t | pcktQueue | ) |
Shutdown the packet queue.
This function resets the packet queue (using function CrFwPcktQueueReset
) and then releases the memory which allocated for the packet queue through function CrFwPcktQueueInit
.
pcktQueue | the packet queue. |
Definition at line 111 of file CrFwPcktQueue.c.