Skip to content

ipv4_addr: initial import#3608

Merged
miri64 merged 2 commits intoRIOT-OS:masterfrom
miri64:ipv4_addr/api/initial
Sep 11, 2015
Merged

ipv4_addr: initial import#3608
miri64 merged 2 commits intoRIOT-OS:masterfrom
miri64:ipv4_addr/api/initial

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Aug 11, 2015

This provides just the type and string conversion functions.

@miri64 miri64 added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Aug 11, 2015
@miri64 miri64 added this to the Release 2015.08 milestone Aug 11, 2015
@OlegHahm OlegHahm assigned kaspar030 and unassigned OlegHahm Aug 11, 2015
@OlegHahm
Copy link
Copy Markdown
Member

Re-assigned to @kaspar030, since he implemented some IPv4 stuff.

Makefile.dep Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why?

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.

Because it uses it for the IPv4 compatible addresses.

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 basically took those static functions out of there)

@kaspar030
Copy link
Copy Markdown
Contributor

Just FIY, in my code, I'll probably always use uint32_t to store and handle IPv4 addresses.

@kaspar030
Copy link
Copy Markdown
Contributor

Which means, IMHO this adds unnecessary cruft to net/ipv4.h. Same for ipv6.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 11, 2015

Main motivation for this module is to provide the wrapper promised in #3607. For this we need a pair of publicly available IPv4 string conversion function which this module provides.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 11, 2015

(and to full-fill the promise given in the comments of ipv6_addr_to_str.c/ipv6_addr_from_str() ;-))

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 11, 2015

Addressed comments

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 17, 2015

Rebased to current master

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 wondering if the check for result_len makes any sense as it proves nothing regarding the length of result. And it isn't used for anything else like condition or loop control. So it may be removed completely?

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.

It's a very fig-leaf security measurement I give you that, but as commented above: this code is not originally by myself.

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.

Didn't want to blame anyone. :-)
And I overlooked that the function signature may not be changed.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 18, 2015

Addressed @A-Paul's comment

miri64 added a commit to miri64/RIOT that referenced this pull request Aug 18, 2015
miri64 added a commit that referenced this pull request Aug 18, 2015
ipv6_addr: adapt doc to proposed changes in #3608
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 18, 2015

Rebased to current master.

@miri64 miri64 force-pushed the ipv4_addr/api/initial branch from 0bede36 to ee4875f Compare August 18, 2015 21:51
@miri64 miri64 force-pushed the ipv4_addr/api/initial branch from ee4875f to b2b98c5 Compare August 26, 2015 11:51
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Aug 26, 2015

Rebased to current master

@kaspar030
Copy link
Copy Markdown
Contributor

Could someone else review this? I don't like it - it has half as many lines as my whole IPv4 stack.

@kaspar030 kaspar030 removed their assignment Sep 5, 2015
@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Sep 6, 2015

@kaspar030, from what I can see most of the lines contain documentation or tests. The question why do we need this without support for IPv4?

@haukepetersen
Copy link
Copy Markdown
Contributor

This PR looks ok to me, the only thing I strongly dislike is the dependency from IPv6 to IPv4! I would rather have this in optional: If the IPv4 module is used, then include the IPv4 encapsulation into IPv6 - so do not do this per default!

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 7, 2015

@haukepetersen I know I repeat myself, but the inclusion of IPv4 is already part of the current master. This PR just exposes this for everyone to use. In the end this is a string conversion function and string conversion for IPv6 is already quite fat in itself (due to the 0-compression). IPv4 address conversion on the other hand is quite simple, so only a fraction of the comparably large IPv6 code. Since string conversion isn't meant to be in production code anyway (correct me if I'm wrong) I'm more in favor of having a few bytes more of code, just to handle legal (but arguably complicated) IPv6 addresses.

@miri64 miri64 closed this Sep 7, 2015
@miri64 miri64 reopened this Sep 7, 2015
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 7, 2015

Sorry, hit the wrong button.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 7, 2015

The question why do we need this without support for IPv4?

Because we want inet_pton/inet_ntop support independent from the old-stack-style net_helpmodule.

@miri64 miri64 force-pushed the ipv4_addr/api/initial branch 2 times, most recently from f18a83a to b87376e Compare September 7, 2015 12:44
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 7, 2015

Rebased

@kaspar030
Copy link
Copy Markdown
Contributor

@authmillenon Just a question - what boards are you using to test your code on?

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 7, 2015

native, iotlab-m3 and samr21-xpro

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 7, 2015

(plan to use msba2 again, as soon as cc11xx support is back)

@kaspar030
Copy link
Copy Markdown
Contributor

kaspar030 commented Sep 7, 2015 via email

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Sep 7, 2015

@kaspar030, how concrete is your plan to PR the nanostack anytime soon?

@kaspar030
Copy link
Copy Markdown
Contributor

Hey,

On 09/07/15 18:13, Oleg Hahm wrote:

@kaspar030, how concrete is your plan to PR the nanostack anytime soon?

When I find time, after the release. But it will probably come with it's
own, embedded-style, ipv4 shell support.

@OlegHahm OlegHahm added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 11, 2015
@OlegHahm
Copy link
Copy Markdown
Member

ACK

@miri64 miri64 force-pushed the ipv4_addr/api/initial branch from b87376e to be587ca Compare September 11, 2015 14:32
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 11, 2015

Fixed doc issue and squashed immediately.

@cgundogan
Copy link
Copy Markdown
Member

Do you want to make this optional for module ipv6_addr instead of pulling it in automatically?

@OlegHahm
Copy link
Copy Markdown
Member

Do you want to make this optional for module ipv6_addr instead of pulling it in automatically?

👍

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 11, 2015

As a follow-up, yes.

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Sep 11, 2015

See #3822.

miri64 added a commit that referenced this pull request Sep 11, 2015
@miri64 miri64 merged commit b9fcd2b into RIOT-OS:master Sep 11, 2015
@miri64 miri64 deleted the ipv4_addr/api/initial branch September 11, 2015 18:03
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: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants