aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-12-10 04:10:25 +0100
committerAlexander Couzens <lynxis@fe80.eu>2020-12-10 04:10:25 +0100
commit33c6d711bcbdff491710b1828e1476a82b305ccb (patch)
treef78800941a24860b9772b799e992a27b2f0cff93
parentd727bef8b7f34710de346b8d741c5d06c5403d34 (diff)
gprs_ns2: add gprs_ns2_fr_bind_role() to retrieve the fr role
-rw-r--r--include/osmocom/gprs/gprs_ns2.h1
-rw-r--r--src/gb/gprs_ns2_fr.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h
index 876e97e6..8c617889 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -183,6 +183,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,
diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c
index 0dcb05b0..6e761f6b 100644
--- a/src/gb/gprs_ns2_fr.c
+++ b/src/gb/gprs_ns2_fr.c
@@ -555,6 +555,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