package mirage-protocols

  1. Overview
  2. Docs
include Mirage_device.S
type +'a io
type t
val disconnect : t -> unit io
type ipaddr
type buffer
type macaddr
type repr
type error = private [>
  1. | Arp.error
]

The type for ARP errors.

val pp_error : error Fmt.t

pp_error is the pretty-printer for errors.

val to_repr : t -> repr io

Prettyprint cache contents

val pp : repr Fmt.t
val get_ips : t -> ipaddr list

get_ips arp gets the bound IP address list in the arp value.

val set_ips : t -> ipaddr list -> unit io

set_ips arp sets the bound IP address list, which will transmit a GARP packet also.

val remove_ip : t -> ipaddr -> unit io

remove_ip arp ip removes ip to the bound IP address list in the arp value, which will transmit a GARP packet for any remaining IPs in the bound IP address list after the removal.

val add_ip : t -> ipaddr -> unit io

add_ip arp ip adds ip to the bound IP address list in the arp value, which will transmit a GARP packet also.

val query : t -> ipaddr -> (macaddr, error) Pervasives.result io

query arp ip queries the cache in arp for an ARP entry corresponding to ip, which may result in the sender sleeping waiting for a response.

val input : t -> buffer -> unit io

input arp frame will handle an ARP frame. If it is a response, it will update its cache, otherwise will try to satisfy the request.

OCaml

Innovation. Community. Security.