Skip to content

[RFC] ng_ipv6_addr: add (optional) string conversion functions#2546

Merged
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
miri64:ng_ipv6_addr/api/add_string_functions
Mar 13, 2015
Merged

[RFC] ng_ipv6_addr: add (optional) string conversion functions#2546
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
miri64:ng_ipv6_addr/api/add_string_functions

Conversation

@miri64
Copy link
Copy Markdown
Member

@miri64 miri64 commented Mar 6, 2015

This adds the functions ng_ipv6_addr_to_str() and ng_ipv6_addr_from_str() (basically inet_pton6() and inet_ntop6() specialized for our types [I only made small rewrites to them]) to the ng_ipv6_addr module. They only are included into the binary if they are used (since they are implemented in their own .c-files), and only are intended for debug output and the shell.

The rational of including them to ng_ipv6_addr is that it can be used for DEBUG() output without including the net_help module. Additionally, I was able to simplify the implementation was a little bit due to the benefits of ng_ipv6_addr_t (as opposed to just using char *) and network_uint32_t (for IPv4) addresses.

I also removed one snprintf() call (for just creating a hexadecimal number) and replaced it with manual formation. This makes this implementation much better suited for embedded devices.

@miri64 miri64 added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. NSTF labels Mar 6, 2015
@miri64 miri64 added this to the Network Stack Task Force milestone Mar 6, 2015
@miri64 miri64 assigned OlegHahm and Lotterleben and unassigned OlegHahm Mar 6, 2015
@Lotterleben
Copy link
Copy Markdown
Member

Hi, a quick word of warning: I'm currently on vacation with only a tablet (gasp!), so I can only read the code, but not try anything out...

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 6, 2015

Well we have travis :D

@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 6, 2015

(otherwise feel free to reassign ;-))

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.

Into account

@miri64 miri64 mentioned this pull request Mar 7, 2015
@Lotterleben
Copy link
Copy Markdown
Member

In the Interest of speeding things up I'll reassign...

@OlegHahm
Copy link
Copy Markdown
Member

Reassigning to me to me to speed things up? You daredevil!

@miri64 miri64 assigned cgundogan and unassigned OlegHahm Mar 11, 2015
@miri64 miri64 force-pushed the ng_ipv6_addr/api/add_string_functions branch from ebae2ed to f1c63ea Compare March 11, 2015 22:36
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 11, 2015

Rebased to current master.

@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 Mar 12, 2015
@OlegHahm
Copy link
Copy Markdown
Member

ACK

@miri64 miri64 force-pushed the ng_ipv6_addr/api/add_string_functions branch from f1c63ea to b63d610 Compare March 12, 2015 20:08
@miri64
Copy link
Copy Markdown
Member Author

miri64 commented Mar 12, 2015

Rebased and fixed a minor doc error, travis was complaining about ;-)

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

All green

OlegHahm added a commit that referenced this pull request Mar 13, 2015
…g_functions

[RFC] ng_ipv6_addr: add (optional) string conversion functions
@OlegHahm OlegHahm merged commit 0144bb5 into RIOT-OS:master Mar 13, 2015
@miri64 miri64 deleted the ng_ipv6_addr/api/add_string_functions branch March 13, 2015 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. 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.

4 participants