pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40268?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Introduce func helper hnbgw_sccp_user_get_sccp_instance()
......................................................................
Introduce func helper hnbgw_sccp_user_get_sccp_instance()
This way we keep struct field access within the header file.
Change-Id: I1684fa1871098ab6df7c79c9c0e0daf6c6f35b09
---
M include/osmocom/hnbgw/cnlink.h
M include/osmocom/hnbgw/hnbgw_sccp.h
2 files changed, 8 insertions(+), 3 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/hnbgw/cnlink.h b/include/osmocom/hnbgw/cnlink.h
index c4e494d..fd1b7de 100644
--- a/include/osmocom/hnbgw/cnlink.h
+++ b/include/osmocom/hnbgw/cnlink.h
@@ -108,9 +108,7 @@
return NULL;
if (!cnlink->hnbgw_sccp_user)
return NULL;
- if (!cnlink->hnbgw_sccp_user->ss7)
- return NULL;
- return osmo_ss7_get_sccp(cnlink->hnbgw_sccp_user->ss7);
+ return hnbgw_sccp_user_get_sccp_instance(cnlink->hnbgw_sccp_user);
}
/* cnlink_fsm.c related: */
diff --git a/include/osmocom/hnbgw/hnbgw_sccp.h b/include/osmocom/hnbgw/hnbgw_sccp.h
index d207348..4388a3a 100644
--- a/include/osmocom/hnbgw/hnbgw_sccp.h
+++ b/include/osmocom/hnbgw/hnbgw_sccp.h
@@ -57,3 +57,10 @@
int hnbgw_sccp_user_tx_data_req(struct hnbgw_sccp_user *hsu, uint32_t scu_conn_id,
struct msgb *ranap_msg);
int hnbgw_sccp_user_tx_disconnect_req(struct hnbgw_sccp_user *hsu, uint32_t
scu_conn_id);
+
+static inline struct osmo_sccp_instance *hnbgw_sccp_user_get_sccp_instance(const struct
hnbgw_sccp_user *hsu)
+{
+ if (!hsu->ss7)
+ return NULL;
+ return osmo_ss7_get_sccp(hsu->ss7);
+}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/40268?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I1684fa1871098ab6df7c79c9c0e0daf6c6f35b09
Gerrit-Change-Number: 40268
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>