25#ifndef PROTOCORE_UDP_SERVER_H
26#define PROTOCORE_UDP_SERVER_H
41struct protocore_udp_peer;
74 const struct protocore_udp_peer *
peer;
124 void (*
const listen)(uint8_t *work);
125 void (*
const listen_multicast)(uint8_t *work);
126 void (*
const leave_multicast)(uint8_t *work);
127 void (*
const poll)(uint8_t *work);
128 void (*
const reply)(uint8_t *work);
129 void (*
const peer_addr)(uint8_t *work);
130 void (*
const sendto)(uint8_t *work);
131 void (*
const close)(uint8_t *work);
132 void (*
const joined_group)(uint8_t *work);
151static const UdpListenerNs UdpListener __attribute__((unused)) = {
Layer 3 (Network) - a family-tagged IP address (IPv4 or IPv6) with RFC-faithful text parsing,...
RFC 768 "the creation of new receive ports": what binding one takes.
protocore_udp_handler handler
what a received datagram is delivered to
void * handler_ctx
the opaque context that handler is given back
const char * group_ip
the IPv4 group to join, as text
void(*const listen)(uint8_t *work)
UdpSendArgs send_args
what sending a datagram takes
UdpBindArgs bind
what creating a receive port takes (RFC 768 User Interface)
uint16_t port
the receive port every call names
UdpPeerArgs peer_args
what a sender lookup reads and writes
RFC 768 "an indication of source port and source address": the sender a reply answers.
size_t ip_cap
how much room that has
uint16_t * port_out
where its port is written
char * ip_out
where its address is formatted
const struct protocore_udp_peer * peer
the sender a reply answers
RFC 768 "an operation that allows a datagram to be sent": where it goes and what it carries.
const protocore_ip * dst
where a send goes
uint16_t dst_port
its port
const uint8_t * data
the octets to send
A v4 or v6 address in network (big-endian) byte order.
void protocore_udp_listener_listen_multicast(uint8_t *work)
void protocore_udp_listener_leave_multicast(uint8_t *work)
void protocore_udp_listener_joined_group(uint8_t *work)
void protocore_udp_listener_sendto(uint8_t *work)
UdpListenerVars UdpListenerV
The operands and the outcome.
void protocore_udp_listener_listen(uint8_t *work)
void protocore_udp_listener_close(uint8_t *work)
void protocore_udp_listener_peer_addr(uint8_t *work)
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().
uint8_t * protocore_udp_listener_span(void)
The PROTOCORE_UDP_LISTENER_BORROW bytes this module's state lives in.
void protocore_udp_listener_reply(uint8_t *work)
void protocore_udp_listener_poll(uint8_t *work)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS