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

89 Commits

Author SHA1 Message Date
Benjamin Valentin
442644ba93 gnrc_sock_udp: style fix in sock_udp_recv_buf_aux() 2022-11-15 20:35:20 +01:00
Benjamin Valentin
2b92e9ec59 gnrc_sock_udp: accept response from any address if remote is multicast 2022-11-15 11:26:31 +01:00
Benjamin Valentin
5a3045117e gnrc_sock_udp: make 'remote match' condition more readable 2022-11-07 16:35:57 +01:00
Karl Fessel
05f114d0af doc: fix unbalaced grouping
- most were trivial
    - missing group close or open
    - extra space
    - no doxygen comment
- name commad might open an implicit group
    this hould also be implicit cosed but does not happen somtimes
- crazy: internal declared groups have to be closed internal
2022-09-14 15:05:25 +02:00
Martine Lenders
a2ca69ac91
Merge pull request #17691 from miri64/gnrc_sock/enh/warn-about-async-timeout
gnrc_sock: warn about non-zero receive timeouts with sock_async
2022-05-24 23:20:42 +02:00
Martine Lenders
4e88b7552b
gnrc_sock: warn about non-zero receive timeouts with sock_async 2022-05-24 12:29:13 +02:00
Marian Buschsieweke
eadd282cf4
Merge pull request #18026 from benpicco/gcoap_add_fix
gcoap: ensure response address is the same as request address
2022-05-10 10:49:56 +02:00
Benjamin Valentin
cc8b4f52aa grnc_sock_udp: implement SOCK_AUX_SET_LOCAL 2022-05-10 09:24:56 +02:00
Benjamin Valentin
2197f9c16a grnc_sock_ip: implement SOCK_AUX_SET_LOCAL 2022-05-10 09:24:56 +02:00
Benjamin Valentin
cbd48c23aa gnrc_sock: implicitly set netif if there is only a single one 2022-05-06 12:11:13 +02:00
Benjamin Valentin
e55f0f8831 sys/net/grnc: make use of iolist_to_buffer() 2022-05-02 23:23:52 +02:00
Martine Lenders
5aefb8d5dc
gnrc_sock: initialized un-initialized timer objects 2022-03-24 15:23:50 +01:00
Francisco Molina
66d87fccf9 sys/net/gnrc/sock: use ztimer_usec or xtimer for timeout 2022-03-24 08:06:05 +01:00
Francisco Molina
1aea12c27c sys/net/gnrc/sock_types: guard tcp.h header inclusion 2022-03-04 08:47:47 +01:00
Benjamin Valentin
1b52dee2d6 net/gnrc: restore inclusion of net/gnrc/tcp.h
This reverts d03175c2ae
2022-03-01 23:07:21 +01:00
a17ff53ecf
Merge pull request #17485 from benpicco/sock_udp_sendv
sys/net/sock: add sock_udp_sendv() API
2022-03-01 14:05:21 +01:00
Karl Fessel
d03175c2ae net/gnrc: avoid *timer creeping though header 2022-02-28 14:53:07 +01:00
Benjamin Valentin
4cf94083de sys/net/grnc: implement sock_udp_sendv_aux() 2022-02-22 10:05:41 +01:00
Karl Fessel
0a3dd441ce net/gnrc_sock: do not include xtimer.h without xtimer module 2021-12-14 22:53:01 +01:00
Karl Fessel
be28c537b3 gnrc/sock: recv avoid spinning xtimer 2021-09-09 22:41:39 +02:00
Simon Brummer
6fba0d970c gnrc_sock_tcp: integrate gnrc_tcp 2021-08-14 21:27:34 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Martine Lenders
5c3c1b6a5f
gnrc_sock: imply end-point netif only if unset 2021-07-14 10:29:09 +02:00
Marian Buschsieweke
89c69c5450
sys/net/gnrc/tx_sync: new module
The new `gnrc_tx_sync` module allows users of the GNRC network stack to
synchronize with the actual transmission of outgoing packets. This is directly
integrated into gnrc_sock. Hence, if `gnrc_tx_sync` is used, calls to e.g.
sock_udp_send() will block until the network stack has processed the message.

Use cases:
1. Prevent packet drop when sending at high rate
    - If the application is sending faster than the stack can handle, the
      message queues will overflow and outgoing packets are lost
2. Passing auxiliary data about the transmission back the stack
    - When e.g. the number of required retransmissions, the transmission time
      stamp, etc. should be made available to a user of an UDP sock, a
      synchronization mechanism is needed
3. Simpler error reporting without footguns
    - The current approach of using `core/msg` for passing up error messages is
      difficult to use if other message come in. Currently, gnrc_sock is
      busy-waiting and fetching messages from the message queue until the number
      of expected status reports is received. It will enqueue all
      non-status-report messages again at the end of the queue. This has
      multiple issues:
        - Busy waiting is especially in lower power scenarios with time slotted
          MAC protocols harmful, as the CPU will remain active and consume
          power even though the it could sleep until the TX slot is reached
        - The status reports from the network stack are send to the user thread
          blocking. If the message queue of the user thread is full, the network
          stack would block until the user stack can fetch the messages. If
          another higher priority thread would start sending a message, it
          would busy wait for its status reports to completely come in. Hence,
          the first thread doesn't get CPU time to fetch messages and unblock
          the network stack. As a result, the system would lock up completely.
    - Just adding the error/status code to the gnrc_tx_sync_t would preallocate
      and reserve memory for the error reporting. That way gnrc_sock does not
      need to search through the message queue for status reports and the
      network stack does not need to block for the user thread fetching it.
