LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 08-17-2005, 07:35 PM   #1
kidskc
LQ Newbie
 
Registered: May 2005
Posts: 9

Rep: Reputation: 0
Question on PCAP filters


Hello,

I am new to pcap programming and looking at its filters capabilities. I am
not able to find documentation on Filter Syntax, its limitations etc. Please
provide me with any links for this.

Can I add a filter to examine any part of packet? For example, on a TCP/IP/Ethernet packet, can I add a filter to match the 8 bytes starting from byte num 6 of Ethernet header?

What I need is the ability to create filters based on:

1) Starting offset from start of Ethernet packet
2) Length of the match (ie., compare 4 or 6 or 8 or any number of bytes)
3) Specify the value against which to compare

I would appreaciate any responses.

Thanks,
Kidskc
 
Old 08-17-2005, 07:59 PM   #2
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Mmmm the bpf filter has something like array substrings but don't expect it to handle all possible situations, because it was designed to be run natively on networking BSD-derived kernels, so their purpose was speed between user-space and kernel

For this reason you could install a pcap handler and perform some of this "filtering" yourself. Anyway, a description of these expressions are in tcpdump(1). See pcap(3) too
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PCAP on LOOPBACK Device johnnyde Programming 4 03-05-2009 04:05 AM
Pcap Files OriDagan Linux - Networking 0 07-15-2005 04:20 AM
pcap library jagman Programming 1 04-27-2005 07:35 AM
mac address with pcap SeanatIL Programming 2 07-19-2004 10:57 AM
Questions on pcap.h Traveler_Q Programming 2 02-25-2004 03:03 PM


All times are GMT -5. The time now is 07:39 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration