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

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

Merged
merged 3 commits into from
Mar 13, 2015

Conversation

miri64
Copy link
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
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
Member Author

miri64 commented Mar 6, 2015

Well we have travis :D

@miri64
Copy link
Member Author

miri64 commented Mar 6, 2015

(otherwise feel free to reassign ;-))

/**
* @brief Maximum length of an IPv6 address as string.
*/
/* take also encapsulated IPv4 address in account */
Copy link
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
Member

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

@OlegHahm
Copy link
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
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
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
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
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