cbf.h 922 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Directional contention forwarding, per "Relay Transport and Directional
  3. * Forwarding" / *Directional contention forwarding*. This milestone only
  4. * exercises the downstream, DST=0xFF flood case (Beacon traffic), on a
  5. * single line with one phantom leaf - see topology.h.
  6. */
  7. #ifndef CBF_H_
  8. #define CBF_H_
  9. #include <stddef.h>
  10. #include <stdint.h>
  11. #include "frame/frame.h"
  12. /* Must be called once at boot. CBF no longer touches the radio directly
  13. * (see tx_queue.h) - it only restamps TX and submits to the TX queue.
  14. */
  15. void cbf_init(uint8_t self_id);
  16. /* Feed every received, MAC-verified frame to the CBF engine. hdr is the
  17. * already-decoded header; raw/raw_len are the full on-air bytes
  18. * (header+payload+MAC) as received, needed so a scheduled forward can
  19. * restamp TX and retransmit the same bytes.
  20. */
  21. void cbf_on_rx(const struct frame_hdr *hdr, const uint8_t *raw, size_t raw_len);
  22. #endif /* CBF_H_ */