Skip to content

Commit 75deb71

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 f8025b8 commit 75deb71

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

doc/connectivity/networking/api/sockets.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,45 @@ 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 | SOCK_DGRAM | IPPROTO_UDP | Enabled if CONFIG_NET_UDP is set. |
67+
| AF_INET6 | | | Allows to send and receive UDP datagrams. |
68+
| | +------------------+-----------------------------------------------------+
69+
| | | IPPROTO_DTLS_1_x | Enabled if CONFIG_NET_SOCKETS_ENABLE_DTLS is set. |
70+
| | | | Allows to send and receive DTLS datagrams. |
71+
| +-------------+------------------+-----------------------------------------------------+
72+
| | SOCK_STREAM | IPPROTO_TCP | Enabled if CONFIG_NET_TCP is set. |
73+
| | | | Allows to send and receive TCP data stream. |
74+
| | +------------------+-----------------------------------------------------+
75+
| | | IPPROTO_TLS_1_x | Enabled if CONFIG_NET_SOCKETS_SOCKOPT_TLS is set. |
76+
| | | | Allows to send and receive TLS data stream. |
77+
| +-------------+------------------+-----------------------------------------------------+
78+
| | SOCK_RAW | IPPROTO_IP | Enabled if CONFIG_NET_SOCKETS_INET_RAW is set. |
79+
| | | <proto> | Allows to send and receive IPv4/IPv6 datagrams. |
80+
| | | | Packets are filtered by L4 protocol specified. |
81+
| | | | IPPROTO_IP is a wildcard protocol to receive all IP |
82+
| | | | datagrams. |
83+
+-----------+-------------+------------------+-----------------------------------------------------+
84+
| AF_PACKET | SOCK_DGRAM | ETH_P_ALL | Enabled if CONFIG_NET_SOCKETS_PACKET_DGRAM is set. |
85+
| | | <proto> | Allows to send and receive packets without L2 |
86+
| | | | header. |
87+
| | | | Packets are filtered by L3 protocol specified. |
88+
| | | | ETH_P_ALL is a wildcard protocol to receive all |
89+
| | | | packets. |
90+
| +-------------+------------------+-----------------------------------------------------+
91+
| | SOCK_RAW | ETH_P_ALL | Enabled if CONFIG_NET_SOCKETS_PACKET is set. |
92+
| | | | Allows to send and receive packets with L2 header |
93+
| | | | included. |
94+
+-----------+-------------+------------------+-----------------------------------------------------+
95+
| AF_CAN | SOCK_RAW | CAN_RAW | Enabled if CONFIG_NET_SOCKETS_CAN is set. |
96+
| | | | Allows to send and receive CAN packets. |
97+
+-----------+-------------+------------------+-----------------------------------------------------+
98+
6099
See :zephyr:code-sample:`sockets-echo-server` and :zephyr:code-sample:`sockets-echo-client`
61100
sample applications to learn how to create a simple server or client BSD socket based
62101
application.

0 commit comments

Comments
 (0)