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.2.tbz
sha256=92b1cfec8487423090ed7abedee824ca20db86f1a7af7e308b4118bc0f774e03
sha512=ce7685c363581121c7d8ae0c33d7dff30ee2dd9dcd29d56f451ac3261b84a91d35a2fa65b31f1f321ddc4b5984e21840459c63614e81ee814f47ac24376bf018

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.