package mirage-net
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=668effd187b81a0ab32450870c15dbb89ff911397ff338a8951807e250e194ce
sha512=52064dc704ebd0d305fd234b6d89fc313d5a80016d8875ef93212a1962ad8b1f332f7b0338244afbb2d2f207a28d476e7d7639be9dc607d95145afee7fccc483
doc/mirage-net/Mirage_net/module-type-S/index.html
Module type Mirage_net.SSource
A network interface that serves Ethernet frames.
The type representing the internal state of the network device.
Disconnect from the network device. While this might take some time to complete, it can never result in an error.
write net ~size fill allocates a buffer of length size, where size must not exceed the interface maximum packet size (mtu plus Ethernet header). The allocated buffer is zeroed and passed to the fill function which returns the payload length, which may not exceed the length of the buffer. When fill returns, a sub buffer is put on the wire: the allocated buffer from index 0 to the returned length.
listen ~header_size net fn waits for a packet with size at most header_size + mtu on the network device. When a packet is received, an asynchronous task is created in which fn packet is called. The ownership of packet is transferred to fn. The function can be stopped by calling disconnect.
mtu net is the Maximum Transmission Unit of net. This excludes the Ethernet header.
Obtain the most recent snapshot of the interface statistics.