Namespace clj-net-pcap.native

Functions etc. for extracting, loading etc. native libraries from the jar file.

Other Namespaces

Show/Hide
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.core
clj-net-pcap is a wrapper/adapter/facade (whatever) around jNetPcap that enables and ease...
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.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

Public Vars

Usage Documentation

Show/Hide
Functions etc. for extracting, loading etc. native libraries from the jar file.
Back to top

Details of Public Vars

Dynamic Var: *lib-dir*

  No docs attached.
Back to top View Source

Function: copy-resource-to-file

Arglists:
=========

  (copy-resource-to-file source target)

Docstring:
==========

  Copy from Jar to file.
Back to top View Source

Function: extract-and-load-native-libs

Arglists:
=========

  (extract-and-load-native-libs)

Docstring:
==========

  Convenience function for extracting and loading the native libraries.
   Starting with jnetpcap 1.5.x, this is deprecated in favour of extract-and-reference-native-libs.
Back to top View Source

Function: extract-and-reference-native-libs

Arglists:
=========

  (extract-and-reference-native-libs)

Docstring:
==========

  Convenience function for extracting and referencing the native libraries via System Properties: "clj-net-pcap.lib.[jnetpcap, jnetpcap-pcap100]".
   This is needed with the new version of jnetpcap as it uses an updated mechanism for loading the native libraries.
   clj-net-pcap ships a modified version of a part of this jnetpcap mechanism that uses these clj-net-pcap.lib.* properties in JNILibrary/loadLibrary.
Back to top View Source

Function: extract-native-lib

Arglists:
=========

  (extract-native-lib l)

Docstring:
==========

  Extract a single native library l.
Back to top View Source

Function: extract-native-libs

Arglists:
=========

  (extract-native-libs)

Docstring:
==========

  Extract the native libraries.
Back to top View Source

Function: load-native-libs

Arglists:
=========

  (load-native-libs)

Docstring:
==========

  Load the native libraries.
   This uses a little hack:
   The LibLoader Java class is used for actually loading the native libs.
   Starting with jnetpcap 1.5.x, this is deprecated in favour of extract-and-reference-native-libs.
Back to top View Source

Function: mk-native-lib-dir

Arglists:
=========

  (mk-native-lib-dir)

Docstring:
==========

  Create the dir for extracting the native libraries.
Back to top View Source

Function: native-lib-dir

Arglists:
=========

  (native-lib-dir)

Docstring:
==========

  Returns the directory to which the native libraries will be extracted.
   This may vary depending on the operating system.
Back to top View Source

Function: pcap-jar-path

Arglists:
=========

  (pcap-jar-path p)

Docstring:
==========

  Get the path of the jnetpcap libraries inside the clj-net-pcap jar.
Back to top View Source

Function: pcap-lib-name

Arglists:
=========

  (pcap-lib-name p)

Docstring:
==========

  Get the pcap lib names depending on the OS.
Back to top View Source

Function: pcap-lib-path

Arglists:
=========

  (pcap-lib-path p)

Docstring:
==========

  Path for an actual library file, given the file name.
Back to top View Source

Var: pcap080

  No docs attached.
Back to top View Source

Var: pcap100

  No docs attached.
Back to top View Source

Function: register-shutdown-hook

Arglists:
=========

  (register-shutdown-hook)

Docstring:
==========

  Register a JVM shutdown hook to delete native libs temp files.
   This function aims on registering the shutdown hook once and thus tries to remove a possibly
   previously registered hook before registering the new one.
Back to top View Source

Function: remove-native-libs

Arglists:
=========

  (remove-native-libs)

Docstring:
==========

  Clean up native libs.
Back to top View Source

Function: rm-native-lib-dir

Arglists:
=========

  (rm-native-lib-dir)

Docstring:
==========

  Remove the native library temp directory.
Back to top View Source

Var: shutdown-hook-thread

  No docs attached.
Back to top View Source