Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: buf: add linearize, append_bytes and skip APIs to net_buf
This change moves the logic for linearize and append_bytes from the net_pkt sources into the net_buf sources where it can be made available to layers which to not depend on net_pkt. It also, adds a new net_buf_skip() function which can be used to iterated through a list of net_buf (freeing the buffers as it goes). For the append_bytes function to be generic in nature, a net_buf allocator callback was created. Callers of append_bytes pass in the callback which determines where the resulting net_buf is allocated from. Also, the dst buffer in linearize is now cleared prior to copy (this was an addition from the code moved from net_pkt). In order to preserve existing callers, the original functions are left in the net_pkt layer, but now merely act as wrappers. Signed-off-by: Michael Scott <mike@foundries.io>
- Loading branch information
1 parent
4016136
commit db577f0
Showing
3 changed files
with
172 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters