1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

127 Commits

Author SHA1 Message Date
Martine S. Lenders
7dc4f78d0c
sock_async: add missing license header to net/sock/async/types.h 2020-06-18 15:40:41 +02:00
Martine S. Lenders
1b2303771e
sock_async: change flags for new sock_dtls behavior 2020-06-18 15:23:02 +02:00
Martine S. Lenders
c7916e11e6
sock_dtls: add missing whitespace to doc 2020-05-26 20:36:57 +02:00
Martine S. Lenders
880c42e236
sock_dtls: introduce UDP sock getter 2020-05-26 20:29:33 +02:00
Aiman Ismail
3ad2724f44 sock_dtls: fix vera++ warnings on line length 2020-05-22 14:06:38 +02:00
Aiman Ismail
b5b7955743 sock_dtls: add sock_dtls_session_init()
deprecates sock_dtls_session_create()
2020-05-22 14:06:12 +02:00
Aiman Ismail
7f883f4098 sock_dtls: add timeout to sock_dtls_send() 2020-05-18 09:45:14 +02:00
Martine S. Lenders
58685af8a6
sock: sock_*_recv_buf: mark as experimental 2020-04-01 15:50:51 +02:00
Martine S. Lenders
f9e17ac025
sock: amend API to iterate over stack-internal chunks
With lwIP we have a chunked UDP payload, so just providing the
stack-internal buffer is not possible. To be able to iterate over such
a chunked payload, this change allows the `sock_*_recv_buf()` functions
to use the internal buffer context as an iteration state.

As the internal buffer space can be released when the function would
return 0, `sock_recv_buf_free()` becomes unnecessary.
2020-04-01 15:50:46 +02:00
Jose Alamos
e451570219 gnrc_netif: remove GNRC_NETIF_NUMOF macro 2020-03-26 11:12:23 +01:00
Martine Lenders
ba711c50bf
Merge pull request #13616 from miri64/sock/enh/recv_buf
sock: amend with zero-copy receive functions
2020-03-24 17:10:12 +01:00
Martine S. Lenders
2ed7a7345f
sock_udp: fix doc of sock objects 2020-03-24 14:02:36 +01:00
Martine S. Lenders
a7d468988d
sock: amend with zero-copy receive functions
This change amends the `sock` API by a set of functions to `sock` that
allow provisioning of stack-internal buffers to the caller on receive.

This allows to cover two use-cases

1. Zero-copy systems: if the stacks supported the buffer space provided
   by these functions can be the same that was filled in the link-layer
2. asynchronous receive within a wrapping sock layer (e.g. `sock_dtls`
   wrapping `sock_udp`): to receive packets of the lower level protocol
   asynchronously, the wrapping implementation layer would currently
   need to allocate its own buffer space, introducing a third buffer
   space in addition to the one of the application and the network
   stack. For a wrapping layer this is undesirable.

While there are security considerations exposing stack internal memory
space to the caller, I believe they are minor, as in the end the
application developer is the person in control of the node.
2020-03-24 14:02:36 +01:00
Martine S. Lenders
411e320b0c
sock_async_event: update for async callback argument support 2020-03-11 16:54:12 +01:00
Martine S. Lenders
612e782b3c
sock_async: supply optional callback argument with callback setter 2020-03-11 16:54:11 +01:00
Martine S. Lenders
6e6e435c65
sock_async: add optional callback argument 2020-03-11 16:54:11 +01:00
Aiman Ismail
aa3cbacceb net/sock_dtls: do not put msg in mbox on timeout 2020-03-09 15:08:52 +01:00
benpicco
d044800300
Merge pull request #13450 from benpicco/dns-fixes
fix DNS resolution in ping6
2020-02-24 21:58:34 +01:00
Benjamin Valentin
fa4447241f sock_dns: make sock_dns_query() return the length of the address
The implementation already did that, now also reflect this in the
documentation.
2020-02-24 14:29:17 +01:00
Benjamin Valentin
1de14931b8 sock_dns: use the same buffer for request & reply
Saving RAM is more important than saving a few cycles
used by re-creating the request buffer in the error case.

Also reduce the size of the buffer to 128 bytes.
If we are just requesting the AAAA record it is unlikely
for the reply to take up the maximum size of 512 bytes.

