Change in libosmocore[master]: add osmo_ip_port API

Harald Welte gerrit-no-reply at
Fri Mar 8 11:20:18 UTC 2019

Harald Welte has posted comments on this change. ( )

Change subject: add osmo_ip_port API

Patch Set 4:

File include/osmocom/core/ip_port.h:
PS4, Line 47: osmo_ip_port
> - sockaddr stores the port in network byte order, each log line would have to remember to call ntohs […]
my point was not that people should use sockaddr_storage directly, but that instead of this proposed patch, one could probably simply have a set of utility functions that work on sockaddr_storage instead of a custom-invented struct.  The string-to-binary and binary-to-string conversions could then be hidden by that API.

There is no compilation problem with "ARM" per se.  There might be problems if you're building something intended for a Linux/Posix-style operating system on a "bare iron" embedded system, such as the builds we do for the osmocombb firmware (and possibly more firmware projects in the near future).  As those sysdtems have no IP adresses to begin with, the safe chocie is to simply not build anything related to networking on them.

I'd like to see other people's comments on this.  I personally don't think it looks like something that I'd want to see as part of the standard libosmocore infrastructure. At least not unless I see a strong reason against my "have same API but use sockaddr_storage + conversion underneath" proposal.
PS4, Line 80: osmo_ip_port_to_32
> normal convention in osmocom is lke memcpy(): Output argument is first, followed by input argument[s […]
this comment holds true whether or not we use sockaddr_storage, and whether or not we merge it to libosmocore or osmo-mgw.git

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63
Gerrit-Change-Number: 13123
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at>
Gerrit-CC: Harald Welte <laforge at>
Gerrit-Comment-Date: Fri, 08 Mar 2019 11:20:18 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list