2021-02-03 15:16:42 +01:00
Marian Buschsieweke
c0765d9e07
sys/net/grnc: implement sock_aux_rssi 2021-01-13 13:29:13 +01:00
Marian Buschsieweke
8f24cc840c
sys/net/gnrc/sock: cleanup & fix aux handling
The logic used to check whether the RX timestamp was provided in the GNRC
implementation of `sock_ip_recv_buf_aux()` is incorrect: It still uses in-band
signalling via a timestamp of zero, but a dedicated flag was added to allow for
timestamps of zero.

Additionally, it is not necessary to check if a bit is set only to clear it -
clearing it unconditionally is faster and smaller.
2021-01-12 21:31:24 +01:00
Marian Buschsieweke
d95192e97b
sys/net/gnrc/sock: Add support for RX timestamp 2020-12-10 17:43:11 +01:00
Marian Buschsieweke
1d69f067d1
sys/net/gnrc: Implement sock_aux_local
Provide address the IP packet / UDP datagram was received on in the auxiliary
data, if module sock_aux_local is used.
2020-12-04 12:47:59 +01:00
Marian Buschsieweke
9d46bc7d7f
Merge pull request #14703 from maribu/sock-aux-api
net/sock: Add access to auxiliary data (API only)
2020-12-03 12:08:49 +01:00
Marian Buschsieweke
893bfd13d0
net/sock_udp: Extend API for auxiliary data 2020-12-02 17:56:13 +01:00
Marian Buschsieweke
ebcf1c0ab4
net/sock_ip: Extend API for auxiliary data 2020-12-02 17:56:13 +01:00
80a628f76d sys/gnrc/sock: make use of mbox_size() and mbox_avail() 2020-11-20 10:38:17 +01:00
Bas Stottelaar
80d9da90df sys/*: add missing include of assert.h 2020-10-22 11:13:09 +02:00
Martine Lenders
45144fb4a4
treewide: use new gnrc_pkt API functions instead of utlist.h macros 2020-10-13 13:32:53 +02:00
Martine S. Lenders
7d47484170
gnrc_sock_ip: fix NULL pointer dereference 2020-09-08 13:05:10 +02:00
Marian Buschsieweke
3b6fa61829
sys: Cleanup access to internal variables
Replace direct accesses to sched_active_thread and sched_active_pid with
the helper functions thread_getpid() and thread_get_active(). This serves
two purposes:

1. It makes accidental writes to those variable from outside core less likely.
2. Casting off the volatile qualifier is now well contained to those two
   functions
2020-08-24 20:28:11 +02:00
Leandro Lanzieri
dbfe0d8ea1
gnrc/sock: Configure mbox size with exponent and add config doc group
This changes the configuration macro to be the exponent of 2^n, as the
mbox buffer size needs to be always power of 2. The macro now has the
GNRC prefix.

Also a compile configuration documentation group is created.
2020-06-15 07:30:54 +02:00
Sören Tempel
f37c1fd9dd gnrc_sock: add comment to fuzzing termination condition 2020-05-26 17:24:43 +02:00
Sören Tempel
3314388417 sock_async_event: Implement termination condition for fuzzing
See: 65c7bbf76d.
2020-05-26 17:24:40 +02:00
Sören Tempel
729e0f95ac gnrc_sock: Export prevpkt and rename it to gnrc_sock_prevpkt
This is a perquisite for fuzzing applications using sock_async_event.
2020-05-26 17:24:39 +02:00
Michel Rottleuthner
740bb4e32e sys/net/gnrc/sock: release pktsnip when message queue is full 2020-05-15 18:24:42 +02:00
Martine S. Lenders
d66583b542
gnrc_sock: re-issue MSG_RECV event if there are still received messages
... after `*_recv()` was called.

This prevents a client from needing to call `*_recv()` in a loop.
2020-05-12 14:01:56 +02:00
Sören Tempel
65c7bbf76d gnrc_sock: Implement termination condition for fuzzing
The termination condition implemented in gnrc_pktbuf_malloc does not
work when using the sock interface as sock copies packet data to a local
buffer and frees the packet afterwards. As such, the fuzzing application
would exit before performing any input processing.

For this reason, the termination condition in gnrc_pktbuf_malloc is
disabled when using sock. Instead, the application terminates if
gnrc_sock_recv previously returned the fuzzing packet. The underlying
assumption of this implementation is that gnrc_sock_recv is called in a
loop.
2020-04-07 17:48:39 +02:00
Martine S. Lenders
d934579817
gnrc_sock: adapt for *_recv_buf() API change 2020-04-01 15:50:51 +02:00
benpicco
8024380f7b
Merge pull request #13700 from miri64/gnrc_sock/enh/recv_buf
gnrc_sock: provide implementation for `sock_*_recv_buf()`
2020-03-27 16:34:57 +01:00
Martine Lenders
f39cfc7556
Merge pull request #13253 from nmeum/pr/random_ephemeral_port
gnrc_sock_udp: choose random ephemeral port
2020-03-26 15:00:14 +01:00
Martine S. Lenders
39cd293a0e
gnrc_sock: provide implementation for sock_*_recv_buf() 2020-03-24 17:15:17 +01:00
Jose Alamos
6ace7b5472 gnrc_netif: use gnrc_netif_single where possible 2020-03-17 10:54:30 +01:00
Martine S. Lenders
4bdd138021
gnrc_sock: update implementation for async callback argument 2020-03-11 16:54:11 +01:00
Martine S. Lenders
612e782b3c
sock_async: supply optional callback argument with callback setter 2020-03-11 16:54:11 +01:00