You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "m-gorecki (via GitHub)" <gi...@apache.org> on 2025/11/13 16:36:17 UTC
[PR] kernel/os_mbuf: Add new helpers [mynewt-core]
m-gorecki opened a new pull request, #3542:
URL: https://github.com/apache/mynewt-core/pull/3542
This adds new helpers to append and consume mbuf data in a more convinient way
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] kernel/os_mbuf: Add new helpers [mynewt-core]
Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on code in PR #3542:
URL: https://github.com/apache/mynewt-core/pull/3542#discussion_r2798053227
##########
kernel/os/include/os/os_mbuf.h:
##########
@@ -440,6 +440,95 @@ struct os_mbuf *os_mbuf_off(const struct os_mbuf *om, int off,
*/
int os_mbuf_copydata(const struct os_mbuf *om, int off, int len, void *dst);
+/**
+ * Extracts data from the beginning of an mbuf into a flat buffer, consuming it in the process.
+ *
+ * @param om The mbuf chain to extract data from
+ * @param len The length of the data to copy
+ * @param dst The destination buffer to copy into
+ *
+ * @return 0 on success;
+ * -1 if the mbuf does not contain enough data.
+ */
+int os_mbuf_consume_data(struct os_mbuf *om, int len, void *dst);
Review Comment:
name this (and others) _pull
len could be size_t
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org