package mnet

  1. Overview
  2. Docs
An implementation of TCP (Transmission Control Protocol) in OCaml for Miou & Solo5

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mnet-0.0.5.tbz
sha256=ebc621ad01b33a7f96fd049e71bbd06ef95c1a6b36d4072fd15fd35c1a93dc17
sha512=8d47f9434bc6472703f55f819bea21a7deb12095d925f0f8fbb8b96b799473b62a8b302966f579792354aa256b9109dcc16851f5cf951002d35a7d70bca59135

doc/mnet.ethernet/Ethernet/Packet/index.html

Module Ethernet.PacketSource

Sourcetype protocol =
  1. | ARPv4
  2. | IPv4
  3. | IPv6
    (*

    The Ethernet protocol field (EtherType).

    *)
Sourcetype t = {
  1. src : Macaddr.t;
  2. dst : Macaddr.t;
  3. protocol : protocol option;
}

A decoded Ethernet header. protocol is None if the EtherType is not recognized.

Sourceval decode : Bstr.t -> len:int -> (t * Slice_bstr.t, [> `Invalid_ethernet_packet ]) result

decode buf ~len decodes an Ethernet frame from the first len bytes of buf. Returns the header and a slice pointing to the payload (after the 14-byte Ethernet header).

Sourceval encode_into : t -> ?off:int -> Bstr.t -> unit

encode_into header ?off buf writes the Ethernet header into buf at offset off (defaults to 0). The caller must ensure buf has at least 14 bytes available from off.