llsk: Add APIs to interact with llsk->link

This also clarifies the type of available uses/features.

Change-Id: I7723467d34670f89710f55c0c6731e2e38560f35
This commit is contained in:
Pau Espin 2024-03-12 18:25:44 +01:00
parent d3cd9e7afa
commit ab8db8fabd
4 changed files with 16 additions and 4 deletions

View File

@ -30,6 +30,8 @@ struct hnb;
struct rtp_conn; struct rtp_conn;
int hnb_llsk_alloc(struct hnb *hnb); int hnb_llsk_alloc(struct hnb *hnb);
void hnb_llsk_free(struct hnb *hnb);
int hnb_llsk_start_listen(struct hnb *hnb);
bool hnb_llsk_connected(const struct hnb *hnb); bool hnb_llsk_connected(const struct hnb *hnb);
bool hnb_llsk_can_be_configured(struct hnb *hnb); bool hnb_llsk_can_be_configured(struct hnb *hnb);

View File

@ -88,9 +88,7 @@ void hnb_free(struct hnb *hnb)
} }
hnb_iuh_free(hnb); hnb_iuh_free(hnb);
osmo_timer_del(&hnb->llsk.defer_configure_ind_timer); hnb_llsk_free(hnb);
osmo_prim_srv_link_free(hnb->llsk.link);
hnb->llsk.link = NULL;
hnb_gtp_unbind(hnb); hnb_gtp_unbind(hnb);

View File

@ -219,3 +219,15 @@ int hnb_llsk_alloc(struct hnb *hnb)
osmo_timer_setup(&hnb->llsk.defer_configure_ind_timer, llsk_defer_configure_ind_timer_cb, hnb); osmo_timer_setup(&hnb->llsk.defer_configure_ind_timer, llsk_defer_configure_ind_timer_cb, hnb);
return 0; return 0;
} }
void hnb_llsk_free(struct hnb *hnb)
{
osmo_timer_del(&hnb->llsk.defer_configure_ind_timer);
osmo_prim_srv_link_free(hnb->llsk.link);
hnb->llsk.link = NULL;
}
int hnb_llsk_start_listen(struct hnb *hnb)
{
return osmo_prim_srv_link_open(g_hnb->llsk.link);
}

View File

@ -275,7 +275,7 @@ int main(int argc, char **argv)
} }
/* Start listening on lower layer unix domain socket: */ /* Start listening on lower layer unix domain socket: */
rc = osmo_prim_srv_link_open(g_hnb->llsk.link); rc = hnb_llsk_start_listen(g_hnb);
if (rc < 0) { if (rc < 0) {
perror("Error opening lower layer socket"); perror("Error opening lower layer socket");
exit(1); exit(1);