Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Help learning to use the packet filtering tools: (6 Items)
   
Help learning to use the packet filtering tools  
I'm looking for a good tutorial for getting started with the packet filtering/network sniffing tools.

From what I can see I want to use either pf or bpf.

I want to be able to open packets with address for machine other than mine, so whichever is best for that.
Re: Help learning to use the packet filtering tools  
To see packets sent to other addresses you will need to use BPF as that is the only way you can put the interface in 
promiscuous mode. Here's some example code that I found on a quick search:
https://gist.github.com/manuelvonthron-opalrt/8559997

Note that libpcap uses BPF so if you find it easier to program for that then it is an alternative.
Re: Help learning to use the packet filtering tools  
I've looked into libpcap, but I'm not sure how to get it to work for QNX, since I'm using a windows host.

I've read that it's part of QNX's standard libraries so I tried just importing it, but it can't find the function 
definitions, and I can't figure out where I would get them.
Re: Help learning to use the packet filtering tools  
See the PCAP documentation on TCPDUMP page:

http://www.tcpdump.org/pcap.html
Re: Help learning to use the packet filtering tools  
To repeat my previous question: where is the actual libpcap.a (or equivalent) file in the QNX directory structure?

I found lots of guides on programming with libpcap, but none of them mean anything if I can't access the functions 
declared in the header.

I found the header file and Momentics sees it fine, but when I tell it to include the libpcap.a file I've found (in 
target/qnx6/.../usr/lib) it does not give a file not found error (meaning it SEES the library), but doesn't load the 
function definitions (meaning it is the WRONG library), resulting in an 'undefined reference' error.
Re: Help learning to use the packet filtering tools  
libpcap.a and libpcapS.a are in the SDP in the target/qnx6/<CPU>/usr/lib directory:

E.g on my Linux install of 6.6.0 in /opt/qnx660:
$ find /opt/qnx660/target/qnx6 -name 'libpcap*'
/opt/qnx660/target/qnx6/x86/usr/lib/libpcap.a
/opt/qnx660/target/qnx6/x86/usr/lib/libpcapS.a
/opt/qnx660/target/qnx6/armle-v7/usr/lib/libpcap.a
/opt/qnx660/target/qnx6/armle-v7/usr/lib/libpcapS.a
$