From abf6018726321a920948d9ba6dcea7f4047a4e4a Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 23 May 2019 12:27:34 +0200 Subject: Introduce udp send ancillary data argument down to inet_drv --- lib/kernel/doc/src/gen_udp.xml | 87 ++++++++++++++++++++++++++++++++++++++++-- lib/kernel/doc/src/inet.xml | 50 ++++++++++++++++++++++-- 2 files changed, 130 insertions(+), 7 deletions(-) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/gen_udp.xml b/lib/kernel/doc/src/gen_udp.xml index d20fc1fdfd..6c0d072fed 100644 --- a/lib/kernel/doc/src/gen_udp.xml +++ b/lib/kernel/doc/src/gen_udp.xml @@ -213,12 +213,93 @@ - + Send a packet.

- Sends a packet to the specified address and port. Argument - Address can be a hostname or a socket address. + Sends a packet to the specified Destination. +

+

+ This function is equivalent to + send(Socket, Destination, [], Packet). +

+
+
+ + + + Send a packet. + +

+ Sends a packet to the specified Host + and Port. +

+

+ This clause is equivalent to + send(Socket, Host, Port, [], Packet). +

+
+
+ + + + Send a packet. + +

+ Sends a packet to the specified Destination + with ancillary data AncData. +

+ +

+ The ancillary data AncData + contains options that for this single message + override the default options for the socket, + an operation that may not be supported on all platforms, + and if so return {error, einval}. + Using more than one of an ancillary data item type + may also not be supported. + AncData =:= [] is always supported. +

+
+
+
+ + + + Send a packet. + +

+ Sends a packet to the specified Destination. + Since Destination is complete, + PortZero is redundant and has to be 0. +

+

+ This is a legacy clause mostly for + Destination = {local, Binary} + where PortZero is superfluous. + It is equivalent to + send(Socket, Destination, [], Packet), the clause right above here. +

+
+
+ + + + Send a packet. + +

+ Sends a packet to the specified Host + and Port, + with ancillary data AncData. +

+

+ Argument Host can be + a hostname or a socket address, + and Port can be a port number + or a service name atom. + These are resolved into a Destination and after that + this function is equivalent to + send(Socket, Destination, AncData, Packet), read there about ancillary data.

diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml index 5e33bbc3ff..adaa2684d8 100644 --- a/lib/kernel/doc/src/inet.xml +++ b/lib/kernel/doc/src/inet.xml @@ -117,6 +117,42 @@ fe80::204:acff:fe17:bf38 + + + +

+ A general address format on the form {Family, Destination} + where Family is an atom such as local + and the format of Destination depends on Family, + and is a complete address + (for example an IP address including port number). +

+
+
+ + + + +

+ This address format is for now experimental + and for completeness to make all address families have a + {Family, Destination} representation. +

+
+
+
+ + + + +

+ This address format is for now experimental + and for completeness to make all address families have a + {Family, Destination} representation. +

+
+
+
@@ -180,12 +216,16 @@ fe80::204:acff:fe17:bf38

- Ancillary data received with the data packet - or read with the socket option + Ancillary data received with the data packet, + read with the socket option pktoptions - from a TCP socket. + from a TCP socket, + or to set in a call to + gen_udp:send/4 + or + gen_udp:send/5.

The value(s) correspond to the currently active socket @@ -193,7 +233,9 @@ fe80::204:acff:fe17:bf38 recvtos, recvtclass and - recvttl. + recvttl, + or for a single send operation the option(s) to override + the currently active socket option(s).

-- cgit v1.2.3