miros / pcapex

Library for encoding/decoding pcap files in pure Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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) 

About

Library for encoding/decoding pcap files in pure Elixir

License:Apache License 2.0


Languages

Language:Elixir 100.0%