From bd060c3c999dbbbf8ce528a7e2bf018849a4323c Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 9 Jul 2021 10:24:33 +0200 Subject: [PATCH] mgcp_trunk: add value string for trunk type. Change-Id: I634fb2a03744117e976430468ab5c57d50ab0089 --- include/osmocom/mgcp/mgcp_trunk.h | 4 ++++ src/libosmo-mgcp/mgcp_trunk.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/include/osmocom/mgcp/mgcp_trunk.h b/include/osmocom/mgcp/mgcp_trunk.h index c62f731bb..326b16a9c 100644 --- a/include/osmocom/mgcp/mgcp_trunk.h +++ b/include/osmocom/mgcp/mgcp_trunk.h @@ -13,6 +13,10 @@ enum mgcp_trunk_type { MGCP_TRUNK_E1, }; +extern const struct value_string mgcp_trunk_type_strs[]; +static inline const char *mgcp_trunk_type_strs_str(enum mgcp_trunk_type val) +{ return get_value_string(mgcp_trunk_type_strs, val); } + struct mgcp_trunk { struct llist_head entry; diff --git a/src/libosmo-mgcp/mgcp_trunk.c b/src/libosmo-mgcp/mgcp_trunk.c index 8ff6f6ac5..5c9a8883d 100644 --- a/src/libosmo-mgcp/mgcp_trunk.c +++ b/src/libosmo-mgcp/mgcp_trunk.c @@ -28,6 +28,12 @@ #include #include +const struct value_string mgcp_trunk_type_strs[] = { + { MGCP_TRUNK_VIRTUAL, "virtual" }, + { MGCP_TRUNK_E1, "e1" }, + { 0, NULL } +}; + /*! allocate trunk and add it (if required) to the trunk list. * (called once at startup by VTY). * \param[in] cfg mgcp configuration.