[RFC] ng_ipv6_addr: add (optional) string conversion functions#2546
Merged
OlegHahm merged 3 commits intoRIOT-OS:masterfrom Mar 13, 2015
Merged
[RFC] ng_ipv6_addr: add (optional) string conversion functions#2546OlegHahm merged 3 commits intoRIOT-OS:masterfrom
OlegHahm merged 3 commits intoRIOT-OS:masterfrom
Conversation
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... |
Member
Author
|
Well we have travis :D |
Member
Author
|
(otherwise feel free to reassign ;-)) |
sys/include/net/ng_ipv6/addr.h
Outdated
Member
|
In the Interest of speeding things up I'll reassign... |
Member
|
Reassigning to me to me to speed things up? You daredevil! |
ebae2ed to
f1c63ea
Compare
Member
Author
|
Rebased to current master. |
Member
|
ACK |
f1c63ea to
b63d610
Compare
Member
Author
|
Rebased and fixed a minor doc error, travis was complaining about ;-) |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the functions
ng_ipv6_addr_to_str()andng_ipv6_addr_from_str()(basicallyinet_pton6()andinet_ntop6()specialized for our types [I only made small rewrites to them]) to theng_ipv6_addrmodule. 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_addris that it can be used forDEBUG()output without including thenet_helpmodule. Additionally, I was able to simplify the implementation was a little bit due to the benefits ofng_ipv6_addr_t(as opposed to just usingchar *) andnetwork_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.