Clojure らしい薄いファサード。
Clojure らしい薄いファサード。 - packets: ライブ/オフラインどちらも lazy seq を返す(:decode? でparse付与、:xform で後段変換) - bpf: 簡易DSL → BPF文字列 - write-pcap!: bytesシーケンスを書き出す(テスト/再現用)
(-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.
(bpf form)BPFフィルタを表す簡易DSLを文字列へ。
サポート(追加含む):
文字列が渡された場合はそのまま返す。
BPFフィルタを表す簡易DSLを文字列へ。
サポート(追加含む):
- 論理: :and / :or / :not
- プロトコル: :udp :tcp :icmp :icmp6 :arp に加え、:ip / :ipv4 / :ip6 / :ipv6
例) (bpf :ipv6) ;;=> "ip6"
(bpf [:proto :ip]) ;;=> "ip"
- アドレス系: :host / :src-host / :dst-host / :net / :src-net / :dst-net
例) (bpf [:src-net "10.0.0.0/8"]) ;;=> "src net 10.0.0.0/8"
- ポート系: :port / :src-port / :dst-port
追加: :port-range / :src-port-range / :dst-port-range
例) (bpf [:port-range 1000 2000]) ;;=> "portrange 1000-2000"
(bpf [:src-port-range 53 60]) ;;=> "src portrange 53-60"
文字列が渡された場合はそのまま返す。(list-devices)利用可能デバイスの簡易一覧(pcap/list-devices のファサード)。 返り値: [{:name "en0" :desc "Wi-Fi"} ...]
利用可能デバイスの簡易一覧(pcap/list-devices のファサード)。
返り値: [{:name "en0" :desc "Wi-Fi"} ...](packets {:keys [filter decode? xform] :as opts})パケットを lazy seq で返す高レベルAPI。 opts:
パケットを lazy seq で返す高レベルAPI。
opts:
- ライブ: {:device "en0" :filter <string|DSL> :timeout-ms 10 ...}
- オフライン: {:path "trace.pcap" :filter <string|DSL>}
- 共通:
:decode? true|false
true なら各要素に :decoded を付与。失敗時は :decode-error を付与。
:xform <transducer>
出力ストリームに適用する transducer。
例: (comp (filter pred) (map f))
返り値は遅延シーケンス。take/into などで消費してください。(write-pcap! packets out)bytes のシーケンスを PCAP ファイルへ書き出す(テスト/再現用)。 エントリは (byte-array ..) か {:bytes <ba> :sec <long> :usec <long>}。 例: (write-pcap! [ba1 {:bytes ba2 :sec 1700000000 :usec 12345}] "out.pcap")
bytes のシーケンスを PCAP ファイルへ書き出す(テスト/再現用)。
エントリは (byte-array ..) か {:bytes <ba> :sec <long> :usec <long>}。
例: (write-pcap! [ba1 {:bytes ba2 :sec 1700000000 :usec 12345}] "out.pcap")cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |