package arp
Address Resolution Protocol purely in OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
arp-4.1.0.tbz
sha256=02f8f1bde52049104d85942f0a9d686be25f117488ae89c40a4e27368b3c865d
sha512=9a602b22cc25becf8cc28248356931ffe4b37dc403881745ea73103165b0b8dab85007ab9e7bc024b59be92fc93165a996ca71a01d132aa79eb7c5b2a1839b90
doc/arp/Arp_packet/index.html
Module Arp_packetSource
Conversion between wire and high-level data
The high-level datatype can be decoded and encoded to bytes to be sent on the wire. ARP specifies hardware and protocol addresses, but this implementation picks Ethernet and IPv4 statically. While decoding can result in an error, encoding can not.
Source
type 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.
size is the size of an ARP frame.
pp ppf t prints the frame t on ppf.
equal a b returns true if frames a and b are equal, false otherwise.
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
pp_error ppf err prints the error err on ppf.
Decoding
decode 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.