We were already placing restrictions on the domain name length,
those are now actually a bit more relaxed (112 bytes instead of 64)
2020-02-24 14:29:17 +01:00
Martine S. Lenders
9b4dac7f3e
sock_async: include sock_async_ctx.h before sock-types
This way, the sock-types can use the sock_async_ctx_t type in their
definition without including `sock_async_ctx.h` (potentially creating
further cyclic includes).
2020-02-24 12:33:38 +01:00
Francisco
43d2ca4771
Merge pull request #12602 from miri64/sock_async_event/feat/initial
sock_async: initial import of event-based implementation
2020-01-15 14:32:05 +01:00
Martine Lenders
e46ad92cd3
sock_async_event: initial import of event-based implementation 2020-01-15 09:56:11 +01:00
Leandro Lanzieri
e7ce6914c5 sock/async: Fix forward declaration of sock_tcp_queue_t 2020-01-13 12:19:00 +01:00
Martine S. Lenders
3896145c31
sock: ignore -Wtypedef-redefinition for LLVM where needed
net/sock/async/types.h included by net/sock.h needs to re-typedef the
the sock types to prevent cyclic includes.
2020-01-07 10:13:02 +01:00
Martine S. Lenders
43b1c5c74c
sock_async: fix cyclic dependency with sock_types.h
Typically a stack needs to add the callback for a sock as a member of
its respective `sock` type so `sock_types.h` needs to include
`net/sock/async.h` at the moment. As those however include
`net/sock/<prot>.h`, which in turn include `sock_types.h`, we create a
cyclic dependency.

This fix resolves this cyclic dependency, by putting the callback
definitions in its own header that then in turn can be also included
by `sock_types.h`.
2020-01-07 10:13:01 +01:00
Leandro Lanzieri
c74fa5367c net/sock/util: Move configuration macros to 'CONFIG_' namespace
Macros that changed:
SOCK_SCHEME_MAXLEN -> CONFIG_SOCK_SCHEME_MAXLEN
SOCK_HOSTPORT_MAXLEN -> CONFIG_SOCK_HOSTPORT_MAXLEN
SOCK_URLPATH_MAXLEN -> CONFIG_SOCK_URLPATH_MAXLEN
2019-12-13 12:04:54 +01:00
Martine S. Lenders
de47681d03 sock_async: fix compile-time errors 2019-10-31 16:01:49 +01:00
Martine Lenders
f0b5eb04c1 sock: initial import of asynchronous event definitions 2019-10-30 13:23:31 +01:00
Aiman Ismail
ede7edd313 sys/net pkg/: document DTLS support in net_dtls 2019-08-27 16:41:39 +02:00
Aiman Ismail
fed72571ec sys/net/sock: add sock_dtls API 2019-08-27 16:41:39 +02:00
Martine S. Lenders
9ba22083ee sock_ip: fix documenation referring to UDP sock 2019-06-19 14:18:45 +02:00
Leandro Lanzieri
b9c1146e90 sys/net/sock_util: Accept null pointers in urlsplit 2019-06-12 10:03:11 +02:00
francisco
ef4481fba9 sock/util: add config group 2019-05-22 15:55:16 +02:00
7dc1b4f45d sys/sock/util: allow overriding of SOCK_*_MAXLEN 2019-05-21 12:06:49 +02:00
b0309145f0
sock_util: Limit URL scheme size 2018-07-19 22:07:17 +02:00
6a81a4d587
sock_util: add missing includes 2018-07-18 17:43:59 +02:00
Hauke Petersen
bf8f8dfa67 net/sock_udp: add sock_udp_ep_equal() 2018-07-05 15:13:01 +02:00
Martine Lenders
a027684a1e sock_dns: fix typo in doc
`s/fuction/function/` ;-)
2018-06-22 13:23:26 +02:00
Martine Lenders
a20639074a sock_udp: define send error-state for full port pool 2018-06-20 14:51:17 +02:00
Martine Lenders
9e7cebae93 sock_udp: allow creation with ephemeral ports
This change allows the port for local endpoint to be zero 0. If this is
the case the `sock_udp_create()` function binds the object to an
ephemeral port.
2018-06-20 14:51:17 +02:00
Martine Lenders
2e93ba1c50
doc: Fix 'must not'/'may not' wording
I applied the following terminology and changed the wording in the doc
accordingly:

* must not: If the parameter is of the value it *must not* be it either
  hits an assert or crashes the system.
* may not: The value can be that value, but the function will return an
  error.
2017-12-19 09:00:12 +01:00
Martine Lenders
ce0d81c5c8
sock: specify invalid parameter error 2017-06-12 13:54:55 +02:00
Raul Fuentes
808b56c07f sock/udp.h: Changed wiki syntax to doxygen 2017-05-30 20:48:41 +02:00
0fcc7d3834 cleanup: apply headerguard script output 2017-05-24 17:54:02 +02:00
Martine Lenders
9fc95504c8 Merge pull request #6898 from rfuentess/udp_sock
sock/udp.h:  Minor fix to example
2017-04-13 18:47:47 +02:00
7af03ab624 sys: net: introduce simple sock DNS client 2017-03-28 20:49:53 +02:00
2a955ad631 sys: net: sock: add utility functions 2017-03-28 19:16:27 +02:00
Oleg Hahm
0018cd7b01 sock: tcp: fix c&p mistake 2017-03-17 08:13:07 +01:00
Raul Fuentes
c169d66120 Adding missing variable to one example 2017-03-07 15:35:05 +01:00
Oleg Hahm
7ee7801c10 *: remove trailing underscores from header guards 2017-01-19 18:30:53 +01:00
Oleg Hahm
4f4214235b timex: unambiguous time conversion macros 2017-01-19 13:18:08 +01:00
Emmanuel Baccelli
cab947b05a fixed insconsistencies in the doc for sock
fixed insconsistency concerning headers needed

