aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/gprs
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-10-27 15:12:25 +0100
committerlynxis lazus <lynxis@fe80.eu>2020-10-27 14:49:03 +0000
commitb3b837c5e81dc5b21f8994b3d16adf3448b48035 (patch)
tree290a1bb4c78ae331fb743eb59c7c5950812cb4f9 /include/osmocom/gprs
parent2498f1db9df89a5496944a6b84d51f11ae185504 (diff)
gprs_ns2: convert gprs_ns2_cause_str into an static inlineHEADmaster
Be consistent with other implementation of get_value_string() in libosomocore. Change-Id: Ic79757df8683e0461c04f7ef9279e4fe645eb821
Diffstat (limited to 'include/osmocom/gprs')
-rw-r--r--include/osmocom/gprs/gprs_ns2.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/osmocom/gprs/gprs_ns2.h b/include/osmocom/gprs/gprs_ns2.h
index 975ddcb6..ffc2ad8e 100644
--- a/include/osmocom/gprs/gprs_ns2.h
+++ b/include/osmocom/gprs/gprs_ns2.h
@@ -7,6 +7,7 @@
#include <netinet/in.h>
#include <osmocom/core/prim.h>
+#include <osmocom/gprs/protocol/gsm_08_16.h>
struct osmo_sockaddr;
struct osmo_sockaddr_str;
@@ -74,6 +75,12 @@ enum gprs_ns2_change_ip_endpoint {
NS_ENDPOINT_CONFIRM_CHANGE,
};
+extern const struct value_string gprs_ns2_cause_strs[];
+
+/*! Obtain a human-readable string for NS primitives */
+static inline const char *gprs_ns2_cause_str(enum ns_cause val)
+{ return get_value_string(gprs_ns2_cause_strs, val); }
+
struct osmo_gprs_ns2_prim {
struct osmo_prim_hdr oph;
@@ -185,7 +192,6 @@ struct gprs_ns2_vc *gprs_ns2_nsvc_by_sockaddr_nse(
struct gprs_ns2_nse *nse,
const struct osmo_sockaddr *sockaddr);
void gprs_ns2_start_alive_all_nsvcs(struct gprs_ns2_nse *nse);
-const char *gprs_ns2_cause_str(int cause);
const char *gprs_ns2_ll_str(struct gprs_ns2_vc *nsvc);
char *gprs_ns2_ll_str_buf(char *buf, size_t buf_len, struct gprs_ns2_vc *nsvc);
char *gprs_ns2_ll_str_c(const void *ctx, struct gprs_ns2_vc *nsvc);