aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-02-18 02:37:43 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-02-22 16:02:51 +0100
commitf9b0746d7dc73a1363a6c00ed89dc566b8dc322b (patch)
tree0f5370f8e4c960374fa3d5196e7c38138d813ca5
parent6e8241356b832d6d45a4d5051fb1397701e59071 (diff)
fixup for: add osmo_scu_prim_name_c() / _buf()
I would like to tweak the names for the recently added functions, so that they are more clear -- quickly before we release it or anyone uses these. Depends: libosmocore I9f43428af654a5674ac3035fe4db1394aac7a7af Related: I4c1998fd7fee7282d107846dae2cff4b5ceb3a7b Change-Id: If381f537ab91af1feef7f0e51921217f27e18e6a
-rw-r--r--TODO-RELEASE1
-rw-r--r--include/osmocom/sigtran/sccp_sap.h10
-rw-r--r--src/sccp_sap.c14
3 files changed, 16 insertions, 9 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index d0852fc..05e12a6 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+libosmocore >1.8.0 uses new osmo_prim_operation_name()
diff --git a/include/osmocom/sigtran/sccp_sap.h b/include/osmocom/sigtran/sccp_sap.h
index 3930111..607c358 100644
--- a/include/osmocom/sigtran/sccp_sap.h
+++ b/include/osmocom/sigtran/sccp_sap.h
@@ -273,9 +273,15 @@ struct osmo_scu_prim {
#define msgb_scu_prim(msg) ((struct osmo_scu_prim *)(msg)->l1h)
+extern const struct value_string osmo_scu_prim_type_names[];
+static inline const char *osmo_scu_prim_type_name(enum osmo_scu_prim_type val)
+{
+ return get_value_string(osmo_scu_prim_type_names, val);
+}
+
+int osmo_scu_prim_hdr_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr *oph);
+char *osmo_scu_prim_hdr_name_c(void *ctx, const struct osmo_prim_hdr *oph);
char *osmo_scu_prim_name(const struct osmo_prim_hdr *oph);
-int osmo_scu_prim_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr *oph);
-char *osmo_scu_prim_name_c(void *ctx, const struct osmo_prim_hdr *oph);
struct osmo_ss7_instance;
struct osmo_sccp_instance;
diff --git a/src/sccp_sap.c b/src/sccp_sap.c
index c0a42c6..51237ad 100644
--- a/src/sccp_sap.c
+++ b/src/sccp_sap.c
@@ -25,7 +25,7 @@
#include <osmocom/sigtran/sccp_sap.h>
-const struct value_string osmo_scu_prim_names[] = {
+const struct value_string osmo_scu_prim_type_names[] = {
{ OSMO_SCU_PRIM_N_CONNECT, "N-CONNECT" },
{ OSMO_SCU_PRIM_N_DATA, "N-DATA" },
{ OSMO_SCU_PRIM_N_EXPEDITED_DATA, "N-EXPEDITED-DATA" },
@@ -45,11 +45,11 @@ static char prim_name_buf[128];
char *osmo_scu_prim_name(const struct osmo_prim_hdr *oph)
{
- osmo_scu_prim_name_buf(prim_name_buf, sizeof(prim_name_buf), oph);
+ osmo_scu_prim_hdr_name_buf(prim_name_buf, sizeof(prim_name_buf), oph);
return prim_name_buf;
}
-int osmo_scu_prim_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr *oph)
+int osmo_scu_prim_hdr_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr *oph)
{
struct osmo_strbuf sb = { .buf = buf, .len = buflen };
@@ -59,14 +59,14 @@ int osmo_scu_prim_name_buf(char *buf, size_t buflen, const struct osmo_prim_hdr
}
OSMO_STRBUF_PRINTF(sb, "%s.%s",
- get_value_string(osmo_scu_prim_names, oph->primitive),
- get_value_string(osmo_prim_op_names, oph->operation));
+ osmo_scu_prim_type_name(oph->primitive),
+ osmo_prim_operation_name(oph->operation));
return sb.chars_needed;
}
-char *osmo_scu_prim_name_c(void *ctx, const struct osmo_prim_hdr *oph)
+char *osmo_scu_prim_hdr_name_c(void *ctx, const struct osmo_prim_hdr *oph)
{
- OSMO_NAME_C_IMPL(ctx, 32, "ERROR", osmo_scu_prim_name_buf, oph)
+ OSMO_NAME_C_IMPL(ctx, 32, "ERROR", osmo_scu_prim_hdr_name_buf, oph)
}
#include <osmocom/sigtran/sigtran_sap.h>