Skip to content

ng_net: add new version of NETAPI#2400

Merged
miri64 merged 1 commit intoRIOT-OS:masterfrom
haukepetersen:ng_netapi
Feb 10, 2015
Merged

ng_net: add new version of NETAPI#2400
miri64 merged 1 commit intoRIOT-OS:masterfrom
haukepetersen:ng_netapi

Conversation

@haukepetersen
Copy link
Copy Markdown
Contributor

as promised the simplified version of netapi, cut down to a very nice manageable size of ~50 lines of code...

@haukepetersen haukepetersen added NSTF Area: network Area: Networking labels Feb 6, 2015
@haukepetersen haukepetersen added this to the Network Stack Task Force milestone Feb 6, 2015
@miri64 miri64 self-assigned this Feb 6, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can't this one be inline now? With

static inline int ng_netapi_send(kernel_pid_t pid, ng_pktsnip_t *pkt)
{
    msg_t msg = { NETAPI_MSG_TYPE_SND, { pkt }};
    return msg_send(&msg, pid);
}

What do the experts on this, as @Kijewski, say?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm, would look nice! But I don't know about the static initializer with a variable in it...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Compare

#define MUTEX_INIT { 0, PRIORITY_QUEUE_INIT }
and
static inline void mutex_init(mutex_t *mutex)
and check their usage.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I meant the whole function. Not the struct initialization.

@haukepetersen haukepetersen added the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Feb 6, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it's not restricted to neighboring modules, is it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

not technically restricted, but it's meant to be used that way...

@miri64 miri64 mentioned this pull request Feb 7, 2015
36 tasks
@LudwigKnuepfer LudwigKnuepfer changed the title ng_net: added new version of NETAPI ng_net: add new version of NETAPI Feb 7, 2015
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[ Application | Socket ] < netapi > [ Transport Layer ] ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes. That's old doc by me.

@miri64 miri64 mentioned this pull request Feb 8, 2015
@haukepetersen
Copy link
Copy Markdown
Contributor Author

addressed documentation flaw pointed out by @LudwigOrtmann

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it make sense to indicate different transport/network layers here as well?
Also I'm missing the integrated transport layer driver.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

By the way - I'm expecting a merged transport/network layer as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So what you are saying is: This graphic is not complicated enough in your eyes? ;-P

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm saying it's misleading.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's just one example of how to use it. So one can at least understand easy, what this is good for.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In that case: why are there several applications and mac layers?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Although - for my definition of 'what this is good for', I'd rather illustrate more (as indicated above) then less.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually I threw this image out -> it is/will be part of the network stack documentation in the wiki and paper and so on anyway, so in my opinion it's not something that belongs into the code.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

addressed comments

@haukepetersen
Copy link
Copy Markdown
Contributor Author

fixed includes

@haukepetersen
Copy link
Copy Markdown
Contributor Author

I guess if there is nothing bad we can see, it would be nice if someone could ack this PR, because many others are depending on this...

@miri64
Copy link
Copy Markdown
Member

miri64 commented Feb 9, 2015

ACK if squashed and Travis passes. NACK, spotted some last second errors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Intentation

@haukepetersen
Copy link
Copy Markdown
Contributor Author

fixed indention

@cgundogan
Copy link
Copy Markdown
Member

ACK, but I think this PR has dependencies to other PRs?

+#include "net/ng_netconf.h"
+#include "net/ng_pktsnip.h"

@haukepetersen
Copy link
Copy Markdown
Contributor Author

jap, but like I said, the four basic elements (pktbuf, netapi, netdev and netreg) pretty much depend on each other in a circular fassion... So I think it makes no sense to try to base them on each other - I would just merge all of them singularily

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants