Skip to content

Commit a98a99d

Browse files
committed
doc: net: sockets: Add table summarizing supported socket types
Add a table in sockets documentation summarizing what socket types are being supported. Signed-off-by: Robert Lubos <[email protected]>
1 parent 00b169c commit a98a99d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/connectivity/networking/api/sockets.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,41 @@ there is a table mapping file descriptors to internal object pointers.
5757
The file descriptor table is used by the BSD Sockets API even if the rest
5858
of the POSIX subsystem (filesystem, stdin/stdout) is not enabled.
5959

60+
Zephyr supports multiple types of BSD sockets, the following table summarizes
61+
what socket types are available:
62+
63+
+--------------+-------------+------------------+---------------------------------------------------------------------------+
64+
| Family | Type | Protocol | Description |
65+
+==============+=============+==================+===========================================================================+
66+
| AF_INET |br| | SOCK_DGRAM | IPPROTO_UDP | Enabled if :kconfig:option:`CONFIG_NET_UDP` is set. |br| |
67+
| AF_INET6 | | | Allows to send and receive UDP datagrams. |
68+
| | +------------------+----------------------------------------------------- +
69+
| | | IPPROTO_DTLS_1_x | Enabled if :kconfig:option:`CONFIG_NET_SOCKETS_ENABLE_DTLS` is set. |br| |
70+
| | | | Allows to send and receive DTLS datagrams. |
71+
| +-------------+------------------+---------------------------------------------------------------------------+
72+
| | SOCK_STREAM | IPPROTO_TCP | Enabled if :kconfig:option:`CONFIG_NET_TCP` is set. |
73+
| | | | Allows to send and receive TCP data stream. |
74+
| | +------------------+---------------------------------------------------------------------------+
75+
| | | IPPROTO_TLS_1_x | Enabled if :kconfig:option:`CONFIG_NET_SOCKETS_SOCKOPT_TLS` is set. |br| |
76+
| | | | Allows to send and receive TLS data stream. |
77+
| +-------------+------------------+---------------------------------------------------------------------------+
78+
| | SOCK_RAW | IPPROTO_IP |br| | Enabled if :kconfig:option:`CONFIG_NET_SOCKETS_INET_RAW` is set. |br| |
79+
| | | <proto> | Allows to send and receive IPv4/IPv6 datagrams. |br| |
80+
| | | | Packets are filtered by L4 protocol specified. |
81+
| | | | IPPROTO_IP is a wildcard protocol to receive all IP datagrams. |
82+
+--------------+-------------+------------------+---------------------------------------------------------------------------+
83+
| AF_PACKET | SOCK_DGRAM | ETH_P_ALL |br| | Enabled if :kconfig:option:`CONFIG_NET_SOCKETS_PACKET_DGRAM` is set. |br| |
84+
| | | <proto> | Allows to send and receive packets without L2 header. |br| |
85+
| | | | Packets are filtered by L3 protocol specified. |
86+
| | | | ETH_P_ALL is a wildcard protocol to receive all packets. |
87+
| +-------------+------------------+---------------------------------------------------------------------------+
88+
| | SOCK_RAW | ETH_P_ALL | Enabled if :kconfig:option:`CONFIG_NET_SOCKETS_PACKET` is set. |br| |
89+
| | | | Allows to send and receive packets with L2 header included. |
90+
+--------------+-------------+------------------+---------------------------------------------------------------------------+
91+
| AF_CAN | SOCK_RAW | CAN_RAW | Enabled if :kconfig:option:`CONFIG_NET_SOCKETS_CAN` is set. |br| |
92+
| | | | Allows to send and receive CAN packets. |
93+
+--------------+-------------+------------------+---------------------------------------------------------------------------+
94+
6095
See :zephyr:code-sample:`sockets-echo-server` and :zephyr:code-sample:`sockets-echo-client`
6196
sample applications to learn how to create a simple server or client BSD socket based
6297
application.

0 commit comments

Comments
 (0)