[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple filter question



You can find an small example of filter use in tcl/ex/snoop/snoop.tcl
(although snoop is currently not working well, the filter part works
fine).

Basically, you need to set offset_ and match_.

snoop.tcl:      $filter set offset_ [PktHdr_offset PacketHeader/Mac macSA_]
snoop.tcl:      $filter set match_ [$src node-addr]

A filter has two targets which you also need to set.

$filter target ...
$filter filter-target ... 

	target sets target_,  just like Connector
	filter_target sets filter_target_ - for packets "filtered out"

Filter/Field checks in every passing packet if the field (determined
by offset_) is equal to match_, if so, packets will be directed to
filter_target_, if not - to standard target_.

Hope this helps.

  -Yuri

"Stephan Heuscher" <[email protected]> writes:

> Hi,
> 
> How do you use the "Filter/Field"? There is no documentation, and there are
> no examples of filters.
> 
> Thanx for any help.