With scapy you can do any think.

This example, all packets to port 162 are sent to another machine too

#/usr/bin/env python2.6
from scapy.all import *
ipdst="78.78.78.78"
while True:
        pkt = sniff(count = 1,filter="udp and dst port 162")
        if pkt[0].haslayer(UDP):
                ipsrc=str(pkt[0][IP].src)
                send(IP(src=ipsrc,dst=ipdst)/UDP(sport=1234,dport=162)/pkt[0][SNMP])

[warning]

you can do with TCP.

[/warning]