tcpdump filter length Question

2016-01-07 Thread Juan Herrera
Hello all, I am trying to do a tcpdump filter like below The idea is to filter all ethernet frames and where the frame ends as I understand keyword *len *has the total length of the captured packet, substracts 85 positions and compare if byte in position len - 85 is equal to hex 0x2. Does anybody

BPF Berkeley Packet Filter

2015-12-29 Thread Juan Herrera
Hello BSD folks, I am developing a networking application in C and I have a question regarding BPF (Berkeley Packet Filters), I will give you an idea of the app first, I need to send a packet from machine A to machine B (any kind of packet) so for this I wrote a packet generator application which

BPF Berkeley Packet Filter

2015-12-29 Thread Juan Herrera
Hello, I have a question regarding Berkeley Packet filter, which is Can I read an incoming packet length with BPF, I am working on a project that requires to filter the receiving packets in the kernel before they get to userspace, but I need to be able to read the packet length when applying BPF b