Wrapper around MoonGen bufarrays. More...
#include <bufArray.hpp>
Classes | |
class | iterator |
Public Member Functions | |
BufArray (Packet **pkts, uint32_t numPkts, bool fromLua=false) | |
Constructor. More... | |
~BufArray () | |
void | markDropPkt (uint32_t pktIdx) |
Mark one packet as drop. More... | |
void | markDropPkt (Packet *pkt) |
Mark one packet as drop. More... | |
void | markSendPkt (uint32_t pktIdx) |
Mark one packet as send. More... | |
void | addPkt (Packet *pkt) |
Add one packet to the BufArray. More... | |
uint32_t | getSendCount () const |
Get the number of packets currently marked as send. More... | |
uint32_t | getFreeCount () const |
Get the number of packets currently marked as free. More... | |
void | getSendBufs (Packet **sendBufs) const |
Get all the packets which are to be sent. More... | |
void | getFreeBufs (Packet **freeBufs) const |
Get all the packets which are to be freed. More... | |
uint32_t | getTotalCount () const |
Get the number of all packets in the BufArray. More... | |
Packet * | operator[] (unsigned int idx) const |
iterator | begin () |
iterator | end () |
Detailed Description
template<typename Packet>
class BufArray< Packet >
Wrapper around MoonGen bufarrays.
BufArrays bundle an array of pointers to packets together with their count
Wrapper around MoonGen bufarrays
BufArrays bundle an array of pointers to packets together with their count. It also tracks, which buffers should be send out or freed. This array grows if needed.
Definition at line 42 of file bufArray.hpp.
Constructor & Destructor Documentation
◆ BufArray()
|
inline |
Constructor.
- Parameters
-
pkts Pointer to pointers to buffers numPkts Number of buffers in pkts fromLua Set to true, if pkts is garbage-collected
Definition at line 57 of file bufArray.hpp.
◆ ~BufArray()
Definition at line 77 of file bufArray.hpp.
Member Function Documentation
◆ addPkt()
|
inline |
Add one packet to the BufArray.
This function may allocate new memory, to fit all packets into one array
- Parameters
-
pkt Packe to add
Definition at line 120 of file bufArray.hpp.
◆ begin()
Definition at line 241 of file bufArray.hpp.
◆ end()
Definition at line 242 of file bufArray.hpp.
◆ getFreeBufs()
|
inline |
Get all the packets which are to be freed.
- Parameters
-
freeBufs Array at least the size returned by getFreeCount()
Definition at line 193 of file bufArray.hpp.
◆ getFreeCount()
|
inline |
Get the number of packets currently marked as free.
- Returns
- Number of packets to be freed
Definition at line 166 of file bufArray.hpp.
◆ getSendBufs()
|
inline |
Get all the packets which are to be sent.
- Parameters
-
sendBufs Array at least the size returned by getSendCount()
Definition at line 175 of file bufArray.hpp.
◆ getSendCount()
|
inline |
Get the number of packets currently marked as send.
- Returns
- Number of packets to be sent
Definition at line 151 of file bufArray.hpp.
◆ getTotalCount()
|
inline |
Get the number of all packets in the BufArray.
- Returns
- Number of all packets
Definition at line 211 of file bufArray.hpp.
◆ markDropPkt() [1/2]
|
inline |
Mark one packet as drop.
- Parameters
-
pktIdx Index of the packet to drop
Definition at line 87 of file bufArray.hpp.
◆ markDropPkt() [2/2]
|
inline |
Mark one packet as drop.
- Parameters
-
pkt Pointer to the packet to drop
Definition at line 96 of file bufArray.hpp.
◆ markSendPkt()
|
inline |
Mark one packet as send.
- Parameters
-
pktIdx Index of the packet to send
Definition at line 109 of file bufArray.hpp.
◆ operator[]()
|
inline |
Definition at line 213 of file bufArray.hpp.
The documentation for this class was generated from the following file:
- /home/dominik/uni/MoonState/include/bufArray.hpp