module Pdu:sig
..end
Each raw packet can be seen either as a bitstring
or as a pile of layers (for
instance, DNS over UDP over IP over Ethernet). This Module will convert between these
two representations, without loss of information.
Typically you want to unpack then update, then pack back to bitstring
.
type
layer =
| |
Raw of |
(* |
the fallback when the actual protocol is not known
| *) |
| |
Dhcp of |
|||
| |
Eth of |
|||
| |
Arp of |
|||
| |
Ip of |
|||
| |
Ip6 of |
|||
| |
Udp of |
|||
| |
Tcp of |
|||
| |
Dns of |
|||
| |
Sll of |
|||
| |
Vlan of |
|||
| |
Icmp of |
|||
| |
Pcap of |
(* |
A Pdu.t is a list of
Packet.Pdu.layer s, with the outer layer first for
a more natural presentation when printed. | *) |
typet =
layer list
val pack : layer list -> Pcap.Pdu.t
val unpack : Pcap.Pdu.t -> layer list