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

netif: add functions to parse and output hardware addresses #2705

Merged
merged 2 commits into from
Apr 1, 2015

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Mar 24, 2015

Adds address parsing and string-conversion functions for hardware addresses in a similar way as I did for ng_ipv6_addr.

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation NSTF labels Mar 24, 2015
@@ -90,6 +90,41 @@ void ng_netif_remove(kernel_pid_t pid);
*/
kernel_pid_t *ng_netif_get(size_t *size);

/**
* @brief Converts a hardware address to a human readable format.
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe better: "Converts a hardware address to a \0 terminated string"

Copy link
Member Author

Choose a reason for hiding this comment

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

This sounds misleading: a '\0' terminated string can also just be the bytes of the address (not converted to hex strings!) + an appended '\0'

Copy link
Contributor

Choose a reason for hiding this comment

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

hm, ok. Just wanted to stress that the string is NULL terminated to be used in string functions (as printf("%s", ...)

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, I get your point will do s/format/string/. Does that suffice?

Copy link
Member Author

Choose a reason for hiding this comment

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

And done.

@miri64 miri64 force-pushed the netif/feat/addr-str branch from 789b6d3 to 04a895e Compare March 29, 2015 13:17
@miri64
Copy link
Member Author

miri64 commented Mar 29, 2015

Rebased to current master

@miri64 miri64 force-pushed the netif/feat/addr-str branch from 04a895e to 325b128 Compare March 30, 2015 01:10
@miri64
Copy link
Member Author

miri64 commented Mar 30, 2015

Rebased to current master

@miri64 miri64 force-pushed the netif/feat/addr-str branch from 325b128 to fe50e2a Compare March 30, 2015 02:00
@miri64
Copy link
Member Author

miri64 commented Mar 30, 2015

Rebased to current master (again Oo)

size_t addr_len);

/**
* @brief Parses a string of colon-seperated hexadecimals to a hardware
Copy link
Member

Choose a reason for hiding this comment

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

seperate -> separate

@miri64
Copy link
Member Author

miri64 commented Apr 1, 2015

Addressed comments and optimized netif_addr_from_str a little ;-)

@Lotterleben
Copy link
Member

thanks :)
I'm still not happy with the inconsistency of the return values, but I guess this compromise in favor of usability (ng_netif_addr_to_str ()) and resourcefulness (ng_netif_addr_from_str ()) is inevitable...
Let's squash and see what Travis says.

@miri64 miri64 force-pushed the netif/feat/addr-str branch from db0b14e to 1a0d97f Compare April 1, 2015 14:24
@miri64
Copy link
Member Author

miri64 commented Apr 1, 2015

Squashed.

@Lotterleben
Copy link
Member

Kicked Travis...

@miri64
Copy link
Member Author

miri64 commented Apr 1, 2015

And it's done

@Lotterleben
Copy link
Member

Here we go... ACK and go! :)

Lotterleben added a commit that referenced this pull request Apr 1, 2015
netif: add functions to parse and output hardware addresses
@Lotterleben Lotterleben merged commit 40acfa7 into RIOT-OS:master Apr 1, 2015
@miri64 miri64 deleted the netif/feat/addr-str branch April 1, 2015 23:05
@miri64 miri64 added the Area: network Area: Networking label Sep 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants