-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys/net/network_layer/ipv4/addr: add ipv4_addr_print function #18694
Conversation
Murdock results✔️ PASSED 6c98a5b sys/net/network_layer/ipv4/addr: add ipv4_addr_print function
ArtifactsThis only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now. |
ac96a07
to
6c98a5b
Compare
{ | ||
assert(addr); | ||
char addr_str[IPV4_ADDR_MAX_STR_LEN]; | ||
ipv4_addr_to_str(addr_str, addr, sizeof(addr_str)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this function implemented? Wouldn't it make sense to add ipv4_addr_print()
there as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ipv4_addr_to_str
can be found in net/ipv4/addr.h
like ipv6_addr_to_str
can be found in net/ipv6/addr.h
. I'm just placing the IPv4 variants relative to their respective IPv6 counterparts ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In net/ipv6/addr.h
there is just the definition of ipv4_addr_to_str()
, but I now saw, that they are in their own compile unit ipv6_addr_to_str.c
. So nvm.
Contribution description
Adds the function
ipv4_addr_print
, similar to the already existing toipv6_addr_print
.Issues/PRs references
Dependency for and split out from #16853