You may use libpcap to capture any packets portably. It lets you specify a filter based on information on the packet such as protocol, port numbers, etc. Then you may use libnet to replay them (possibly modified) or you may use the sockets API and tunnel them through it.
|