Than it is a very simple packet filter. The first problem is to acquire the packets for sniffing and than tell the decision to the driver and after that you can write a simple function like:
BOOL acceptPacketFromPort(int port) {
return port == 42;
}
Maybe you should strart with some
tcpdump tutorial. Sometimes a batch help to solve "simple" problems.