fixed insconsistency concerning headers needed

fixed insconsistency concerning headers needed
2016-11-29 21:28:49 +01:00
Martine Lenders
bd533dd785 gnrc_sock: move net/af.h include to sock_types.h 2016-11-18 12:33:01 +01:00
3b30d510bf Merge pull request #5923 from miri64/sock/api/add-missing-func+doc
sock_tcp: Add missing function and doc
2016-10-17 16:04:32 +02:00
Martine Lenders
6e2f1c566b sock_tcp: Add missing function and doc 2016-10-17 14:46:57 +02:00
Martine Lenders
b9330d462b sock: Some formatting fixes
Follow-up on #5929
2016-10-12 17:55:48 +02:00
Martine Lenders
8c56c9031b Merge pull request #5929 from kaspar030/sock_change_no_timeout_value
sock: change "no timeout" value from 0 to UINT32_MAX
2016-10-12 16:08:03 +02:00
aace13624b sock: change "no timeout" value from 0 to UINT32_MAX 2016-10-12 15:19:16 +02:00
Martine Lenders
d4ba3bd184 sock: doc fixes 2016-10-11 10:24:45 +02:00
Martine Lenders
f93ab584d8 sock: make queue_array parameter a pointer
Since sock_tcp_t isn't defined at this moment (only declared) the
compiler is complaining about the use of an array in the parameter list
here.

    sys/include/net/sock/tcp.h:119:32: error: array type has incomplete element type ‘sock_tcp_t {aka struct
sock_tcp}’
                         sock_tcp_t queue_array[], unsigned queue_len,
                                    ^
2016-10-07 15:06:38 +02:00
Martine Lenders
6c1e805f9e sock: define behavior on invalid addresses 2016-10-06 21:56:19 +02:00
Martine Lenders
f4d39274fb sock: doc fixes 2016-10-04 17:22:54 +02:00
Martine Lenders
09703e1fdf fixup! sock: Introduction of new application layer API
Add more error classes
2016-09-02 19:02:33 +02:00
Martine Lenders
73861e2c15 fixup! sock: Introduction of new application layer API
Fix some typos
2016-08-25 17:55:11 +02:00
Martine Lenders
ce205afc57 fixup! sock: Introduction of new application layer API
sock_ip: Provide proto parameter to send in case sock == NULL.
2016-08-25 16:02:47 +02:00
Martine Lenders
002be06c79 fixup! sock: Introduction of new application layer API
sock_tcp: more error code specifications and fixes
2016-08-25 11:37:01 +02:00
Martine Lenders
777c8f77b6 fixup! sock: Introduction of new application layer API
Add `-ECONNABORT` return for sock_tcp_read and sock_tcp_write.
2016-08-24 19:25:14 +02:00
Martine Lenders
1f74eae424 fixup! sock: Introduction of new application layer API
Fix some typedefs
2016-08-22 17:03:52 +02:00
Martine Lenders
a41bc13767 fixup! sock: Introduction of new application layer API
Reword confusing out-parameter doc in create functions
2016-08-20 02:39:58 +02:00
Martine Lenders
a4fd05c6f6 fixup! sock: Introduction of new application layer API
Fix wrongly typedef'd endpoint
2016-08-20 02:33:32 +02:00
Martine Lenders
b24d9de9ae fixup! sock: Introduction of new application layer API 2016-08-19 17:36:58 +02:00
Martine Lenders
01b0975072 fixup! sock: Introduction of new application layer API 2016-08-19 16:52:06 +02:00
Martine Lenders
6f06deff40 fixup! sock: Introduction of new application layer API 2016-08-19 16:17:35 +02:00
Martine Lenders
44af8765af fixup! sock: Introduction of new application layer API 2016-08-19 15:33:00 +02:00
Martine Lenders
b71c2f334a fixup! sock: Introduction of new application layer API 2016-08-19 15:27:15 +02:00
Martine Lenders
7ef177a8cb sock: Introduction of new application layer API
This introduces a new alternative and better API to `conn`. It differs in the
following aspects:

* a common address type for both IPv4 and IPv6 addresses is introduced
* communication end-points are abstracted as end-point types `sock_x_ep_t`,
  containing the address, its family, its port (if required for protocol) and
  the interface identifier.
* All functions require some kind of state. Sending of datagrams to the same
  source or replying to incoming datagrams is thus simplified
* TCP connection establishment was overall reworked: connected sockets and
  listening sockets are now two distinct types. An accept on a listening socket
  than yields a connected socket
2016-08-18 12:25:41 +02:00