val op_to_int : op -> intval int_to_op : int -> op optiontype t = {operation : op; |
source_mac : Macaddr.t; |
source_ip : Ipaddr.V4.t; |
target_mac : Macaddr.t; |
target_ip : Ipaddr.V4.t; |
}The high-level ARP frame consisting of the two address pairs and an operation.
val pp : Stdlib.Format.formatter -> t -> unitpp ppf t prints the frame t on ppf.
The type of possible errors during decoding
Too_shortif the provided buffer is not long enoughUnusableif the protocol or hardware address type is not IPv4 and EthernetUnknown_operationif it is neither a request nor a reply
val pp_error : Stdlib.Format.formatter -> error -> unitpp_error ppf err prints the error err on ppf.
Decoding
val decode : Cstruct.t -> (t, error) Stdlib.resultdecode buf attempts to decode the buffer into an ARP frame t.
Encoding
encode t is a buf, a freshly allocated buffer, which contains the encoded ARP frame t.