Module pcap :: Class bpf_program
[hide private]
[frames] | no frames]

Class bpf_program

object --+
         |
        bpf_program

bpf_program object is a wrapper for the type `struct bpf_program_t' used in PCAP library. Its methods are all PCAP library functions with prototype `type pcap_func(struct bpf_program_t *,...)'. Method names are functions names without `pcap_' prefix.

Note: bpf_program object cannot be created directly. The only way to create such object is to use the `compile()' method of a pcap object instance.

Instance Methods [hide private]
a new object with type S, a subtype of T
__new__(T, S, ...)
boolean
offline_filter(h, pkt)
offline_filter() check whether a filter matches a packet.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

offline_filter(h, pkt)

 

offline_filter() check whether a filter matches a packet. It is a wrapper for pcap_offline_filter() Packet Capture library routine.

Argument `h' must be a Python dictionary which is a wrapper for `struct pcap_pkthdr' defined in PCAP library. See `loop()' documentation for a description of this dictionary. Argument `pkt' is a (raw) string.

Returns: boolean