13#define MSGBUF_TTL_DONT_AGE (0xFFFFFFFF)
15#define MSGBUF_TAG_OVERWRITE (0x80000000)
void msgb_set_sent(PtpMsgBuf *buf, RawPtpMessage *msg)
RawPtpMessage * msgb_get_oldest(PtpMsgBuf *buf)
RawPtpMessage * msgb_get_by_uid(PtpMsgBuf *buf, uint32_t uid)
void msgb_report(PtpMsgBuf *buf)
void msgb_init(PtpMsgBuf *buf, PtpMsgBufBlock *pool, uint32_t n)
PtpMsgBufError
Error enumeration for the message buffer.
@ MSGB_ERR_FULL
The buffer is full, cannot allocate a slot.
@ MSGB_ERR_MISC
Miscellaneous allocation error.
@ MSGB_ERR_EXISTS
An allocated message has already been stored under the same tag.
void msgb_commit(PtpMsgBuf *buf, RawPtpMessage *msg)
RawPtpMessage * msgb_get_sent_by_tag(PtpMsgBuf *buf, uint32_t tag)
uint32_t msgb_get_uid(const PtpMsgBuf *buf, const RawPtpMessage *msg)
RawPtpMessage * msgb_alloc(PtpMsgBuf *buf, uint32_t tag, uint32_t ttl)
void msgb_free(PtpMsgBuf *buf, RawPtpMessage *msg)
void msgb_tick(PtpMsgBuf *buf)
uint32_t msgb_get_error(PtpMsgBuf *buf)
This module defines the fundamental PTP message and state machine type, flags, bitfields and the PTP ...
PTP message buffer entry.
bool allocated
This block has been allocated.
bool committed
This block has been committed.
RawPtpMessage msg
The contained PTP message.
bool sent
This block has been sent.
uint32_t ttl
Time-to-Live in ticks.
uint32_t uid
Unique ID, a sequence number.
PtpMsgBufBlock * blocks
Block pool.
uint32_t n
Number of blocks.
uint32_t used
Number of used blocks.
uint32_t lastUId
Last UID.
uint32_t error
Last error.