Change in libosmo-netif[master]: Introduce osmo_prim_srv APIs

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Nov 30 17:56:23 UTC 2021


pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/26426 )

Change subject: Introduce osmo_prim_srv APIs
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/libosmo-netif/+/26426/1/src/prim.c 
File src/prim.c:

https://gerrit.osmocom.org/c/libosmo-netif/+/26426/1/src/prim.c@39 
PS1, Line 39: osmo_prim_pkt_alloc
> not sure what a prim_pkt is?   I don't think we've used this so far? […]
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.

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.


https://gerrit.osmocom.org/c/libosmo-netif/+/26426/1/src/prim.c@65 
PS1, Line 65: lcr
> lcr? […]
lcr: typo, I'll fix.

Yes, current implementation (I took pcuif sock in osmo-bts/osmo-bsc as a reference) supports only 1 client.
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.

typedef int (*osmo_prim_srv_rx_cb)(struct osmo_prim_srv *srv, int conn_id, struct osmo_prim_hdr *oph);

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).

I'd probably have to add also some new APIs like osmo_priv_srv_close_conn(srv, conn_id).

Finally, osmo_prim_srv_send(struct osmo_prim_srv *srv, struct msgb *msg) would become:
osmo_prim_srv_send(struct osmo_prim_srv *srv, int conn_id, struct msgb *msg);



-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/26426
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I7cab15ac092e45a256c4f0bab11b3962df861044
Gerrit-Change-Number: 26426
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge at osmocom.org>
Gerrit-Comment-Date: Tue, 30 Nov 2021 17:56:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge at osmocom.org>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211130/a6a7ce2c/attachment.htm>


More information about the gerrit-log mailing list