net/netbuf: introduce network buffer abstraction (v2.0)#12691
Closed
jia200x wants to merge 1 commit intoRIOT-OS:masterfrom
Closed
net/netbuf: introduce network buffer abstraction (v2.0)#12691jia200x wants to merge 1 commit intoRIOT-OS:masterfrom
jia200x wants to merge 1 commit intoRIOT-OS:masterfrom
Conversation
Member
Author
|
@kaspar030 does this work for your use case? |
This was referenced Nov 13, 2019
Closed
Member
Author
|
With #13771 this becomes outdated. I will close it |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
Towards an network stack independent
netif(#12688), this proposes an API for stack independent packet allocation, release and access to content.This approach replaces #12315 since it's cleaner and a smaller step.
Each network stack needs to define these 3 functions:
netbuf_alloc: allocate a network buffernetbuf_free: free the resources associated to the network buffernetbuf_get_iolist: getiolist_trepresentation of the network buffer.With these functions, it's possible e.g to remove all GNRC pktbuf specific functions in
gnrc_netif_ieee802154, so this layer can be reused by other network stacks (it still requires somenetifabstract functions but that would come soon :).I'm also naming it "netbuf" and not "netif_pkt_t" because this is intended to represent the data of the pkt and not the metadata. As discussed with @miri64 offline, there might be something like:
So the
netifreceive function could look like:RFC
Testing procedure
Check the documentation build ok:
make doc.Issues/PRs references
Replaces #12315
#12688