@@ -57,6 +57,41 @@ there is a table mapping file descriptors to internal object pointers.
57
57
The file descriptor table is used by the BSD Sockets API even if the rest
58
58
of the POSIX subsystem (filesystem, stdin/stdout) is not enabled.
59
59
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
+
60
95
See :zephyr:code-sample: `sockets-echo-server ` and :zephyr:code-sample: `sockets-echo-client `
61
96
sample applications to learn how to create a simple server or client BSD socket based
62
97
application.
0 commit comments