gprs_ns2: add gprs_ns2_nse_sns_remote() returns the initial SNS address

Allows the PCU to get the SNS remote address.

Change-Id: I54f110acc3acccb362f6e554324d08cc42b7c328
This commit is contained in:
Alexander Couzens 2020-10-11 21:22:42 +02:00
parent 979f5f5449
commit 125298f2b5
3 changed files with 17 additions and 0 deletions

View File

@ -138,6 +138,7 @@ void gprs_ns2_free_binds(struct gprs_ns2_inst *nsi);
int gprs_ns2_ip_connect_sns(struct gprs_ns2_vc_bind *bind,
const struct osmo_sockaddr *remote,
uint16_t nsei);
const struct osmo_sockaddr *gprs_ns2_nse_sns_remote(struct gprs_ns2_nse *nse);
const struct osmo_sockaddr *gprs_ns2_ip_vc_remote(struct gprs_ns2_vc *nsvc);
const struct osmo_sockaddr *gprs_ns2_ip_vc_local(const struct gprs_ns2_vc *nsvc);

View File

@ -194,6 +194,21 @@ static struct gprs_ns2_vc *nsvc_by_ip6_elem(struct gprs_ns2_nse *nse,
return gprs_ns2_nsvc_by_sockaddr_nse(nse, &sa);
}
/*! Return the initial SNS remote socket address
* \param nse NS Entity
* \return address of the initial SNS connection; NULL in case of error
*/
const struct osmo_sockaddr *gprs_ns2_nse_sns_remote(struct gprs_ns2_nse *nse)
{
struct ns2_sns_state *gss;
if (!nse->bss_sns_fi)
return NULL;
gss = (struct ns2_sns_state *) nse->bss_sns_fi->priv;
return &gss->initial;
}
/*! called when a nsvc is beeing freed */
void ns2_sns_free_nsvc(struct gprs_ns2_vc *nsvc)
{

View File

@ -102,6 +102,7 @@ gprs_ns2_ll_str_buf;
gprs_ns2_ll_str_c;
gprs_ns2_nse_by_nsei;
gprs_ns2_nse_nsei;
gprs_ns2_nse_sns_remote;
gprs_ns2_nsvc_by_nsvci;
gprs_ns2_nsvc_by_sockaddr;
gprs_ns2_recv_prim;