LibtraceTeam / libtrace

C Library for working with network packet traces
GNU Lesser General Public License v3.0
156 stars 51 forks source link

Add tests for structures exported by libtrace #164

Closed jacobvw closed 3 years ago

jacobvw commented 3 years ago

Verifies structure flags are correct by setting the flag in a char buffer and checking the result of the flag. Verifies structure values are correct by setting the value in a char buffer and checking the values using ntohl/ntohs functions when needed. Checks the sizes of structures as a compile time assert.

Found the following structures are incorrect due to the fields crossing byte boundaries: libtrace_8021q_t libtrace_atm_cell_t libtrace_atm_nni_cell_t libtrace_atm_capture_cell_t libtrace_atm_nni_capture_cell_t