pespin submitted this change.
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
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(-)
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 change 40268. To unsubscribe, or for help writing mail filters, visit settings.