clj-net-pcap is a wrapper/adapter/facade (whatever) around jNetPcap that enables and ease...
clj-net-pcap.CljNetPcapJavaAdapter | Adapter class to enable usage of clj-net-pcap from Java. |
clj-net-pcap.byte-array-extraction-dsl | A simple DSL for extracting data from packets that are represented as byte arrays. |
clj-net-pcap.dsl.transformation | Transformation functions for the simple DSL for extracting data from packets that are represented as... |
clj-net-pcap.main | Main class and method for launching a simple clj-net-pcap based sniffer
that prints some i... |
clj-net-pcap.native | Functions etc. for extracting, loading etc. native libraries from the jar file. |
clj-net-pcap.packet-gen | The packet-gen namespace contains functionality for generating and sending packets. |
clj-net-pcap.packet-offsets | Common offsets of header fields etc. |
clj-net-pcap.pcap | Functions for handling functionality related to org.jnetpcap.Pcap
such as listing network ... |
clj-net-pcap.pcap-data | Convenience functions for processing pcap data like packets and headers. |
clj-net-pcap.self-adaptive-dsl-adjustment | A simple proof of concept for adjusting DSL statements with self-adaptivity. |
clj-net-pcap.sniffer | Convenience functions for easing the implementation of a working
sniffer. |
Index Page | |
Alphabetic Var Index |
clj-net-pcap is a wrapper/adapter/facade (whatever) around jNetPcap that enables and eases packet capturing with Clojure. The core namespace contains the external API. For most use-cases the functionality provided in core should be sufficient.
Arglists: ========= (->BufferRecord s us cl wl buf) Docstring: ========== Positional factory function for class clj_net_pcap.core.BufferRecord.
Arglists: ========= (add-filter cljnetpcap filter-expr) Docstring: ========== Add filter to a running pcap instance.
Arglists: ========= (create-and-start-online-cljnetpcap forwarder-fn) (create-and-start-online-cljnetpcap forwarder-fn device) (create-and-start-online-cljnetpcap forwarder-fn device filter-expr) Docstring: ========== Convenience function for performing live online capturing. forwarder-fn will be called for each captured packet. Capturing can be influenced via the optional device and filter-expression arguments. By default the 'any' device is used for capturing with no filter being applied. Please note that the returned handle should be stored as it is needed for stopping the capture.
Arglists: ========= (create-buffer-record buf ph) Docstring: ========== Create a BufferRecord. The BufferRecord contains the values of the PcapHeader and a directly allocated deep-copy of the ByteBuffer.
Arglists: ========= (create-packet-processing-handler out-queue out-queued-counter out-drop-counter force-put running forward-exceptions) Docstring: ========== Create handler for processing packets. Processing packets includes scanning (decoding) them.
Arglists: ========= (create-raw-bulk-handler out-queue out-queued-counter out-drop-counter bulk-size force-put running use-intermediate-buffer) Docstring: ========== Create handler for raw bulk data.
Arglists: ========= (create-raw-handler out-queue out-queued-counter out-drop-counter force-put running) Docstring: ========== Create handler for raw data of individual packets.
Arglists: ========= (deep-copy buf) (deep-copy buf ph) Docstring: ========== Creates a deep-copy of the supplied data. We differentiate two cases: When only a ByteBuffer is supplied the content is copied to a directly allocated ByteBuffer. This copy is primarily intended for being directly peered with a PcapPacket instance. When a ByteBuffer and a PcapHeader is supplied the field values of the PcapHeader are prepended to the deep copy of the ByteBuffer. This is intended for being transferred as byte array.
Arglists: ========= (enqueue-data queue op force-put queued-cntr dropped-cntr) Docstring: ========== No docs attached.
Arglists: ========= (enqueue-data-put queue op force-put queued-cntr dropped-cntr) Docstring: ========== No docs attached.
Arglists: ========= (extract-beans-from-pcap-file file-name) Docstring: ========== Convenience function to extract the data from a pcap file in bean format. Please note that all data will be stored in memory. So this is not suited for large amounts of data. Returns a vector that contains the extracted beans.
Arglists: ========= (extract-byte-arrays-from-pcap-file file-name) Docstring: ========== Convenience function to extract the raw data from a pcap file as byte arrays. Please note that all data will be stored in memory. So this is not suited for large amounts of data. Returns a vector that contains the extracted raw-data.
Arglists: ========= (extract-data-from-pcap-file file-name format-fn) Docstring: ========== Function to extract the data from a pcap file. The data will be formatted with format-fn. Please note that all data will be stored in memory. So this is not suited for large amounts of data. Returns a vector that contains the extracted maps. See also: extract-nested-maps-from-pcap-file extract-maps-from-pcap-file extract-beans-from-pcap-file
Arglists: ========= (extract-maps-from-pcap-file file-name) Docstring: ========== Convenience function to extract the data from a pcap file in flat map format. Please note that all data will be stored in memory. So this is not suited for large amounts of data. Returns a vector that contains the extracted maps.
Arglists: ========= (extract-nested-maps-from-pcap-file file-name) Docstring: ========== Convenience function to extract the data from a pcap file in nested map format. Please note that all data will be stored in memory. So this is not suited for large amounts of data. Returns a vector that contains the extracted maps.
Arglists: ========= (get-filters cljnetpcap) Docstring: ========== Returns the vector containing all currently applied filter sub-expressions.
Arglists: ========= (get-stats cljnetpcap) Docstring: ========== Given a handle as returned by, e.g., create-and-start-online-cljnetpcap or process-pcap-file, this function emits a map with statistical data about the capture process.
Arglists: ========= (map->BufferRecord m__7972__auto__) Docstring: ========== Factory function for class clj_net_pcap.core.BufferRecord, taking a map of keywords to field values.
Arglists: ========= (peer-packet bufrec) Docstring: ========== Create a new PcapPacket instance and fill/peer it with the data from the supplied BufferRecord.
Arglists: ========= (process-pcap-file file-name handler-fn) (process-pcap-file file-name handler-fn _) Docstring: ========== Convenience function to process data stored in pcap files. Arguments are the file-name of the pcap file, the handler-fn that is executed for each read packet, and optional user data. handler-fn takes two arguments, the first is the org.jnetpcap.packet.PcapPacket instance, the second is the user data. By default nil is used as user data.
Arglists: ========= (remove-all-filters cljnetpcap) Docstring: ========== Removes all filter expressions.
Arglists: ========= (remove-filter cljnetpcap filter-expr) Docstring: ========== Remove the matching filter.
Arglists: ========= (remove-last-filter cljnetpcap) Docstring: ========== Remove the last filter expression.
Arglists: ========= (replace-filter cljnetpcap old-filter new-filter) Docstring: ========== Replace old-filter expression with new-filter expression.
Arglists: ========= (scan-packet pkt) Docstring: ========== Scan the supplied packet and return it.
Arglists: ========= (send-bytes-packet pcap pkt-ba) (send-bytes-packet pcap pkt-ba rep) (send-bytes-packet pcap pkt-ba rep d) Docstring: ========== Send the packet as given in the byte array pkt-ba packets via the Pcap instance pcap. Optionally a repetition count rep as well as a delay d can be given.
Arglists: ========= (set-up-and-start-cljnetpcap pcap forwarder-fn filter-expr force-put) Docstring: ========== Takes a pcap instance, sets up the capture pipe line, and starts the capturing and processing. This is not intended to be used directly. It is recommended to use: create-and-start-online-cljnetpcap or process-pcap-file
Arglists: ========= (stop-cljnetpcap cljnetpcap) Docstring: ========== Stops a running capture. Argument is the handle as returned, e.g., by create-and-start-online-cljnetpcap or process-pcap-file.