Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netapi: adapt to pkt_t #2286

Closed
wants to merge 5 commits into from
Closed

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Jan 12, 2015

Simplifies netapi quiet a bit.

Depends on #2158 (merged). There is also a small dependency on #1968 (merged) or vice-versa, but I'll just will fix the PR that get's merged later ;-)

Depends on #2285

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking labels Jan 12, 2015
@miri64 miri64 added this to the Release NEXT MAJOR milestone Jan 12, 2015
#endif

/**
* @brief Definition of protocol families to determine the type of the packet or which protocols a network device (see @ref netdev) or protocol layer (see @ref netapi) can handle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line length...

@haukepetersen
Copy link
Contributor

I like the idea of the pkt type. I would actually strongly opt for removing the (redundant) hlist data-structue and also remove the hlist from the functions naming -> keep it as simple as possible!

@miri64
Copy link
Member Author

miri64 commented Jan 13, 2015

But headers are no packets. As someone not familiar with this I would be very confused if I see packets get stuffed into packets. Furthermore, the semantics become very different in the packet buffer (only pkt_t can created, pkt_hlist_ts can only be prepended/removed from pkt_t.

Think of the pkt_t as head type of the of a list with pkt_hlist_t nodes and pktbuf as its factory.

@miri64
Copy link
Member Author

miri64 commented Jan 13, 2015

TL;DR while removing pkt_list_t would reduce complexity in terms of LOC, I would find the API less understandable.

@miri64
Copy link
Member Author

miri64 commented Jan 13, 2015

Afterthought: You commented on the wrong PR. Please discuss introduction of pkt_t and pkt_hlist_t in #2158 ;-)

@miri64 miri64 mentioned this pull request Jan 13, 2015
@miri64 miri64 force-pushed the netapi/api/use-pkt_t branch from d6608d5 to 216d580 Compare January 13, 2015 03:20
@miri64
Copy link
Member Author

miri64 commented Jan 13, 2015

Rebased to make changes apparent here, too. ;-)

@haukepetersen
Copy link
Contributor

I thought about this a bit more: I would actually vote for renaming the thing completely to something like chunk_t, getting away from packets/headers all together. So all you do in the network stack is allocating chunks of memory in the chunkbuf. Or maybe we can call it crumb_t / crumbstore or something...

Anyway, as I see it the buffer can be used for more than just packet/header buffering, why not use it also to store addresses or whatever?

Regarding the API: I don't think we need a dedicated API for headers, by just working on a generic data structure we simplify/shorten code with the same results - in the end it's not the genuine user that is working inside the network stack - but people who know at least to some extend what they are doing...

@haukepetersen
Copy link
Contributor

oh, just noticed: this comment should have probably been posted for #2158, sorry

@LudwigKnuepfer
Copy link
Member

@authmillenon please rebase

@miri64 miri64 force-pushed the netapi/api/use-pkt_t branch from 216d580 to f59f9ee Compare January 14, 2015 11:23
@miri64
Copy link
Member Author

miri64 commented Jan 14, 2015

Rebased to #2285 and added it as dependency in description + ported nomac to the api change.

@miri64 miri64 force-pushed the netapi/api/use-pkt_t branch 4 times, most recently from 74d8012 to 6af9538 Compare January 14, 2015 11:32
@OlegHahm OlegHahm modified the milestones: Release NEXT MAJOR, Network Stack Task Force Feb 6, 2015
@OlegHahm OlegHahm added NSTF and removed NSTF labels Feb 6, 2015
@miri64
Copy link
Member Author

miri64 commented Feb 8, 2015

Closed in favor for #2400

@miri64 miri64 closed this Feb 8, 2015
@miri64 miri64 deleted the netapi/api/use-pkt_t branch February 8, 2015 12:38
@miri64 miri64 removed this from the Network Stack Task Force milestone Feb 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants