From ab8db8fabd2e4cc8e19806c06719f5a5261729d8 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 12 Mar 2024 18:25:44 +0100 Subject: [PATCH] llsk: Add APIs to interact with llsk->link This also clarifies the type of available uses/features. Change-Id: I7723467d34670f89710f55c0c6731e2e38560f35 --- include/osmocom/hnodeb/llsk.h | 2 ++ src/osmo-hnodeb/hnb.c | 4 +--- src/osmo-hnodeb/llsk.c | 12 ++++++++++++ src/osmo-hnodeb/main.c | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/osmocom/hnodeb/llsk.h b/include/osmocom/hnodeb/llsk.h index bde531a..6a2686a 100644 --- a/include/osmocom/hnodeb/llsk.h +++ b/include/osmocom/hnodeb/llsk.h @@ -30,6 +30,8 @@ struct hnb; struct rtp_conn; 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_can_be_configured(struct hnb *hnb); diff --git a/src/osmo-hnodeb/hnb.c b/src/osmo-hnodeb/hnb.c index 1d03826..ad56dcc 100644 --- a/src/osmo-hnodeb/hnb.c +++ b/src/osmo-hnodeb/hnb.c @@ -88,9 +88,7 @@ void hnb_free(struct hnb *hnb) } hnb_iuh_free(hnb); - osmo_timer_del(&hnb->llsk.defer_configure_ind_timer); - osmo_prim_srv_link_free(hnb->llsk.link); - hnb->llsk.link = NULL; + hnb_llsk_free(hnb); hnb_gtp_unbind(hnb); diff --git a/src/osmo-hnodeb/llsk.c b/src/osmo-hnodeb/llsk.c index b76b595..7e25176 100644 --- a/src/osmo-hnodeb/llsk.c +++ b/src/osmo-hnodeb/llsk.c @@ -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); 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); +} diff --git a/src/osmo-hnodeb/main.c b/src/osmo-hnodeb/main.c index e724791..d542c06 100644 --- a/src/osmo-hnodeb/main.c +++ b/src/osmo-hnodeb/main.c @@ -275,7 +275,7 @@ int main(int argc, char **argv) } /* 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) { perror("Error opening lower layer socket"); exit(1);