tbarbette / fastclick

FastClick - A faster version of the Click Modular Router featuring batching, advanced multi-processing and improved Netmap and DPDK support (ANCS'15). Check the metron branch for Metron specificities (NSDI'18). PacketMill modifications (ASPLOS'21) as well as MiddleClick(ToN, 2021) are merged in main.
Other
274 stars 81 forks source link

Created toexternalprocess.hh #349

Closed regufo closed 2 years ago

regufo commented 2 years ago

The Element ToExternalProcess is a not batch element that push data in a shared memory initialized by another process who lives out of FastClick. The referiment to the shared memory must be passed as a parameter. This Element consider the memory as diveided in virtual pages, each times it fill a virtual page it sets a shared semaphore. This class could be used to implements cybersecurity tools as WAF, NAC, IPS, IDS, or tools who neesd to interact with external data and functions. When the memory is full, this element go back to the first memory byte and rewrites the old contens. The external process should works the content before overwriting occurs. The parameters are: -SHARED_MEMORY_ID : positional mandatory parameter, it is the id of shared memory initialized by the external process -SEMAPHORE_ID: positional mandatory parameter, it is the id a shared semaphore who will be set by the the element when the virtual page will be filled -BUFFER_SIZE: positional parameter, it is an integer who specify how many rows the buffer contains (a row is a memory space sufficient to write a package, defined in the PACKAGE_SIZE parameter) -NUMBER_OF_PAGES: positional parameter, it is an integer who specifies how many pages the buffer is divided into -ENTEER_PACKET : positional boolean parameter, if it is "false" the Element will copy the first 32 bytes in the shared memory, else all data ll be copied. -PACKAGE_SIZE : positional parameter, it is the size of a packet, if the Element will receive Ethernet frames this should take the value 1522

Configuration Example: tep :: ToExternalProcess(SHARED_MEMORY_ID 123, SEMAPHORE_ID 255, BUFFER_SIZE 1024, NUMBER_OF_PAGES 128, ENTEER_PACKET 1, PACKAGE_SIZE 1522);