BPF packet filter and pcap_compile()

From: lulepenguin (alapaa_at_operax.com)
Date: 08/25/05


Date: 25 Aug 2005 00:49:41 -0700

Short question: I am modifying some code that utilizes the BPF. The
filter is hard-coded in "packet filter assembler", but I would like to
use libpcap:s pcap_compile() function to create a filter from a command
string, e.g. "tcp and port 67 and ..." as in W.R. Stevens' UNP. Now my
question: The existing code does not use libpcap to open sniffing
devices etc, and I would like to keep it that way. However,
pcap_compile() needs a pcap_t device handle. Can I use libpcap
functions to open a sniffing device to create the pcap_t handle,
compile the filter with pcap_compile(), then use this filter with a the
/dev/bpf type device opened by the existing code? (the existing code
uses the same filter structs as libpcap)
(obviously, if the existing code opens a sniffing device that monitors
eth0, I would need to make the pcap_t handle also correspond to eth0)

Linux-specific solutions are OK at this point, but something portable
to Solaris or BSD is even better.

Best regards,

/Erik Alapää



Relevant Pages

  • Re: Autofilter set to "SHOW ALL" on open for a protected worksheet
    ... always opens on the filter of the last user. ... Make any filter (filter: To display only the rows in a list that satisfy the ... settings you want for your personal use. ... effect whenever you open the workbook, click Share Workbook on the Tools menu, ...
    (microsoft.public.excel.misc)
  • Re: Autofilter set to "SHOW ALL" on open for a protected worksheet
    ... always opens on the filter of the last user. ... Make any filter (filter: To display only the rows in a list that satisfy the ... settings you want for your personal use. ... effect whenever you open the workbook, click Share Workbook on the Tools menu, ...
    (microsoft.public.excel.misc)
  • Re: Open form based on the selection from a text box
    ... I have a TAB control on a page. ... Is Supervisor both the name of an actual field in your form's Record Source ... Are you actually trying to filter a form at all or are ... Then you say that Form 2, opens and shows no records. ...
    (microsoft.public.access.formscoding)
  • Re: Multiple Instance of Same code - different filter
    ... The code you have will filter the target form, not its subform. ... So I have Duplicate Job A and Duplicate Job B it will open ... When I run the code in debug, the form correctly opens up with the name of: ... You might also see if you can assign that filter after the form opens. ...
    (microsoft.public.access.formscoding)
  • Re: Command button to open form and find record
    ... I don't want to filter out. ... Opens the form if it is not already open. ... Public Function OpenFormTo(strForm As String, strWhere As String, Optional bGotoNewRecord As Boolean, _ ... Optional strOpenArgs As String) As Boolean ...
    (microsoft.public.access.forms)