Change in libosmocore[master]: add osmo_ip_port API
gerrit-no-reply at lists.osmocom.org
Tue Mar 5 10:05:32 UTC 2019
Harald Welte has posted comments on this change. ( https://gerrit.osmocom.org/13123 )
Change subject: add osmo_ip_port API
Patch Set 4:
I'm not opposed to merging this, I'm just raising some random questions that come to my mind. Feel free to use or ignore them. To me it seems like quite a bit of extra "abstraction" for what is essentialy containing the exact same information as sockaddr_storage.
PS4, Line 47: osmo_ip_port
basically this looks like you're reinventing sockaddr_storage which is usually typecast to sockaddr_in / sockaddr_in6?
I guess the only difference is that you're keeping the ip address as string, where as sockaddr_* keeps it in binary format.
Is that really worth it? Could we not simply have a set of utility functions that work on sockaddr_storage instead? O r are our accesses 99% of the time for the string, and we basically want to cache the string and avoid converting from binary to string all the time?
PS4, Line 51: 46
there is a #define for the maximum length of an IPv6 address in string format somewhere in libc, AFAIR
PS4, Line 80: osmo_ip_port_to_32
normal convention in osmocom is lke memcpy(): Output argument is first, followed by input argument[s].
To view, visit https://gerrit.osmocom.org/13123
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-CC: Harald Welte <laforge at gnumonks.org>
Gerrit-Comment-Date: Tue, 05 Mar 2019 10:05:32 +0000
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gerrit-log