<p><a href="https://gerrit.osmocom.org/13123">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/13123/4/include/osmocom/core/ip_port.h">File include/osmocom/core/ip_port.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13123/4/include/osmocom/core/ip_port.h@47">Patch Set #4, Line 47:</a> <code style="font-family:monospace,monospace"></code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">my point was not that people should use sockaddr_storage directly, but that instead of this proposed […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I understand the attractive / leaner approach of using operating system structs. But storing in sockaddr seems a weird choice for talking to an MGW.</p><p style="white-space: pre-wrap; word-wrap: break-word;">For logging, the conversion is a bit cumbersome because both the IP address string and the port number need converting from sockaddr_storage. I can see a const char *osmo_sockaddr_name() function for direct logging. Next, for writing to MGCP messages I need the IP as string and a host-order uint16_t separately (or an integer in a string, but %d is good enough). The way I'd write that conversion to string and host-byte-order-port is provide an output struct for the conversion result, to avoid having to pass two out-args, and that would then be exactly struct osmo_ip_port. Argued from a different angle, these functions already allow sockaddr_storage as ip:port storage, and provide conversion to string:port and back...?</p><p style="white-space: pre-wrap; word-wrap: break-word;">It seems that this belongs closer to MGCP, would it be ok to place this as-is in libosmo-mgcp-client instead?<br>(would be the least amount of work to get past this topic)</p><p style="white-space: pre-wrap; word-wrap: break-word;">Otherwise rename to struct osmo_sockaddr_str with slightly shuffled function signatures?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/13123/4/include/osmocom/core/ip_port.h@80">Patch Set #4, Line 80:</a> <code style="font-family:monospace,monospace">osmo_ip_port_to_in</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">this comment holds true whether or not we use sockaddr_storage, and whether or not we merge it to li […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I was applying the object-oriented paradigm of</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">   function(object-instance, other arguments)</pre><p style="white-space: pre-wrap; word-wrap: break-word;">Can change to out-arg first</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/13123">change 13123</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/13123"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63 </div>
<div style="display:none"> Gerrit-Change-Number: 13123 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Max <msuraev@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 11 Mar 2019 05:37:21 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>