PcapFileEx.DecoderRegistry (pcap_file_ex v0.1.5)
View SourceRegistry of application-layer payload decoders.
Each decoder entry supplies:
:protocol— atom identifying the protocol (e.g.,:http):matcher—fn layers, payload -> boolean endreturning true when the decoder applies:decoder—fn payload -> {:ok, term} | {:error, term}returning structured data
Matchers receive the list of protocol layers returned by :pkt.decode/2 and the raw payload
binary from the previous layer. Decoders should return {:ok, value} on success; any other
return is wrapped in {:ok, value} automatically.
Summary
Functions
Lists the registered decoder entries in registration order.
Registers a new decoder entry.
Unregisters a decoder by protocol atom. No-op if not present.
Types
Functions
@spec list() :: [entry()]
Lists the registered decoder entries in registration order.
@spec register(entry()) :: :ok
Registers a new decoder entry.
If a decoder for entry.protocol already exists it is replaced.
@spec unregister(atom()) :: :ok
Unregisters a decoder by protocol atom. No-op if not present.