Liking cljdoc? Tell your friends :D

paclo.core

Public, data-first facade for Paclo.

Main entry points:

  • packets for live/offline capture as lazy sequences
  • bpf for BPF DSL -> string conversion
  • write-pcap! for writing packet byte sequences
Public, data-first facade for Paclo.

Main entry points:
- `packets` for live/offline capture as lazy sequences
- `bpf` for BPF DSL -> string conversion
- `write-pcap!` for writing packet byte sequences
raw docstring

-mainclj

(-main & _)

Repository-local convenience entrypoint. Paclo is a library; use example commands for executable workflows.

Repository-local convenience entrypoint.
Paclo is a library; use example commands for executable workflows.
sourceraw docstring

bpfclj

(bpf form)

Convert a BPF DSL value into a libpcap filter string.

Accepted input:

  • nil -> nil
  • string -> returned as-is
  • keyword protocol (:udp, :tcp, :icmp, :icmp6, :arp, :ip, :ipv4, :ip6, :ipv6)
  • vector DSL form (:and, :or, :not, :proto, host/net/port forms)

Throws ex-info for unsupported forms/operators/keywords.

Convert a BPF DSL value into a libpcap filter string.

Accepted input:
- `nil` -> `nil`
- string -> returned as-is
- keyword protocol (`:udp`, `:tcp`, `:icmp`, `:icmp6`, `:arp`, `:ip`, `:ipv4`, `:ip6`, `:ipv6`)
- vector DSL form (`:and`, `:or`, `:not`, `:proto`, host/net/port forms)

Throws `ex-info` for unsupported forms/operators/keywords.
sourceraw docstring

list-devicesclj

(list-devices)

Return available capture devices as {:name <string> :desc <string|nil>} maps.

Return available capture devices as
`{:name <string> :desc <string|nil>}` maps.
sourceraw docstring

packetsclj

(packets {:keys [filter decode? xform] :as opts})

Return packets as a lazy sequence.

Key opts:

  • source: :path (offline) or :device (live)
  • :filter: BPF string, protocol keyword, or BPF DSL vector
  • :decode?: when true, add :decoded or :decode-error to each packet map
  • :xform: transducer applied to output stream via sequence

Throws ex-info when :filter has an unsupported type.

Return packets as a lazy sequence.

Key opts:
- source: `:path` (offline) or `:device` (live)
- `:filter`: BPF string, protocol keyword, or BPF DSL vector
- `:decode?`: when true, add `:decoded` or `:decode-error` to each packet map
- `:xform`: transducer applied to output stream via `sequence`

Throws `ex-info` when `:filter` has an unsupported type.
sourceraw docstring

write-pcap!clj

(write-pcap! packets out)

Write packet bytes to a PCAP file.

packets can contain:

  • byte-array
  • map with :bytes and optional :sec/:usec timestamps
Write packet bytes to a PCAP file.

`packets` can contain:
- `byte-array`
- map with `:bytes` and optional `:sec`/`:usec` timestamps
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close