package tcpip

  1. Overview
  2. Docs

Parameters

module Clock : V1.CLOCK
module Time : V1_LWT.TIME

Signature

include V1_LWT.ARP
include V1.DEVICE with type 'a io = 'a Lwt.t
type 'a io = 'a Lwt.t

The type for potentially blocking I/O operation

type t

The type representing the internal state of the device

type error

The type for errors signalled by the device

type id

This type is no longer used and will be removed once other * modules stop using it in their type signatures.

val disconnect : t -> unit io

Disconnect from the device. While this might take some time to complete, it can never result in an error.

type ipaddr = Ipaddr.V4.t
type buffer = Cstruct.t
type macaddr = Macaddr.t
type repr
type result = [
  1. | `Ok of macaddr
  2. | `Timeout
]

Type of the result of an ARP query. One of `Ok macaddr (for successful queries) or `Timeout (for attempted queries that received no response).

val to_repr : t -> repr io

Prettyprint cache contents

val pp : Format.formatter -> repr -> unit
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 -> 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.

type ethif = Ethif.t
val connect : ethif -> [> `Ok of t | `Error of error ] Lwt.t

connect creates a value of type t.

OCaml

Innovation. Community. Security.