The plokami Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The plokami Reference Manual

This is the plokami Reference Manual, version 1.5, generated automatically by Declt version 2.3 "Robert April" on Tue Jan 09 15:30:41 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

PLOKAMI is a lispy interface to libpcap built on top of a CFFI portability
layer. Complete bindings to every function in libpcap are in pcap.lisp
and a higher level interface in plokami.lisp.

* Features
  - Realtime network packet capture
  - Injection
  - PCAP dumpfile read/write
  - BPF
  - Timeouts and operation in non-blocking mode
  - Full support for Windows through WinPCAP

The library has been tested on SBCL (linux/darwin), ClozureCL and 
LispWorks (darwin/win32) but should work on every platform that 
CFFI supports.

* Performance
Minimal overhead over plain libpcap.

* License
The code comes with a BSD-style license so you can basically do with it
whatever you want.

* Documentation
[[http://atomontage.github.com/plokami]]

* Author
xristos (AT) sdf (DOT) lonestar (DOT) org


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 plokami

Author

xristos@sdf.lonestar.org

Description

Common Lisp PCAP interface.

Version

1.5

Dependency

cffi

Source

plokami.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 plokami.asd

Location

plokami.asd

Systems

plokami (system)

Packages

plokami-asd


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 plokami/packages.lisp

Parent

plokami (system)

Location

packages.lisp

Packages

plokami


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 plokami/pcap.lisp

Dependency

packages.lisp (file)

Parent

plokami (system)

Location

pcap.lisp

Exported Definitions

*pcap-version* (special variable)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 plokami/plokami.lisp

Dependency

pcap.lisp (file)

Parent

plokami (system)

Location

plokami.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.5 plokami/utils.lisp

Dependency

plokami.lisp (file)

Parent

plokami (system)

Location

utils.lisp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 plokami-asd

Source

plokami.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 plokami

Source

packages.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *pcap-version*

Version of native libpcap library.

Package

plokami

Source

pcap.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Macros

Macro: with-pcap-interface (LIVE IFACE &rest OPTIONS) &body BODY

Call ‘MAKE-PCAP-LIVE’ using IFACE, OPTIONS as arguments and store
the resulting instance in LIVE. Forms in body are wrapped in an ‘UNWIND-PROTECT’ form that takes care of deallocating resources on error and also returns packet capture statistics when possible. A restart is also automatically invoked when ‘PACKET-FILTER-ERROR’ is signaled, skipping the filter setup.

Package

plokami

Source

plokami.lisp (file)

Macro: with-pcap-reader (READER FILE &rest OPTIONS) &body BODY

Call ‘MAKE-PCAP-READER’ using FILE, OPTIONS as arguments and store the resulting instance in READER. Forms in body are wrapped in an UNWIND-PROTECT form that takes care of deallocating resources on error. A restart is also automatically invoked when ‘PACKET-FILTER-ERROR’ is signaled,
skipping the filter setup.

Package

plokami

Source

plokami.lisp (file)

Macro: with-pcap-writer (WRITER FILE &rest OPTIONS) &body BODY

Call ‘MAKE-PCAP-WRITER’ using FILE, OPTIONS as arguments and store the resulting instance in WRITER. Forms in body are wrapped in an ‘UNWIND-PROTECT’ form that takes care of deallocating resources on error.

Package

plokami

Source

plokami.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Functions

Function: find-all-devs ()

Return a list of all network devices that can be opened for capture. Result list mirrors layout explained in pcap_findalldevs(3). NIL is returned when no interfaces are available, possibly due to permission issues.
Signals ‘NETWORK-INTERFACE-ERROR’ on errors.

Package

plokami

Source

plokami.lisp (file)

Function: make-pcap-live INTERFACE &key PROMISC NBIO TIMEOUT SNAPLEN

Creates and returns a ‘PCAP-LIVE’ instance that is used for live packet capture from a network interface.

INTERFACE is a string that defines the network interface to use for capture. PROMISC should be T for promiscuous mode, NIL otherwise.
NBIO should be T when non-blocking operation is required. NIL otherwise (default). TIMEOUT should hold read timeout in milliseconds.
0 will wait forever. Only used when in blocking mode and only in platforms that support it. No guarantee of actually returning within TIMEOUT is made. Use non-blocking mode if that is not adequate. SNAPLEN should contain the number of bytes captured per packet. Default is 68 which should be enough for headers. ‘NETWORK-INTERFACE-ERROR’ or ‘BLOCK-MODE-ERROR’ is signaled on errors.

Package

plokami

Source

plokami.lisp (file)

Function: make-pcap-reader FILE &key SNAPLEN

Creates and returns a ‘PCAP-READER’ instance that is used for reading packets from a pcap dumpfile.

FILE is the filename to open and read packets from. SNAPLEN should contain the number of bytes read per packet captured. Default is 68 which should be enough for headers. ‘CAPTURE-FILE-READ-ERROR’ is signaled on errors.

Package

plokami

Source

plokami.lisp (file)

Function: make-pcap-writer FILE &key DATALINK SNAPLEN

Creates and returns a ‘PCAP-WRITER’ instance that is used to write packets to a pcap dumpfile.

FILE is the filename to open and write packets to. DATALINK should contain a string that represents the datalink protocol of the network interface used to capture the packets. Default is Ethernet. SNAPLEN should contain the number of bytes read per packet captured and should be the same as the one used when capturing/reading the packets.
‘CAPTURE-FILE-WRITE-ERROR’ is signaled on errors.

Package

plokami

Source

plokami.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Generic functions

Generic Function: capture PCAP-PROCESS-MIXIN PACKETS HANDLER

Only works for ‘PCAP-LIVE’ or ‘PCAP-READER’ instances.
Captures and processes maximum number of PACKETS. Minimum is
zero. Return 0 when no packets available (did not pass installed packet filter, end of file for dumpfiles, read timeout expired before packets arrive,
no packets available at the time of the call if in non-blocking-mode) otherwise return number of packets processed which can be fewer than the maximum given in PACKETS (due to internal libpcap buffer).

A count of -1 in PACKETS processes all the packets received so far when live capturing, or all the packets in a file when reading a pcap dumpfile.

Handler must be a user defined function that accepts five arguments and will get called once for every packet received. The values passed are SEC, USEC, CAPLEN, LEN and BUFFER. SEC and USEC correspond to
seconds/microseconds since the UNIX epoch (timeval structure in C) at the time of capture. CAPLEN corresponds to the number of bytes captured. LEN corresponds to the number of bytes originally present in the packet but not necessarily captured. BUFFER is a statically allocated byte vector (via ‘CFFI:MAKE-SHAREABLE-BYTE-VECTOR’) with the contents of the captured packet. This means that successive calls of the packet handler will overwrite its contents and if packet persistence is required, contents of BUFFER should be copied somewhere else from within HANDLER.

If an error occurs, ‘PACKET-CAPTURE-ERROR’ is signaled for live
interfaces and ‘CAPTURE-FILE-READ-ERROR’ for pcap dumpfiles (reading).
For more details on callback handling, see CFFI callback ‘PCAP-HANDLER’.

Package

plokami

Source

plokami.lisp (file)

Methods
Method: capture (CAP pcap-process-mixin) (PACKETS integer) (PHANDLER function)
Generic Function: dump PCAP-WRITER DATA SEC USEC &key LENGTH ORIGLENGTH

Writes contents of byte vector DATA to ‘PCAP-WRITER’
instance (which corresponds to a pcap dumpfile). LENGTH is the number of bytes to write and is set to the size of DATA when omitted. ORIGLENGTH should be set to the number of bytes originally present in the packet and is set to LENGTH when omitted. SEC and USEC should be set to seconds/microseconds since the UNIX epoch at the time of capture (timeval structure in C).
If you are using your own source buffer (instead of the one used by PLOKAMI), it should be allocated with ‘CFFI:MAKE-SHAREABLE-BYTE-VECTOR’. As LIBPCAP does not return useful value on pcap_dump() no PLOKAMI specific conditions, beyond simple assertions of argument checks, are raised by this function.

Package

plokami

Source

plokami.lisp (file)

Methods
Method: dump (WRITER pcap-writer) (BUFFER vector) (SEC integer) (USEC integer) &key LENGTH ORIGLENGTH
Generic Function: inject PCAP-LIVE BUFFER &key LENGTH

Injects LENGTH bytes to a live pcap interface
(size of BUFFER if omitted). Return number of bytes injected on success.
For performance reasons BUFFER should be a byte vector allocated with ‘CFFI:MAKE-SHAREABLE-BYTE-VECTOR’. ‘PACKET-INJECT-ERROR’ is signaled on failure.

Package

plokami

Source

plokami.lisp (file)

Methods
Method: inject (CAP pcap-live) (BUFFER vector) &key LENGTH
Generic Function: pcap-live-alive-p OBJECT
Package

plokami

Methods
Method: pcap-live-alive-p (PCAP-LIVE pcap-live)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-live-datalink OBJECT
Package

plokami

Methods
Method: pcap-live-datalink (PCAP-LIVE pcap-live)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-live-descriptor OBJECT
Package

plokami

Methods
Method: pcap-live-descriptor (PCAP-LIVE pcap-live)

File descriptor that can be used with epoll/kqueue/select.

Source

plokami.lisp (file)

Generic Function: pcap-live-interface OBJECT
Package

plokami

Methods
Method: pcap-live-interface (PCAP-LIVE pcap-live)

Interface to capture packets from.

Source

plokami.lisp (file)

Generic Function: pcap-live-promisc-p OBJECT
Package

plokami

Methods
Method: pcap-live-promisc-p (PCAP-LIVE pcap-live)

True if capturing in promiscuous mode.

Source

plokami.lisp (file)

Generic Function: pcap-live-snaplen OBJECT
Package

plokami

Methods
Method: pcap-live-snaplen (PCAP-LIVE pcap-live)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-live-timeout OBJECT
Package

plokami

Methods
Method: pcap-live-timeout (PCAP-LIVE pcap-live)

Read timeout in milliseconds. 0 will wait forever.
Only works in blocking mode/platforms that support it. No guarantee of returning within timeout.

Source

plokami.lisp (file)

Generic Function: pcap-reader-alive-p OBJECT
Package

plokami

Methods
Method: pcap-reader-alive-p (PCAP-READER pcap-reader)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-reader-datalink OBJECT
Package

plokami

Methods
Method: pcap-reader-datalink (PCAP-READER pcap-reader)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-reader-file OBJECT
Package

plokami

Methods
Method: pcap-reader-file (PCAP-READER pcap-reader)

File to read packets from.

Source

plokami.lisp (file)

Generic Function: pcap-reader-major OBJECT
Package

plokami

Methods
Method: pcap-reader-major (PCAP-READER pcap-reader)

Major version of savefile.

Source

plokami.lisp (file)

Generic Function: pcap-reader-minor OBJECT
Package

plokami

Methods
Method: pcap-reader-minor (PCAP-READER pcap-reader)

Minor version of savefile.

Source

plokami.lisp (file)

Generic Function: pcap-reader-snaplen OBJECT
Package

plokami

Methods
Method: pcap-reader-snaplen (PCAP-READER pcap-reader)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-reader-swapped-p OBJECT
Package

plokami

Methods
Method: pcap-reader-swapped-p (PCAP-READER pcap-reader)

Savefile uses different byte order from host system.

Source

plokami.lisp (file)

Generic Function: pcap-writer-alive-p OBJECT
Package

plokami

Methods
Method: pcap-writer-alive-p (PCAP-WRITER pcap-writer)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-writer-datalink OBJECT
Package

plokami

Methods
Method: pcap-writer-datalink (PCAP-WRITER pcap-writer)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: pcap-writer-file OBJECT
Package

plokami

Methods
Method: pcap-writer-file (PCAP-WRITER pcap-writer)

File to write packets to.

Source

plokami.lisp (file)

Generic Function: pcap-writer-snaplen OBJECT
Package

plokami

Methods
Method: pcap-writer-snaplen (PCAP-WRITER pcap-writer)

automatically generated reader method

Source

plokami.lisp (file)

Generic Function: plokami-error-text CONDITION
Package

plokami

Methods
Method: plokami-error-text (CONDITION plokami-error)
Source

plokami.lisp (file)

Generic Function: set-filter PCAP-PROCESS-MIXIN STRING

Sets a packet filter on a ‘PCAP-LIVE’ or ‘PCAP-READER’
instance. The filter should be given as a bpf expression in STRING. ‘PACKET-FILTER-ERROR’ is signaled on failure. A restart, ‘CONTINUE-NO-FILTER’ is installed that can be invoked to continue on error.

Package

plokami

Source

plokami.lisp (file)

Methods
Method: set-filter (CAP pcap-reader) (FILTER string)
Method: set-filter (CAP pcap-live) (FILTER string)
Generic Function: set-non-block PCAP-LIVE BLOCK-MODE

Sets non-blocking mode if BLOCK-MODE is T, blocking
mode if NIL. ‘BLOCK-MODE-ERROR’ is signaled on failure and a restart, ‘CONTINUE-BLOCK-MODE’ is installed, that can be invoked to continue.

Package

plokami

Source

plokami.lisp (file)

Methods
Method: set-non-block (CAP pcap-live) (BLOCK-MODE (eql nil))
Method: set-non-block (CAP pcap-live) (BLOCK-MODE (eql t))
Generic Function: stats PCAP-LIVE

Returns packet capture statistics from the start of the run
to the time of the call for live interface capture only. Statistics are returned as multiple values and correspond to packets received, packets dropped and packets dropped by interface (in this order). ‘NETWORK-INTERFACE-ERROR’ is signaled on failure.

Package

plokami

Source

plokami.lisp (file)

Methods
Method: stats (CAP pcap-live)
Generic Function: stop PCAP-MIXIN

Deallocates resources for ‘PCAP-LIVE’, ‘PCAP-READER’, ‘PCAP-WRITER’ instance.

Package

plokami

Source

plokami.lisp (file)

Method Combination

progn (short method combination)

Options: :most-specific-first

Methods
Method: stop (CAP pcap-writer) progn
Method: stop (CAP pcap-process-mixin) progn
Method: stop (CAP pcap-mixin) progn

Previous: , Up: Exported definitions   [Contents][Index]

5.1.5 Conditions

Condition: block-mode-error ()

Signaled on error when changing blocking mode.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: capture-file-read-error ()

Signaled on all pcap readfile errors.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: capture-file-write-error ()

Signaled on all pcap dumpfile errors.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: network-interface-error ()

Signaled on all network interface errors.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: packet-capture-error ()

Signaled on error during live packet capture.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: packet-filter-error ()

Signaled when a berkeley packet filter could not be established.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: packet-inject-error ()

Signaled on errors during packet injection.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

plokami-error (condition)

Condition: plokami-error ()

Generic condition for this package.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

error (condition)

Direct subclasses
Direct methods

plokami-error-text (method)

Direct slots
Slot: text
Initargs

:text

Readers

plokami-error-text (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +dlt_802_11+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_en10mb+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_null+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_ppp+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_ppp_bsdos1+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_ppp_bsdos2+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_ppp_ether+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_ppp_pppd+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_ppp_serial+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_slip+
Package

plokami

Source

pcap.lisp (file)

Constant: +dlt_usb_linux+
Package

plokami

Source

pcap.lisp (file)

Constant: +error-buffer-size+
Package

plokami

Source

pcap.lisp (file)

Constant: +pcap_if_loopback+
Package

plokami

Source

pcap.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Special variables

Special Variable: *callbacks*
Package

plokami

Source

plokami.lisp (file)

Special Variable: *compile-mutex*
Package

plokami

Source

plokami.lisp (file)

Special Variable: *concurrent-pcap*
Package

plokami

Source

plokami.lisp (file)

Special Variable: *concurrent-pcap-mutex*
Package

plokami

Source

plokami.lisp (file)

Special Variable: *supported-datalinks*
Package

plokami

Source

pcap.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Macros

Macro: with-error-buffer (ERROR-BUFFER) &body BODY
Package

plokami

Source

plokami.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Functions

Function: %inet-ntop AF SRC DST SIZE
Package

plokami

Source

pcap.lisp (file)

Function: %link-ntoa SDL
Package

plokami

Source

pcap.lisp (file)

Function: %memcpy DST SRC LEN
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-breakloop PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-close PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-compile PCAP_T FP STR OPTIMIZE NETMASK
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-datalink PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-datalink-name-to-val NAME
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-datalink-val-to-description DLT
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-datalink-val-to-name DLT
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-dispatch PCAP_T CNT CALLBACK USER
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-dump USER HEADER SP
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-dump-close DUMPER
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-dump-flush DUMPER
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-dump-ftell DUMPER
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-dump-open PCAP_T FNAME
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-fileno PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-findalldevs ALLDEVSP ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-freealldevs ALLDEVS
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-freecode FP
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-get-selectable-fd PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-geterr PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-getnonblock PCAP_T ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-inject PCAP_T BUF SIZE
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-is-swapped PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-lib-version ()
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-list-datalinks PCAP_T DLT_BUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-lookupdev ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-lookupnet DEVICE NETP MASKP ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-loop PCAP_T CNT CALLBACK USER
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-major-version PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-minor-version PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-next PCAP_T HEADER
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-next-ex PCAP_T HEADERP DATAP
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-open-dead LINKTYPE SNAPLEN
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-open-live DEVICE SNAPLEN PROMISC TO_MS ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-open-offline FILENAME ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-perror PCAP_T PREFIX
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-sendpacket PCAP_T BUF SIZE
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-set-datalink PCAP_T DLT
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-setdirection PCAP_T D
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-setfilter PCAP_T FP
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-setnonblock PCAP_T NONBLOCK ERRBUF
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-snapshot PCAP_T
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-stats PCAP_T PS
Package

plokami

Source

pcap.lisp (file)

Function: %pcap-strerror ERROR
Package

plokami

Source

pcap.lisp (file)

Function: clear-error-buffer FOREIGN-BUFFER

Set FOREIGN-BUFFER to the empty string.

Package

plokami

Source

plokami.lisp (file)

Function: error-buffer-to-lisp FOREIGN-BUFFER

Return FOREIGN-BUFFER as a lisp string.

Package

plokami

Source

plokami.lisp (file)

Function: free-error-buffer FOREIGN-BUFFER

Free memory held by FOREIGN-BUFFER.

Package

plokami

Source

plokami.lisp (file)

Function: make-error-buffer ()

Allocate and return foreign char array to hold error string.

Package

plokami

Source

plokami.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Classes

Class: bpf_insn-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: bpf_program-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: pcap-live ()

Class for live packet capture.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses
Direct methods
Direct slots
Slot: interface

Interface to capture packets from.

Initargs

:if

Readers

pcap-live-interface (generic function)

Slot: promisc

True if capturing in promiscuous mode.

Initargs

:promisc

Readers

pcap-live-promisc-p (generic function)

Slot: non-block

True if pcap descriptor is in non-blocking mode.

Initargs

:nbio

Slot: timeout

Read timeout in milliseconds. 0 will wait forever.
Only works in blocking mode/platforms that support it. No guarantee of returning within timeout.

Initargs

:timeout

Initform

100

Readers

pcap-live-timeout (generic function)

Slot: descriptor

File descriptor that can be used with epoll/kqueue/select.

Readers

pcap-live-descriptor (generic function)

Slot: live
Readers

pcap-live-alive-p (generic function)

Slot: datalink
Readers

pcap-live-datalink (generic function)

Slot: snaplen
Initargs

:snaplen

Readers

pcap-live-snaplen (generic function)

Class: pcap-mixin ()

Internal class used as a mixin for all classes with pcap functionality.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods

stop (method)

Direct slots
Slot: pcap_t

Foreign pointer to pcap structure.

Slot: datalink

Datalink protocol for this device.

Slot: snaplen

How many bytes to capture per packet received.

Initform

68

Slot: live

Packet capture object is live.

Class: pcap-process-mixin ()

Internal class, mixed in packet processing (‘PCAP-LIVE’, ‘PCAP-READER’).

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: buffer

Packet buffer to hold captured packets.

Slot: handler

Lisp packet handler for capture. Invoked by callback.

Slot: hashkey

Hashtable key for this instance.

Slot: hashkey-pointer

Foreign pointer to hashkey, passed in callback.

Class: pcap-reader ()

Class for reading packets from a dumpfile.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses
Direct methods
Direct slots
Slot: file

File to read packets from.

Initargs

:file

Initform

(error "must supply filename to read packets from.")

Readers

pcap-reader-file (generic function)

Slot: swapped

Savefile uses different byte order from host system.

Readers

pcap-reader-swapped-p (generic function)

Slot: major

Major version of savefile.

Readers

pcap-reader-major (generic function)

Slot: minor

Minor version of savefile.

Readers

pcap-reader-minor (generic function)

Slot: live
Readers

pcap-reader-alive-p (generic function)

Slot: datalink
Readers

pcap-reader-datalink (generic function)

Slot: snaplen
Initargs

:snaplen

Readers

pcap-reader-snaplen (generic function)

Class: pcap-writer ()

Class for writing packets to a dumpfile.

Package

plokami

Source

plokami.lisp (file)

Direct superclasses

pcap-mixin (class)

Direct methods
Direct slots
Slot: file

File to write packets to.

Initargs

:file

Initform

(error "must supply file to write packets to.")

Readers

pcap-writer-file (generic function)

Slot: dumper

Foreign packet dumper object.

Slot: datalink
Initargs

:datalink

Initform

"en10mb"

Readers

pcap-writer-datalink (generic function)

Slot: live
Readers

pcap-writer-alive-p (generic function)

Slot: snaplen
Initargs

:snaplen

Readers

pcap-writer-snaplen (generic function)

Class: pcap_addr_t-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: pcap_if_t-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: pcap_pkthdr-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: pcap_stat-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: sockaddr-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)
Class: timeval-tclass ()
Package

plokami

Source

pcap.lisp (file)

Direct superclasses
  • translatable-foreign-type (class)
  • foreign-struct-type (class)

Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   P  
Index Entry  Section

F
File, Lisp, plokami.asd: The plokami<dot>asd file
File, Lisp, plokami/packages.lisp: The plokami/packages<dot>lisp file
File, Lisp, plokami/pcap.lisp: The plokami/pcap<dot>lisp file
File, Lisp, plokami/plokami.lisp: The plokami/plokami<dot>lisp file
File, Lisp, plokami/utils.lisp: The plokami/utils<dot>lisp file

L
Lisp File, plokami.asd: The plokami<dot>asd file
Lisp File, plokami/packages.lisp: The plokami/packages<dot>lisp file
Lisp File, plokami/pcap.lisp: The plokami/pcap<dot>lisp file
Lisp File, plokami/plokami.lisp: The plokami/plokami<dot>lisp file
Lisp File, plokami/utils.lisp: The plokami/utils<dot>lisp file

P
plokami.asd: The plokami<dot>asd file
plokami/packages.lisp: The plokami/packages<dot>lisp file
plokami/pcap.lisp: The plokami/pcap<dot>lisp file
plokami/plokami.lisp: The plokami/plokami<dot>lisp file
plokami/utils.lisp: The plokami/utils<dot>lisp file

Jump to:   F   L   P  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %  
C   D   E   F   G   I   M   P   S   W  
Index Entry  Section

%
%inet-ntop: Internal functions
%link-ntoa: Internal functions
%memcpy: Internal functions
%pcap-breakloop: Internal functions
%pcap-close: Internal functions
%pcap-compile: Internal functions
%pcap-datalink: Internal functions
%pcap-datalink-name-to-val: Internal functions
%pcap-datalink-val-to-description: Internal functions
%pcap-datalink-val-to-name: Internal functions
%pcap-dispatch: Internal functions
%pcap-dump: Internal functions
%pcap-dump-close: Internal functions
%pcap-dump-flush: Internal functions
%pcap-dump-ftell: Internal functions
%pcap-dump-open: Internal functions
%pcap-fileno: Internal functions
%pcap-findalldevs: Internal functions
%pcap-freealldevs: Internal functions
%pcap-freecode: Internal functions
%pcap-get-selectable-fd: Internal functions
%pcap-geterr: Internal functions
%pcap-getnonblock: Internal functions
%pcap-inject: Internal functions
%pcap-is-swapped: Internal functions
%pcap-lib-version: Internal functions
%pcap-list-datalinks: Internal functions
%pcap-lookupdev: Internal functions
%pcap-lookupnet: Internal functions
%pcap-loop: Internal functions
%pcap-major-version: Internal functions
%pcap-minor-version: Internal functions
%pcap-next: Internal functions
%pcap-next-ex: Internal functions
%pcap-open-dead: Internal functions
%pcap-open-live: Internal functions
%pcap-open-offline: Internal functions
%pcap-perror: Internal functions
%pcap-sendpacket: Internal functions
%pcap-set-datalink: Internal functions
%pcap-setdirection: Internal functions
%pcap-setfilter: Internal functions
%pcap-setnonblock: Internal functions
%pcap-snapshot: Internal functions
%pcap-stats: Internal functions
%pcap-strerror: Internal functions

C
capture: Exported generic functions
capture: Exported generic functions
clear-error-buffer: Internal functions

D
dump: Exported generic functions
dump: Exported generic functions

E
error-buffer-to-lisp: Internal functions

F
find-all-devs: Exported functions
free-error-buffer: Internal functions
Function, %inet-ntop: Internal functions
Function, %link-ntoa: Internal functions
Function, %memcpy: Internal functions
Function, %pcap-breakloop: Internal functions
Function, %pcap-close: Internal functions
Function, %pcap-compile: Internal functions
Function, %pcap-datalink: Internal functions
Function, %pcap-datalink-name-to-val: Internal functions
Function, %pcap-datalink-val-to-description: Internal functions
Function, %pcap-datalink-val-to-name: Internal functions
Function, %pcap-dispatch: Internal functions
Function, %pcap-dump: Internal functions
Function, %pcap-dump-close: Internal functions
Function, %pcap-dump-flush: Internal functions
Function, %pcap-dump-ftell: Internal functions
Function, %pcap-dump-open: Internal functions
Function, %pcap-fileno: Internal functions
Function, %pcap-findalldevs: Internal functions
Function, %pcap-freealldevs: Internal functions
Function, %pcap-freecode: Internal functions
Function, %pcap-get-selectable-fd: Internal functions
Function, %pcap-geterr: Internal functions
Function, %pcap-getnonblock: Internal functions
Function, %pcap-inject: Internal functions
Function, %pcap-is-swapped: Internal functions
Function, %pcap-lib-version: Internal functions
Function, %pcap-list-datalinks: Internal functions
Function, %pcap-lookupdev: Internal functions
Function, %pcap-lookupnet: Internal functions
Function, %pcap-loop: Internal functions
Function, %pcap-major-version: Internal functions
Function, %pcap-minor-version: Internal functions
Function, %pcap-next: Internal functions
Function, %pcap-next-ex: Internal functions
Function, %pcap-open-dead: Internal functions
Function, %pcap-open-live: Internal functions
Function, %pcap-open-offline: Internal functions
Function, %pcap-perror: Internal functions
Function, %pcap-sendpacket: Internal functions
Function, %pcap-set-datalink: Internal functions
Function, %pcap-setdirection: Internal functions
Function, %pcap-setfilter: Internal functions
Function, %pcap-setnonblock: Internal functions
Function, %pcap-snapshot: Internal functions
Function, %pcap-stats: Internal functions
Function, %pcap-strerror: Internal functions
Function, clear-error-buffer: Internal functions
Function, error-buffer-to-lisp: Internal functions
Function, find-all-devs: Exported functions
Function, free-error-buffer: Internal functions
Function, make-error-buffer: Internal functions
Function, make-pcap-live: Exported functions
Function, make-pcap-reader: Exported functions
Function, make-pcap-writer: Exported functions

G
Generic Function, capture: Exported generic functions
Generic Function, dump: Exported generic functions
Generic Function, inject: Exported generic functions
Generic Function, pcap-live-alive-p: Exported generic functions
Generic Function, pcap-live-datalink: Exported generic functions
Generic Function, pcap-live-descriptor: Exported generic functions
Generic Function, pcap-live-interface: Exported generic functions
Generic Function, pcap-live-promisc-p: Exported generic functions
Generic Function, pcap-live-snaplen: Exported generic functions
Generic Function, pcap-live-timeout: Exported generic functions
Generic Function, pcap-reader-alive-p: Exported generic functions
Generic Function, pcap-reader-datalink: Exported generic functions
Generic Function, pcap-reader-file: Exported generic functions
Generic Function, pcap-reader-major: Exported generic functions
Generic Function, pcap-reader-minor: Exported generic functions
Generic Function, pcap-reader-snaplen: Exported generic functions
Generic Function, pcap-reader-swapped-p: Exported generic functions
Generic Function, pcap-writer-alive-p: Exported generic functions
Generic Function, pcap-writer-datalink: Exported generic functions
Generic Function, pcap-writer-file: Exported generic functions
Generic Function, pcap-writer-snaplen: Exported generic functions
Generic Function, plokami-error-text: Exported generic functions
Generic Function, set-filter: Exported generic functions
Generic Function, set-non-block: Exported generic functions
Generic Function, stats: Exported generic functions
Generic Function, stop: Exported generic functions

I
inject: Exported generic functions
inject: Exported generic functions

M
Macro, with-error-buffer: Internal macros
Macro, with-pcap-interface: Exported macros
Macro, with-pcap-reader: Exported macros
Macro, with-pcap-writer: Exported macros
make-error-buffer: Internal functions
make-pcap-live: Exported functions
make-pcap-reader: Exported functions
make-pcap-writer: Exported functions
Method, capture: Exported generic functions
Method, dump: Exported generic functions
Method, inject: Exported generic functions
Method, pcap-live-alive-p: Exported generic functions
Method, pcap-live-datalink: Exported generic functions
Method, pcap-live-descriptor: Exported generic functions
Method, pcap-live-interface: Exported generic functions
Method, pcap-live-promisc-p: Exported generic functions
Method, pcap-live-snaplen: Exported generic functions
Method, pcap-live-timeout: Exported generic functions
Method, pcap-reader-alive-p: Exported generic functions
Method, pcap-reader-datalink: Exported generic functions
Method, pcap-reader-file: Exported generic functions
Method, pcap-reader-major: Exported generic functions
Method, pcap-reader-minor: Exported generic functions
Method, pcap-reader-snaplen: Exported generic functions
Method, pcap-reader-swapped-p: Exported generic functions
Method, pcap-writer-alive-p: Exported generic functions
Method, pcap-writer-datalink: Exported generic functions
Method, pcap-writer-file: Exported generic functions
Method, pcap-writer-snaplen: Exported generic functions
Method, plokami-error-text: Exported generic functions
Method, set-filter: Exported generic functions
Method, set-filter: Exported generic functions
Method, set-non-block: Exported generic functions
Method, set-non-block: Exported generic functions
Method, stats: Exported generic functions
Method, stop: Exported generic functions
Method, stop: Exported generic functions
Method, stop: Exported generic functions

P
pcap-live-alive-p: Exported generic functions
pcap-live-alive-p: Exported generic functions
pcap-live-datalink: Exported generic functions
pcap-live-datalink: Exported generic functions
pcap-live-descriptor: Exported generic functions
pcap-live-descriptor: Exported generic functions
pcap-live-interface: Exported generic functions
pcap-live-interface: Exported generic functions
pcap-live-promisc-p: Exported generic functions
pcap-live-promisc-p: Exported generic functions
pcap-live-snaplen: Exported generic functions
pcap-live-snaplen: Exported generic functions
pcap-live-timeout: Exported generic functions
pcap-live-timeout: Exported generic functions
pcap-reader-alive-p: Exported generic functions
pcap-reader-alive-p: Exported generic functions
pcap-reader-datalink: Exported generic functions
pcap-reader-datalink: Exported generic functions
pcap-reader-file: Exported generic functions
pcap-reader-file: Exported generic functions
pcap-reader-major: Exported generic functions
pcap-reader-major: Exported generic functions
pcap-reader-minor: Exported generic functions
pcap-reader-minor: Exported generic functions
pcap-reader-snaplen: Exported generic functions
pcap-reader-snaplen: Exported generic functions
pcap-reader-swapped-p: Exported generic functions
pcap-reader-swapped-p: Exported generic functions
pcap-writer-alive-p: Exported generic functions
pcap-writer-alive-p: Exported generic functions
pcap-writer-datalink: Exported generic functions
pcap-writer-datalink: Exported generic functions
pcap-writer-file: Exported generic functions
pcap-writer-file: Exported generic functions
pcap-writer-snaplen: Exported generic functions
pcap-writer-snaplen: Exported generic functions
plokami-error-text: Exported generic functions
plokami-error-text: Exported generic functions

S
set-filter: Exported generic functions
set-filter: Exported generic functions
set-filter: Exported generic functions
set-non-block: Exported generic functions
set-non-block: Exported generic functions
set-non-block: Exported generic functions
stats: Exported generic functions
stats: Exported generic functions
stop: Exported generic functions
stop: Exported generic functions
stop: Exported generic functions
stop: Exported generic functions

W
with-error-buffer: Internal macros
with-pcap-interface: Exported macros
with-pcap-reader: Exported macros
with-pcap-writer: Exported macros

Jump to:   %  
C   D   E   F   G   I   M   P   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
B   C   D   F   H   I   L   M   N   P   S   T  
Index Entry  Section

*
*callbacks*: Internal special variables
*compile-mutex*: Internal special variables
*concurrent-pcap*: Internal special variables
*concurrent-pcap-mutex*: Internal special variables
*pcap-version*: Exported special variables
*supported-datalinks*: Internal special variables

+
+dlt_802_11+: Internal constants
+dlt_en10mb+: Internal constants
+dlt_null+: Internal constants
+dlt_ppp+: Internal constants
+dlt_ppp_bsdos1+: Internal constants
+dlt_ppp_bsdos2+: Internal constants
+dlt_ppp_ether+: Internal constants
+dlt_ppp_pppd+: Internal constants
+dlt_ppp_serial+: Internal constants
+dlt_slip+: Internal constants
+dlt_usb_linux+: Internal constants
+error-buffer-size+: Internal constants
+pcap_if_loopback+: Internal constants

B
buffer: Internal classes

C
Constant, +dlt_802_11+: Internal constants
Constant, +dlt_en10mb+: Internal constants
Constant, +dlt_null+: Internal constants
Constant, +dlt_ppp+: Internal constants
Constant, +dlt_ppp_bsdos1+: Internal constants
Constant, +dlt_ppp_bsdos2+: Internal constants
Constant, +dlt_ppp_ether+: Internal constants
Constant, +dlt_ppp_pppd+: Internal constants
Constant, +dlt_ppp_serial+: Internal constants
Constant, +dlt_slip+: Internal constants
Constant, +dlt_usb_linux+: Internal constants
Constant, +error-buffer-size+: Internal constants
Constant, +pcap_if_loopback+: Internal constants

D
datalink: Internal classes
datalink: Internal classes
datalink: Internal classes
datalink: Internal classes
descriptor: Internal classes
dumper: Internal classes

F
file: Internal classes
file: Internal classes

H
handler: Internal classes
hashkey: Internal classes
hashkey-pointer: Internal classes

I
interface: Internal classes

L
live: Internal classes
live: Internal classes
live: Internal classes
live: Internal classes

M
major: Internal classes
minor: Internal classes

N
non-block: Internal classes

P
pcap_t: Internal classes
promisc: Internal classes

S
Slot, buffer: Internal classes
Slot, datalink: Internal classes
Slot, datalink: Internal classes
Slot, datalink: Internal classes
Slot, datalink: Internal classes
Slot, descriptor: Internal classes
Slot, dumper: Internal classes
Slot, file: Internal classes
Slot, file: Internal classes
Slot, handler: Internal classes
Slot, hashkey: Internal classes
Slot, hashkey-pointer: Internal classes
Slot, interface: Internal classes
Slot, live: Internal classes
Slot, live: Internal classes
Slot, live: Internal classes
Slot, live: Internal classes
Slot, major: Internal classes
Slot, minor: Internal classes
Slot, non-block: Internal classes
Slot, pcap_t: Internal classes
Slot, promisc: Internal classes
Slot, snaplen: Internal classes
Slot, snaplen: Internal classes
Slot, snaplen: Internal classes
Slot, snaplen: Internal classes
Slot, swapped: Internal classes
Slot, text: Exported conditions
Slot, timeout: Internal classes
snaplen: Internal classes
snaplen: Internal classes
snaplen: Internal classes
snaplen: Internal classes
Special Variable, *callbacks*: Internal special variables
Special Variable, *compile-mutex*: Internal special variables
Special Variable, *concurrent-pcap*: Internal special variables
Special Variable, *concurrent-pcap-mutex*: Internal special variables
Special Variable, *pcap-version*: Exported special variables
Special Variable, *supported-datalinks*: Internal special variables
swapped: Internal classes

T
text: Exported conditions
timeout: Internal classes

Jump to:   *   +  
B   C   D   F   H   I   L   M   N   P   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   B   C   N   P   S   T  
Index Entry  Section

B
block-mode-error: Exported conditions
bpf_insn-tclass: Internal classes
bpf_program-tclass: Internal classes

C
capture-file-read-error: Exported conditions
capture-file-write-error: Exported conditions
Class, bpf_insn-tclass: Internal classes
Class, bpf_program-tclass: Internal classes
Class, pcap-live: Internal classes
Class, pcap-mixin: Internal classes
Class, pcap-process-mixin: Internal classes
Class, pcap-reader: Internal classes
Class, pcap-writer: Internal classes
Class, pcap_addr_t-tclass: Internal classes
Class, pcap_if_t-tclass: Internal classes
Class, pcap_pkthdr-tclass: Internal classes
Class, pcap_stat-tclass: Internal classes
Class, sockaddr-tclass: Internal classes
Class, timeval-tclass: Internal classes
Condition, block-mode-error: Exported conditions
Condition, capture-file-read-error: Exported conditions
Condition, capture-file-write-error: Exported conditions
Condition, network-interface-error: Exported conditions
Condition, packet-capture-error: Exported conditions
Condition, packet-filter-error: Exported conditions
Condition, packet-inject-error: Exported conditions
Condition, plokami-error: Exported conditions

N
network-interface-error: Exported conditions

P
Package, plokami: The plokami package
Package, plokami-asd: The plokami-asd package
packet-capture-error: Exported conditions
packet-filter-error: Exported conditions
packet-inject-error: Exported conditions
pcap-live: Internal classes
pcap-mixin: Internal classes
pcap-process-mixin: Internal classes
pcap-reader: Internal classes
pcap-writer: Internal classes
pcap_addr_t-tclass: Internal classes
pcap_if_t-tclass: Internal classes
pcap_pkthdr-tclass: Internal classes
pcap_stat-tclass: Internal classes
plokami: The plokami system
plokami: The plokami package
plokami-asd: The plokami-asd package
plokami-error: Exported conditions

S
sockaddr-tclass: Internal classes
System, plokami: The plokami system

T
timeval-tclass: Internal classes

Jump to:   B   C   N   P   S   T