I want to listen to only one port
You can do this with a sniffer. Just ignore packets from different ports.
I may need to stop it from sending some specific packages, because my program will send it instead of the original application
Well, here I suggest you give up sniffers and use the MITM technique .
PREROUTING, "". , UDP, Linux, iptables "" , "":
1. ( , ):
iptables -t nat -A PREROUTING -i <iface> -p <proto> --dport <dport>
-j REDIRECT --to-port <newport>
2. <newport>.
3. ( ). "" , getsockopt SO_ORIGINAL_DST, .
, ... , , :-)
, .