I need to use NetPackets library to complete the following: I need to read all packets in a pcap trace, replace all source MAC addresses by a given address and output it to pcap trace. I know how to handle reading the packets and decoding it to obtain MAC using e.g.
but do not know how to handle modification and writing back to pcap trace (I know how to output to std. output)