ExPcap
This module represents a pcap file that has been parsed.
Summary↑
from_file(filename) | Reads a file, parses the pcap contents and returns a list of the parsed packets |
parse_packet(packet_data, global_header) | Parses the content of the packet according to the parser for this packet type. Then it recurses until the packet has been parsed completely. It may return something like an ethernet packet that contains an IPv4 packet that contains a UDP packet that contains a DNS packet |
parse_packet(parser, payload, acc) | Parses the content of the packet according to the parser for this packet type. Then it recurses until the packet has been parsed completely. It may return something like an ethernet packet that contains an IPv4 packet that contains a UDP packet that contains a DNS packet |
read_packet(f, global_header) | Reads a packet from the file and returns it or returns end of file if there is no data left to be read |
read_packet(f, global_header, packet_header) | Reads a packet from a file. This packet is then parsed and the result is returned |
read_packets(f, global_header, acc \\ []) | Reads all the packets from a file, parses them and returns a list of the parsed packets |
read_pcap(f) | Reads a pcap file and returns the parsed results |
Types ↑
t :: %ExPcap{global_header: ExPcap.GlobalHeader.t, packets: [ExPcap.Packet.t]}
Functions
Specs:
Reads a file, parses the pcap contents and returns a list of the parsed packets.
Specs:
- parse_packet(ExPcap.PacketData.t, ExPcap.GlobalHeader.t) :: [ExPcap.Packet.t]
Parses the content of the packet according to the parser for this packet type. Then it recurses until the packet has been parsed completely. It may return something like an ethernet packet that contains an IPv4 packet that contains a UDP packet that contains a DNS packet.
Specs:
- parse_packet(ExPcap.Parser.t, binary, [ExPcap.Packet.t]) :: [ExPcap.Packet.t]
- parse_packet(nil, binary, [ExPcap.Packet.t]) :: [ExPcap.Packet.t]
Parses the content of the packet according to the parser for this packet type. Then it recurses until the packet has been parsed completely. It may return something like an ethernet packet that contains an IPv4 packet that contains a UDP packet that contains a DNS packet.
Specs:
- read_packet(String.t, ExPcap.GlobalHeader.t) :: :eof | ExPcap.Packet.t
Reads a packet from the file and returns it or returns end of file if there is no data left to be read.
Specs:
- read_packet(String.t, ExPcap.GlobalHeader.t, ExPcap.PacketHeader.t) :: ExPcap.Packet.t
Reads a packet from a file. This packet is then parsed and the result is returned.
Specs:
- read_packets(String.t, ExPcap.GlobalHeader.t, list) :: [ExPcap.Packet.t]
Reads all the packets from a file, parses them and returns a list of the parsed packets.
Specs:
Reads a pcap file and returns the parsed results.