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.1.tbz
sha256=c3151b243150c7b7412bf27b08107bed0e132f0a271d5f5b34bc0fdffed8ec3e
sha512=4a70d77ed42519a547f7b13e76ccfa05192514ca84e9dc9dcb97a5d141a8cc4551a669017a48290d70f01790a83fbeba53950a2d5f975e8e51e7daf3017d6b5e

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.