|
Click
|
Class used to store the modifications performed in a packet's structure. More...
#include <modificationlist.hh>
Public Member Functions | |
| ModificationList (MemoryPool< struct ModificationNode > *poolNodes) | |
| Construct a ModificationList. | |
| ~ModificationList () | |
| Destruct a ModificationList and free the memory. | |
| void | printList () |
| Print the current state of the list in the console using click_chatter. | |
| bool | addModification (uint32_t firstPosition, uint32_t position, int offset) |
| Add a modification in the list. | |
| bool | isCommitted () |
| Indicate whether the list has been committed. | |
| void | commit (ByteStreamMaintainer &maintainer) |
| Commit the modifications stored in the list into a ByteStreamMaintainer. | |
Class used to store the modifications performed in a packet's structure.
This class is used to store the modifications made in the structure of a packet. It stores the positions at which bytes are inserted and removed so that they can be committed when the packet is in its final state. The modifications are committed to a ByteStreamMaintainer.
| ModificationList::ModificationList | ( | MemoryPool< struct ModificationNode > * | poolNodes | ) |
Construct a ModificationList.
| poolNodes | A pointer to a MemoryPool for the nodes of type struct ModificationNode. |
| ModificationList::~ModificationList | ( | ) |
Destruct a ModificationList and free the memory.
| void ModificationList::printList | ( | ) |
Print the current state of the list in the console using click_chatter.
| bool ModificationList::addModification | ( | uint32_t | firstPosition, |
| uint32_t | position, | ||
| int | offset | ||
| ) |
Add a modification in the list.
| firstPosition | The lowest position possible for this packet |
| position | The position at which the modification occurs |
| offset | The offset representing the modification (a positive number if bytes are added and a negative number if bytes are removed) |
| bool ModificationList::isCommitted | ( | ) |
Indicate whether the list has been committed.
| void ModificationList::commit | ( | ByteStreamMaintainer & | maintainer | ) |
Commit the modifications stored in the list into a ByteStreamMaintainer.
| maintainer | The ByteStreamMaintainer in which the modifications will be committed |