SnabbCo/snabbswitch — pull request #172 by n-nikolaev (2014-05-19 13:23:13+00:00)
Title: Fuzz testing app

This pull request adds a Fuzz testing app.

The application generates a number of packets on it's output link. When a packet is received it tries to find a match from the send ones.

The generation is done in 2 phases:
- payload generation - stacking Raw data, Ethernet, IPv4, IPv6, TCP and UDP protocol layers
- scatter the data to predefined iovec layouts

Each packet is marked at its payload end with a unique number. Upon receiving this number is used to find the originating match. Their parsed headers are then compared and verified.

This implies that the the packets are received assembled if any fragmentation was used. So GSO should be enabled on both TX/RX.

The first set of patches fixes some found issues with the existing code (datagram and packet). Then we add 2 utility functions in lib (random_data and deepcopy), packet (scatter) and header (eq).
For a complete packet payload generation we need more supported protocols in the protocol layer. So we add IPv4, TCP and UDP to the existing Ethernet, IPv6 and ICMP.