I want to write a simple process for Linux that performs the following tasks,

1. Captures all traffic received on the server's interface and dumps it to a file (pcap format).

2. Parses the data in real time and decodes the HTTP protocol to extract certain fields such as URL etc.

3. Modifies HTTP responses and send's replies back and forth , like a proxy server would.

4. Runs in the background as a daemon

I am thinking about writing it in C using pcap library, and possibly perl for decoding and extraction from the dumped data, but I've never used any of these tools on this scale.

So I wanted to know what basic tools/skills will I need, and what technologies will be most suitable ?