dpdkcap / dpdkcap

DPDK-based packet capture tool
Other
220 stars 114 forks source link

refactoring some code (stats, writers) #57

Open xaki23 opened 9 months ago

xaki23 commented 9 months ago

there are currently two situations where code invariants exist that are both "not great":

i would like to change both into runtime-options. after talking with my personal C guru (C is not my native language), the current rough plan is ...

going to ask @Woutifier and @groud for review of actual commits, but feedback/suggestions already welcome by all interested parties.

groud commented 9 months ago

stats modes ansi // ncurses is a compile time option (by editing the makefile in undocumented ways)

Ah well, it's not really optional in fact then. But yeah, that can be moved to command line arguments.

writer compressed/plain (and the lost pcap/pcapng) is an ifelse fest.

Not sure I understand, but I am not against improvements there.

The plan looks interesting, but it's hard to understand what you mean without the code. But yeah, structs can be helpful in some situations. Make sure not to over-engineer this too much though, I'd rather avoid having too many abstraction layers for a code that is, for now, easy enough to understand.