I want to modify packet header(IP header, TCP Header) before the host send them into the network.
For example, if I'm using firefox for browsing, then I want to intercept all the packets from firefox and modify the IP/TCP header and then send them into the network.
so basically, there are two requirements: 1 intercept all the packets from firefox(but not other programs). if this is not possible, is it possible to intercept the packets from a specific port or ip/port pair
2 modify the IP/TCP header and then inject them into the network
are there ways, APIs to achieve this? how about libpcap? are there similar source code snippets? I'm working with linux c
thanks!