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.4.tbz
sha256=154c3b18bbb019535a4f37d1fefa3c6131b636e53316a63b395d030b186f2a59
sha512=894d12ff3140b294de1129f76893b295e73093101edec137ba2b2106059081f94385e3e3420c48cde14df6aefbef333bec12f5772c1b85c7ecc73dcde9e5bb8c

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.