<--previous | contents | next-->

# Live

The Live class is used to capture packets from a network interface.

## Interface

### Live(interface, snaplen=96, promisc=1, timeout=1000)

The Live class is instantiated with the following parameters:

- interface - the interface to monitor.
- snaplen - the maximum number of bytes to capture for a specific packet. (default 96)
- promisc - should the interface be put in promiscuous mode? (default 1)
- timeout - the timeout in milliseconds. (default 1000)

### lookupnet()

Returns a (net, mask) tuple, where both net and mask are integers.

### snapshot()

Returns the snapshot length specified when this instance was created.

### stats()

Returns a dictionary of statistics for the period of time between the start of the feed, and the time of the call. The returned dictionary contains the following keys:

- ps_recv
- ps_drop
- ps_ifdrop

<--previous | contents | next--> | (12/21/04)

PyOpenbsd v0.1 Manual