<p><a href="https://gerrit.osmocom.org/c/libosmo-netif/+/26426">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/libosmo-netif/+/26426/1/src/prim.c">File src/prim.c:</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/libosmo-netif/+/26426/1/src/prim.c@39">Patch Set #1, Line 39:</a> <code style="font-family:monospace,monospace">osmo_prim_pkt_alloc</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">not sure what a prim_pkt is?   I don't think we've used this so far? […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Yes, this makes sure though that nobody passes a wrongly allocated struct to osmo_prim_srv_send() later on, since there are several ways to allocate + pass/handle osmo_prim + msg.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In this case, we want to make sure that the oph is put in front of the msg, since we access it inside the API and we also require headroom to replace it with the serialized osmo_prim_pkt_hdr when sending over the IPC.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmo-netif/+/26426/1/src/prim.c@65">Patch Set #1, Line 65:</a> <code style="font-family:monospace,monospace">lcr</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">lcr? […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">lcr: typo, I'll fix.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Yes, current implementation (I took pcuif sock in osmo-bts/osmo-bsc as a reference) supports only 1 client.<br>I could add a "conn_id" param to the rx_cb to identify which user sent the prim. In this case, the conn_id would basically be internally the created fd for that specific UD socket.</p><p style="white-space: pre-wrap; word-wrap: break-word;">typedef int (*osmo_prim_srv_rx_cb)(struct osmo_prim_srv *srv, int conn_id, struct osmo_prim_hdr *oph);</p><p style="white-space: pre-wrap; word-wrap: break-word;">Not sure if we need conn_opened(struct osmo_prim_srv *srv, int conn_id) and conn_closed(struct osmo_prim_srv *srv, int conn_id) callbacks too. I guess we do if the server is the one to first send a message whenever the client connects (not our current case, but possible).</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd probably have to add also some new APIs like osmo_priv_srv_close_conn(srv, conn_id).</p><p style="white-space: pre-wrap; word-wrap: break-word;">Finally, osmo_prim_srv_send(struct osmo_prim_srv *srv, struct msgb *msg) would become:<br>osmo_prim_srv_send(struct osmo_prim_srv *srv, int conn_id, struct msgb *msg);</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-netif/+/26426">change 26426</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/c/libosmo-netif/+/26426"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-netif </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I7cab15ac092e45a256c4f0bab11b3962df861044 </div>
<div style="display:none"> Gerrit-Change-Number: 26426 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 30 Nov 2021 17:56:23 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>