Skip to content

af: initial import of global AF_ definition header#3660

Merged
miri64 merged 2 commits intoRIOT-OS:masterfrom
miri64:af/api/initial
Aug 25, 2015
Merged

af: initial import of global AF_ definition header#3660
miri64 merged 2 commits intoRIOT-OS:masterfrom
miri64:af/api/initial

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Aug 18, 2015

There are a lot of redefinitions of the AF_ macros. This PR once and for all defines them all in a central place that is not dependent from POSIX. I chose to define them in a similar fashion as they are defined in Linux: as an enum, that is also exposed to the preprocessor. This way the arbitrary numbering is left to the compiler, while the predecessor also can access these constants (and as a bonus can simply convert them to strings with the # operand).

@miri64 miri64 added Area: POSIX Area: POSIX API wrapper Area: network Area: Networking Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Aug 18, 2015
@miri64 miri64 added this to the Release 2015.08 milestone Aug 18, 2015
@miri64 miri64 force-pushed the af/api/initial branch 2 times, most recently from e2d3712 to ce51fbd Compare August 18, 2015 23:46
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 19, 2015

I removed most of the address families defined in socket_base/socket.h because I really don't expect them to be implemented in RIOT ever (I'm not even that optimistic about AF_UNIX, but at least that is required in the POSIX specification).

I also removed the PF_ macros, since they seem kind of redundant to me and also are not mentioned in the POSIX specification. NHDP was the only reference of them so I changed it to the equivalent AF_ macro.

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.

OT: the net/ipv6 and net/ng_ipv6 will get merged to net/ipv6 soon-ish right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No net/ipv6 was taken out of GNRC and is independent of it (it contains general definitions like addresses, headers and related functions). net/ng_ipv6.h was moved to net/gnrc/ipv6.h yesterday.

@cgundogan
Copy link
Copy Markdown
Member

OT: the net/ipv6 and net/ng_ipv6 will get merged to net/ipv6 soon-ish right?

AFAIU, net/ipv6 is more a common base for all ipv6 stacks, while net/ng_ipv6, or possibly in the future net/gnrc_ipv6 is pulling in net/ipv6

@BytesGalore
Copy link
Copy Markdown
Member

@cgundogan ok, I misinterpreted it as part/step of the migration from the old stack.

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.

ok, really nitpicking: too much newlines

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

True :D

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 19, 2015

@cgundogan ok, I misinterpreted it as part/step of the migration from the old stack.

The old stack is gone since about 2 weeks or so. The only things left are a socket_base skeleton, which will be hopefully removed as soon as the new connection API was removed, and net_help.

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 didn't tested with oonf yet, but doesn't removing the both includes will harm using this package?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did not test it either, but judging from the diff it looked like those were only included for the AF_ macros.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems to be broken in master.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reworked the patch file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems to be broken in master.

No I'm just too stupid to use it ;-P

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

needs rebase :(

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 24, 2015

Done.

@BytesGalore
Copy link
Copy Markdown
Member

nice thx :)

seems we need AF_MAX in the enums [1]:

In file included from RIOT/pkg/oonf_api/oonf_api/src-api/common/avl_comp.h:46:0,
                 from RIOT/pkg/oonf_api/oonf_api/src-api/common/avl_comp.c:45:
RIOT/pkg/oonf_api/oonf_api/src-api/common/netaddr.h:74:14: error: ‘AF_MAX’ undeclared here (not in a function)
   AF_MAC48 = AF_MAX + 1,
              ^

[1] https://github.com/RIOT-OS/RIOT/pull/3660/files#diff-712c838674c0f484091fcc0da054fea7R40

@BytesGalore
Copy link
Copy Markdown
Member

ok, since we have no socket_base module the oonf [1] cannot be used currently.
I updated #3417 accordingly.

[1] https://github.com/RIOT-OS/RIOT/blob/master/Makefile.dep#L228

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 24, 2015

I could have told you that (but failed to update the issue too).

@BytesGalore
Copy link
Copy Markdown
Member

np :)
It seems that all is caught now, and all required AF_ are available.
Though, there's an unusual AF_CC110X definition for NHDP [1]

[1] https://github.com/RIOT-OS/RIOT/blob/master/sys/net/routing/nhdp/nhdp.h#L104

@BytesGalore
Copy link
Copy Markdown
Member

I would say please squash and lets see what travis says

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 24, 2015

Though, there's an unusual AF_CC110X definition for NHDP [1]

Saw it, though that it was implementation dependent and shrugged it off :D

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 24, 2015

Squashed

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable Area: POSIX Area: POSIX API wrapper labels Aug 24, 2015
@BytesGalore
Copy link
Copy Markdown
Member

nice, I would say ACK

miri64 added a commit that referenced this pull request Aug 25, 2015
af: initial import of global AF_ definition header
@miri64 miri64 merged commit 8820804 into RIOT-OS:master Aug 25, 2015
@miri64 miri64 deleted the af/api/initial branch August 25, 2015 07:14
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.

How did these additional white trailing spaces passed the CI?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some versions of git (my local e.g.) register patch files as binary files and thus ignore their content for patching, diff and whitespace checks.

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

Labels

Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants