Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 571 Bytes

README.md

File metadata and controls

25 lines (17 loc) · 571 Bytes

Pcapex

Build status

Simple library in pure Elixir for encoding and decoding pcap file data

Usage

Add pcapex to your list of dependencies in mix.exs:

def deps do
  [{:pcapex, "~> 0.0.6"}]
end
alias Pcapex.Dump
alias Pcapex.Packet

packet = Packet.from_hex(packet_data, timestamp_usec: DateTime.utc_now() |> DateTime.to_unix(:microsecond))
binary_dump_data = Dump.new([packet]) |> Dump.to_binary()

%Dump{} = Dump.from_binary(binary_dump_data)