From fb2a4fbefe6cf917787ff070cf5bbdecab1fb1e1 Mon Sep 17 00:00:00 2001
From: Dave Bakker
[`udp::(set-)unicast-hop-limit`](udp) |
| IPV6_UNICAST_HOPS | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | [`tcp::(set-)unicast-hop-limit`](tcp)
[`udp::(set-)unicast-hop-limit`](udp) |
-| IP_RECVTTL | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | |
-| IPV6_RECVHOPLIMIT | ❔ | ❌ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | |
+| IP_RECVTTL | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | See [`udp::receive`](udp) |
+| IPV6_RECVHOPLIMIT | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | See [`udp::receive`](udp)
IPV6_HOPLIMIT on Windows. |
| IP_TOS | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | |
| IPV6_TCLASS | ❔ | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | |
-| IP_RECVTOS | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | |
-| IPV6_RECVTCLASS | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | |
-| IP_RECVPKTINFO | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | IP_PKTINFO on Linux & Windows, IP_RECVDSTADDR+IP_RECVIF on MacOS & FreeBSD. |
-| IPV6_RECVPKTINFO | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | IPV6_PKTINFO on Windows. |
+| IP_RECVTOS | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | See [`udp::receive`](udp) |
+| IPV6_RECVTCLASS | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | See [`udp::receive`](udp) |
+| IP_RECVPKTINFO | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | See [`udp::receive`](udp)
IP_PKTINFO on Linux & Windows, IP_RECVDSTADDR+IP_RECVIF on MacOS & FreeBSD. |
+| IPV6_RECVPKTINFO | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | See [`udp::receive`](udp)
IPV6_PKTINFO on Windows. |
| IP_DONTFRAG | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | IP_DONTFRAGMENT on Windows, implementable using IP_MTU_DISCOVER on Linux. |
| IPV6_DONTFRAG | ❔ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ❌ | |
| IP_MTU_DISCOVER | ❔ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | |
diff --git a/example-world.md b/example-world.md
index 8c74520..f82ac76 100644
--- a/example-world.md
+++ b/example-world.md
@@ -325,8 +325,28 @@ mean "ready".
record datagram
data
: list<u8
>remote-address
: ip-socket-address
data
: list<u8
>
local-address
: option<ip-socket-address
>
The local address. +
Equivalent to the IP_PKTINFO & IPV6_PKTINFO ancillary messages.
+traffic-class
: option<u8
>
The value of the Traffic Class field of the IP packet. (Also known as "Type of Service (TOS)" in IPv4) +
This value is typically composed of the DSCP (6 high bits) + ECN (2 low bits).
+Equivalent to the IP_TOS & IPV6_TCLASS ancillary messages.
+hop-limit
: option<u8
>
The value of the Hop Limit field of the IP packet. (Also known as "Time To Live (TTL)" in IPv4) +
Equivalent to the IP_TTL & IPV6_HOPLIMIT ancillary messages.
+This function attempts to receive up to max-results
datagrams on the socket without blocking.
The returned list may contain fewer elements than requested, but never more.
If max-results
is 0, this function returns successfully with an empty list.
If a platform does not support receiving a particular field, its value will be set to None
in the returned datagram.
not-bound
: The socket is not bound to any local address. (EINVAL)remote-unreachable
: The remote address is not reachable. (ECONNREFUSED, ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN)would-block
: There is no pending data available to be read at the moment. (EWOULDBLOCK, EAGAIN)The closest equivalent to this function is Linux' recvmmsg
function while having the following options enabled:
Naming differences:
+remote-address
to get their addr
invalid-remote-address
: The port in remote-address
is set to 0. (EDESTADDRREQ, EADDRNOTAVAIL)already-connected
: The socket is in "connected" mode and the datagram.remote-address
does not match the address passed to connect
. (EISCONN)not-bound
: The socket is not bound to any local address. Unlike POSIX, this function does not perform an implicit bind.not-supported
: An unsupported field in the datagram was set to Some value.remote-unreachable
: The remote address is not reachable. (ECONNREFUSED, ECONNRESET, ENETRESET on Windows, EHOSTUNREACH, EHOSTDOWN, ENETUNREACH, ENETDOWN)datagram-too-large
: The datagram is too large. (EMSGSIZE)would-block
: The send buffer is currently full. (EWOULDBLOCK, EAGAIN)The closest equivalent to this function is Linux' sendmmsg
with zero or more
+ancillary messages for each not-None datagram field:
not-supported
.On Windows, when sending a traffic-class
value, only the ECN bits (the lowest two) are allowed through.