diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-04-04 22:22:42 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-04-09 18:49:56 +0200 |
commit | 6e809af02e46fbce404c42419dc2c881d2993d82 (patch) | |
tree | 286e6556ccf40dc85c00417f2dbae6c6b4bd3029 | |
parent | 21127d3f8f51aaa92133e9be14f3691a19d902c1 (diff) |
sccp: add osmo_sccp_user_{get,set}_priv() API function
As 'struct osmo_sccp_user' is private, we need this accessor functions
for the SCCP User so it can set and get the 'priv' data.
Change-Id: Ia68a36dc18a7d754d63ae29c86d68e495b5c4134
-rw-r--r-- | include/osmocom/sigtran/sccp_sap.h | 2 | ||||
-rw-r--r-- | src/sccp_user.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h index c1464f0..a86f86a 100644 --- a/include/osmocom/sigtran/sccp_sap.h +++ b/include/osmocom/sigtran/sccp_sap.h @@ -232,6 +232,8 @@ osmo_sccp_instance_create(struct osmo_ss7_instance *ss7, void *priv); void osmo_sccp_instance_destroy(struct osmo_sccp_instance *inst); void osmo_sccp_user_unbind(struct osmo_sccp_user *scu); +void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv); +void *osmo_sccp_user_get_priv(struct osmo_sccp_user *scu); struct osmo_sccp_user * osmo_sccp_user_bind_pc(struct osmo_sccp_instance *inst, const char *name, diff --git a/src/sccp_user.c b/src/sccp_user.c index df02486..bc03f4e 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -130,6 +130,16 @@ void osmo_sccp_user_unbind(struct osmo_sccp_user *scu) talloc_free(scu); } +void osmo_sccp_user_set_priv(struct osmo_sccp_user *scu, void *priv) +{ + scu->priv = priv; +} + +void *osmo_sccp_user_get_priv(struct osmo_sccp_user *scu) +{ + return scu->priv; +} + /*! \brief Send a SCCP User SAP Primitive up to the User * \param[in] scu SCCP User to whom to send the primitive * \param[in] prim Primitive to send to the user |