package tcpip

  1. Overview
  2. Docs
OCaml TCP/IP networking stack, used in MirageOS

Install

dune-project
 Dependency

Authors

Maintainers

Sources

tcpip-9.0.1.tbz
sha256=fac07ce986811cf5e3d71373d92b631cc30fbef548d6da21b0917212dcf90b03
sha512=01de13f560d58b1524c39619e4e4cb6ebbf069155eb43d0f264aa12b00e0cc8c39792719e3ca46585dd596b692b8e1e3f8c132f005ed9e2d77747c0c158bf4d9

doc/tcpip.icmpv4-socket/Icmpv4_socket/index.html

Module Icmpv4_socketSource

include Icmpv4.S
Sourcetype t

The type representing the internal state of the ICMP layer.

Sourceval disconnect : t -> unit Lwt.t

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

Sourcetype ipaddr = Ipaddr.V4.t

The type for IP addresses.

Sourcetype error

The type for ICMP errors.

Sourceval pp_error : error Fmt.t

pp_error is the pretty-printer for errors.

Sourceval input : t -> src:ipaddr -> dst:ipaddr -> Cstruct.t -> unit Lwt.t

input t src dst buffer reacts to the ICMP message in buffer.

Sourceval write : t -> ?src:ipaddr -> dst:ipaddr -> ?ttl:int -> Cstruct.t -> (unit, error) result Lwt.t

write t ~src ~dst ~ttl buffer sends the ICMP message in buffer to dst over IP. Passes the time-to-live (ttl) to the IP stack if given.

Sourceval connect : unit -> t Lwt.t
Sourceval listen : t -> ipaddr -> (Cstruct.t -> unit Lwt.t) -> unit Lwt.t

listen t addr fn attempts to create an unprivileged listener on IP address addr.

When a packet is received, the callback fn will be called in a fresh background thread. The callback will be provided a buffer containing an IP datagram with an ICMP payload inside.

The thread returned by listen blocks until the stack is disconnected.

OCaml

Innovation. Community. Security.