Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13123 )

Change subject: add osmo_ip_port API
......................................................................


Patch Set 4:

(2 comments)

https://gerrit.osmocom.org/#/c/13123/4/include/osmocom/core/ip_port.h
File include/osmocom/core/ip_port.h:

https://gerrit.osmocom.org/#/c/13123/4/include/osmocom/core/ip_port.h@47
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.


https://gerrit.osmocom.org/#/c/13123/4/include/osmocom/core/ip_port.h@80
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 https://gerrit.osmocom.org/13123
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63
Gerrit-Change-Number: 13123
Gerrit-PatchSet: 4
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <[email protected]>
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-CC: Harald Welte <[email protected]>
Gerrit-Comment-Date: Fri, 08 Mar 2019 11:20:18 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No

Reply via email to