|
ProtoCore v1.0.16
Deterministic, zero-heap network stack for embedded targets
|
Layer 4 UDP, the receiving side: bound ports, their receive rings, and the drain. More...
Go to the source code of this file.
Classes | |
| struct | UdpBindArgs |
| RFC 768 "the creation of new receive ports": what binding one takes. More... | |
| struct | UdpSendArgs |
| RFC 768 "an operation that allows a datagram to be sent": where it goes and what it carries. More... | |
| struct | UdpPeerArgs |
| RFC 768 "an indication of source port and source address": the sender a reply answers. More... | |
| struct | UdpListenerVars |
| struct | UdpListenerNs |
| The entries. More... | |
Typedefs | |
| typedef void(* | protocore_udp_handler) (const uint8_t *data, size_t len, const struct protocore_udp_peer *peer, void *ctx) |
| Datagram handler, invoked once per received datagram by poll(). | |
Functions | |
| void | protocore_udp_listener_listen (uint8_t *work) |
| void | protocore_udp_listener_listen_multicast (uint8_t *work) |
| void | protocore_udp_listener_leave_multicast (uint8_t *work) |
| void | protocore_udp_listener_poll (uint8_t *work) |
| void | protocore_udp_listener_reply (uint8_t *work) |
| void | protocore_udp_listener_peer_addr (uint8_t *work) |
| void | protocore_udp_listener_sendto (uint8_t *work) |
| void | protocore_udp_listener_close (uint8_t *work) |
| void | protocore_udp_listener_joined_group (uint8_t *work) |
| uint8_t * | protocore_udp_listener_span (void) |
| The PROTOCORE_UDP_LISTENER_BORROW bytes this module's state lives in. | |
Variables | |
| UdpListenerVars | UdpListenerV |
| The operands and the outcome. | |
Layer 4 UDP, the receiving side: bound ports, their receive rings, and the drain.
One slot per bound port, and one receive ring per slot. The stack's receive trampoline is its sole producer; poll() is its sole consumer and calls the handler once per datagram, so the handler runs in the task that calls poll(), not in the stack's thread.
The ring carries framed entries: address, port, and length ahead of the payload. A frame is published once, whole, so the consumer never observes a partial one, and a datagram that does not fit the free space is dropped at the trampoline.
Sending is not queued. reply() and sendto() carry the caller's buffer to the wire inside one marshaled call and report what the stack did with it.
Reached through ::UdpListener.
Definition in file server.h.
| typedef void(* protocore_udp_handler) (const uint8_t *data, size_t len, const struct protocore_udp_peer *peer, void *ctx) |
| void protocore_udp_listener_listen | ( | uint8_t * | work | ) |
| void protocore_udp_listener_listen_multicast | ( | uint8_t * | work | ) |
| void protocore_udp_listener_leave_multicast | ( | uint8_t * | work | ) |
| void protocore_udp_listener_poll | ( | uint8_t * | work | ) |
| void protocore_udp_listener_reply | ( | uint8_t * | work | ) |
| void protocore_udp_listener_peer_addr | ( | uint8_t * | work | ) |
| void protocore_udp_listener_sendto | ( | uint8_t * | work | ) |
| void protocore_udp_listener_close | ( | uint8_t * | work | ) |
| void protocore_udp_listener_joined_group | ( | uint8_t * | work | ) |
| uint8_t * protocore_udp_listener_span | ( | void | ) |
The PROTOCORE_UDP_LISTENER_BORROW bytes this module's state lives in.
Stated beside the namespace rather than on it: an entry takes a borrow, and this is where that borrow comes from. Taken once from the end of the pool, which no mark and no release walks, so the state lasts the life of the program.
|
extern |
The operands and the outcome.