An FParser object is a single instance of the parser. It is either offline or online. The online (default) variant will keep running and consuming flows until the FParser object exits from scope and is no longer refrenced from anywhere else or is explicitly killed. The offline variant will keep running until the source is exhausted. Note that when sniffing on a live interface the python process will need the required priviledges (i.e. to be run as root or as a user that is allowed to put the interface in promiscous mode).
Parameters: |
|
---|
Kills the parser. After this method is called the object cannot be used anymore.
Sets or resets the TCP flow callback.
Parameters: | tcp_callback (callable) – A callable to call when a TCP flow terminates. The callable should take one argument (the flow). |
---|
Sets or resets the UDP flow callback.
Parameters: | udp_callback (callable) – A callable to call when a UDP flow terminates. The callable should take one argument (the flow). |
---|
Returns an iterator over the flows currently active in this parser. The iterator can be used in a for loop to iterate over the flows.
Finds a currently active TCP flow with given network and transport layer identifiers. Much faster than iterating over all flows when there are lots of flows.
Parameters: |
|
---|
Finds a currently active UDP flow with given network and transport layer identifiers. Much faster than iterating over all flows when there are lots of flows.
Parameters: |
|
---|
Get information about the parser
Returns: | an FParserInfo containing information for this parser. |
---|---|
Return type: | FParserInfo |
An immutable class that carries information about a running FParser instance.
The average number of packets per second seen by the parser
The number of active TCP flows
The number of active UDP flows
The number of TCP packets stored
The number of UDP packets stored
Time spent collecting. A collection is initiated periodically and “reaps” all the flows that are deemed timed out or terminated.