54 EMBED_CALL(byteio.put, OctetusCfg, .write_span = w, .byte = (uint8_t)d->
addr.
family);
55 EMBED_CALL(byteio.put_be, OctetusCfg, .write_span = w, .value = d->
port, .bytes = 2);
56 EMBED_CALL(byteio.put_be, OctetusCfg, .write_span = w, .value = d->
len, .bytes = 2);
57 EMBED_CALL(byteio.put_be, OctetusCfg, .write_span = w,
58 .value = EMBED_CALL(magna_extremitas.rd, EndianCfg, .src = d->
addr.
bytes, .width = MMGR_ENDIAN_64),
60 EMBED_CALL(byteio.put_be, OctetusCfg, .write_span = w,
61 .value = EMBED_CALL(magna_extremitas.rd, EndianCfg, .src = d->
addr.
bytes + 8, .width = MMGR_ENDIAN_64),
78 if (!EMBED_CALL(byteio.take_be, OctetusCfg, .read_span = r, .out = &family, .bytes = 1) ||
79 !EMBED_CALL(byteio.take_be, OctetusCfg, .read_span = r, .out = &port, .bytes = 2) ||
80 !EMBED_CALL(byteio.take_be, OctetusCfg, .read_span = r, .out = &len, .bytes = 2) ||
81 !EMBED_CALL(byteio.take_be, OctetusCfg, .read_span = r, .out = &hi, .bytes = 8) ||
82 !EMBED_CALL(byteio.take_be, OctetusCfg, .read_span = r, .out = &lo, .bytes = 8))
87 if (family == (uint64_t)PROTOCORE_IP_V4)
91 else if (family == (uint64_t)PROTOCORE_IP_V6)
95 (void)EMBED_CALL(magna_extremitas.wr, EndianCfg, .dst = d->
addr.
bytes, .val = hi, .width = MMGR_ENDIAN_64);
96 (void)EMBED_CALL(magna_extremitas.wr, EndianCfg, .dst = d->
addr.
bytes + 8, .val = lo, .width = MMGR_ENDIAN_64);
97 d->
port = (uint16_t)port;
98 d->
len = (uint16_t)len;
116 EMBED_CALL(anularis.peek, AnularisCfg, .ring = ring, .dst = hdr, .bytes =
PROTOCORE_UDP_DGRAM_HDR, .offset = 0);
122 if (d->
len > stage_cap)
126 EMBED_CALL(anularis.consume, AnularisCfg, .ring = ring,
127 .bytes = EMBED_CALL(anularis.available, AnularisCfg, .ring = ring));
135 (void)EMBED_CALL(anularis.read, AnularisCfg, .ring = ring, .dst = stage, .bytes = d->
len);
EMBED_INLINE embed_bool protocore_udp_dgram_take(mmgr_ring *ring, uint8_t *hdr, protocore_udp_dgram *d, uint8_t *stage, size_t stage_cap)
Dequeue one datagram: d takes the header, stage takes the payload.