module Pdu: sig
.. end
Packets harvested with libpcap will come with additional informations such
as caplen, timestamp etc.
This special PDU module make a pseudo-header out of those informations, so
that we it's kept while we edit the packets and can be reused for saving
afterward.
type
t = {
|
source_name : string ; |
|
caplen : int ; |
|
dlt : Pcap.Dlt.t ; |
|
ts : Clock.Time.t ; |
|
payload : Tools.Payload.t ; |
}
These informations are present as the first layer of every packet
read from a pcap file.
val make : string ->
?caplen:int ->
?dlt:Pcap.Dlt.t -> Clock.Time.t -> Tools.Payload.outer_t -> t
val pack : t -> Bitstring.bitstring
Return the
bitstring
ready to be written into a pcap file (see
Pcap.save
).
val save : ?caplen:int -> ?dlt:Pcap.Dlt.t -> string -> t -> unit
save "file.pcap"
returns a function that will save passed pdus in "file.pcap"
.
caplen
: can be used to cap saved packet to a given number of bytes
dlt
: can be used to change the file's DLT (you probably do not want to do that)