ExPcap

This module represents a pcap file that has been parsed.

Source

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

from_file(filename)

Specs:

Reads a file, parses the pcap contents and returns a list of the parsed packets.

Source
parse_packet(packet_data, global_header)

Specs:

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.

Source
parse_packet(parser, payload, acc)

Specs:

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.

Source
read_packet(f, global_header)

Specs:

Reads a packet from the file and returns it or returns end of file if there is no data left to be read.

Source
read_packet(f, global_header, packet_header)

Specs:

Reads a packet from a file. This packet is then parsed and the result is returned.

Source
read_packets(f, global_header, acc \\ [])

Specs:

Reads all the packets from a file, parses them and returns a list of the parsed packets.

Source
read_pcap(f)

Specs:

Reads a pcap file and returns the parsed results.

Source