|
Functions |
| Q_Cos_t * | Q_CosAlloc (int N) |
| | Allocate and initialize the class of service structure.
|
| int | Q_CosFree (Q_Cos_t *aCosStructure) |
| | Free the class of service structure.
|
| Q_Drr_t * | Q_DrrAlloc (int(*flowCmp)(Pkt_EthernetHdr_t *, Pkt_EthernetHdr_t *), int(*flowHash)(Pkt_EthernetHdr_t *, int)) |
| | Allocate and initialize the Drr structure. Pass in the function used to hash the packet.
|
| int | Q_DrrFree (Q_Drr_t *aDrrStruct) |
| | Free the Drr structure.
|
| int | Q_CosInsertPpBegin (Q_Cos_t *cosStruct, Pkt_ProcessPkt_t *anEthFrame, int classIndex) |
| | Insert an Ethernet frame into the Cos structure Return 1 on succ, 0 on failure.
|
| int | Q_CosInsertPpEnd (Q_Cos_t *cosStruct, Pkt_ProcessPkt_t *anEthFrame, int classIndex) |
| | Insert an Ethernet frame into the Cos structure Return 1 on succ, 0 on failure.
|
| int | Q_CosInsertPpBeginEnd (Q_Cos_t *cosStruct, Pkt_ProcessPkt_t *anEthFrame, int classIndex, int insertAtEnd) |
| | Insert an Ethernet frame into the Cos structure Return 1 on succ, 0 on failure.
|
| Pkt_ProcessPkt_t * | Q_CosReadPp (Q_Cos_t *cosStruct) |
| | Read an ethernet frame from the Cos structure.
|
| Pkt_ProcessPkt_t * | Q_CosReadHead (Q_Cos_t *cosStruct, int *classPtr) |
| | Read the head of the queue - queue IS NOT updated.
|
| Pkt_ProcessPkt_t * | Q_CosHead (Q_Cos_t *cosStruct, int *classPtr) |
| | Return the head of the queue - queue IS updated.
|
| Pkt_ProcessPkt_t * | Q_CosHeadClass (Q_Cos_t *cosStruct, int classIndex) |
| | Return the head of the i-th queue - queue is updated.
|
| int | Q_CosNumClasses (Q_Cos_t *cosStruct) |
| | Read the number of classes in a cosStruct.
|
| int | Q_DrrTestIsEmpty (Q_Drr_t *flowQueue) |
| | Return 1 if the queue is emtpy, 0 otherwise.
|
| int | Q_CosTestIsEmpty (Q_Cos_t *cosStruct) |
| | Return 1 if the queue is emtpy, 0 otherwise.
|
| int | Q_DrrInsertPpBegin (Q_Drr_t *drrStruct, Pkt_ProcessPkt_t *pp) |
| | Insert a Pkt_ProcessPkt_t * into a drrStruct, add to beginning.
|
| int | Q_DrrInsertPpEnd (Q_Drr_t *drrStruct, Pkt_ProcessPkt_t *pp) |
| | Insert a Pkt_ProcessPkt_t * into a drrStruct, add to end.
|
| int | Q_DrrInsertPpBeginEnd (Q_Drr_t *drrStruct, Pkt_ProcessPkt_t *pp, int insertAtEnd) |
| | Insert a Pkt_ProcessPkt_t * into a drrStruct.
|
| Q_Flow_t * | Q_DrrReadFlow (Q_Drr_t *drrStruct, Pkt_EthernetHdr_t *pkt) |
| | Get flow associated with pkt.
|
| Pkt_ProcessPkt_t * | Q_DrrHead (Q_Drr_t *drrStruct) |
| | Get the head from the Drr structure.
|
| Pkt_ProcessPkt_t * | Q_DrrReadHead (Q_Drr_t *drrStruct) |
| | Read the head from the Drr structure. Does not change the state of the queue.
|
| st_table * | Q_DrrReadFlowToQueueTable (Q_Drr_t *drrStruct) |
| | Read the flowToQueue table for a given Drr structure.
|
| int | Q_DrrNumFlows (Q_Drr_t *drrStruct) |
| | Return the number of flows currently in the drr struct.
|
| void | Q_CosPrint (Q_Cos_t *cosData) |
| | Print elementary data about a COS structure.
|
| void | Q_DrrPrint (Q_Drr_t *drrData) |
| | Print elementary data about a DRR structure.
|
| Q_Flow_t * | Q_AllocFlow () |
| | Allocate a flow structure.
|
| double | Q_ComputeRate (util_timing_t startOfWindow, double timeWindowDuration, int numBytesExitedInWindow, int pktLength) |
| | Get the new rate - uses a windowing approach.
|
| double | Q_ComputeRateOld (util_timing_t lastTime, Pkt_EthernetHdr_t *pkt) |
| | Get the new rate for this flow - uses an IIR averaging approach.
|
| Q_Q_t * | Q_AllocQ (char *name) |
| | Allocate a Q_Q_t structure.
|
Insert an Ethernet frame into the Cos structure Return 1 on succ, 0 on failure.
The packet is specified via its pointer. We need its class of service, with 0 being the highest.
We can overload this operation to insert into a nonCOS queue, specifically a queue which is used logically to provide protection for one set of flows against another.
Definition at line 171 of file q.c.
Get the head from the Drr structure.
The packet returned is NIL if there are no packets. For now, we're simply implementing plain round robin, not deficit round robin.
We keep a queue of the next flow to service - head is current high priority, and is moved to the tail if it's nonempty. If it is empty we remove the corresponding entry from the hash table, then free the queue.
This is only RR, and to implement DRR, the qOfFlow's becomes a heap, with the heap value being the current deficit, calculated based on packet lengths.
Definition at line 447 of file q.c.