i dont know where to start and.....
i want to have an idea of what to do once the packet is captured.
in the coding..
part...
Ah, okay, so what we need to do is develop your algorithm. You know the basics of it:
capture packets
modify payload
resend packets
So at this point, you haven't decided on a library, you can still outline what you need to do with everything.
capture packets becomes:
open socket
begin listening on an interface
As you haven't said what you need to do to the payload, I can't help you with that algorithm, you'll have to come up with it yourself. Once you have your algorithm for how you are going to approach the problem, you should look at libpcap and the other libraries you have found, and see which one will allow you to listen and do the modifications you want the best.
as i am new to networking..im looking for a sample code that could help me out.
In writing a more stable code.
Nobody here is going to give you code, especially not when there is
a tutorial of how to get started on the project's webpage. I suggested you read that for a reason.