gprs_ns2: add gprs_ns2_fr_bind_role() to retrieve the fr role

Change-Id: I277b805e588ba68536789b4a64a428ea0b31728a
This commit is contained in:
Alexander Couzens 2020-12-10 04:10:25 +01:00 committed by lynxis lazus
parent 22c26e0610
commit c782cec663
2 changed files with 16 additions and 0 deletions

View File

@ -182,6 +182,7 @@ struct gprs_ns2_vc_bind *gprs_ns2_fr_bind_by_netif(
struct gprs_ns2_inst *nsi,
const char *netif);
const char *gprs_ns2_fr_bind_netif(struct gprs_ns2_vc_bind *bind);
enum osmo_fr_role gprs_ns2_fr_bind_role(struct gprs_ns2_vc_bind *bind);
int gprs_ns2_fr_bind(struct gprs_ns2_inst *nsi,
const char *name,
const char *netif,

View File

@ -558,6 +558,21 @@ err_bind:
return rc;
}
/*! Return the frame relay role of a bind
* \param[in] bind The bind
* \return the frame relay role or -EINVAL if bind is not frame relay
*/
enum osmo_fr_role gprs_ns2_fr_bind_role(struct gprs_ns2_vc_bind *bind)
{
struct priv_bind *priv;
if (bind->driver != &vc_driver_fr)
return -EINVAL;
priv = bind->priv;
return priv->link->role;
}
/*! Return the network interface of the bind
* \param[in] bind The bind
* \return the network interface