aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-02-07 12:48:51 +0100
committerHarald Welte <laforge@osmocom.org>2021-02-23 17:20:08 +0100
commit7eedb6b03c6615035b2601d720fd2b10d9d513aa (patch)
treeb7c776337373252ca7bd5e728612d5067b6732ee
parentd7ecf7a15021446b0ff380dc5bde653038c93979 (diff)
Add osmo_ss7_pointcode_print_buf() to API
Like osmo_ss7_pointcode_print(), but prints into an user-supplied buffer. Change-Id: I5fc7d7746eb90a9d404b6b50bf9ded6789a1c33c
-rw-r--r--include/osmocom/sigtran/osmo_ss7.h1
-rw-r--r--src/osmo_ss7.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index a2263a2..b717d53 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -24,6 +24,7 @@ int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst);
bool osmo_ss7_pc_is_local(struct osmo_ss7_instance *inst, uint32_t pc);
int osmo_ss7_pointcode_parse(struct osmo_ss7_instance *inst, const char *str);
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in);
+const char *osmo_ss7_pointcode_print_buf(char *buf, size_t buf_len, const struct osmo_ss7_instance *inst, uint32_t pc);
const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc);
const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc);
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index a801cc9..5ff4ca4 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -260,7 +260,7 @@ err:
return -EINVAL;
}
-const char *_osmo_ss7_pointcode_print(char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc)
+const char *osmo_ss7_pointcode_print_buf(char *buf, size_t len, const struct osmo_ss7_instance *inst, uint32_t pc)
{
const struct osmo_ss7_pc_fmt *pc_fmt;
unsigned int num_comp_exp;
@@ -287,7 +287,7 @@ const char *_osmo_ss7_pointcode_print(char *buf, size_t len, const struct osmo_s
const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint32_t pc)
{
static char buf[MAX_PC_STR_LEN];
- return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc);
+ return osmo_ss7_pointcode_print_buf(buf, sizeof(buf), inst, pc);
}
/* same as osmo_ss7_pointcode_print() but using a separate buffer, useful for multiple point codes in the
@@ -295,7 +295,7 @@ const char *osmo_ss7_pointcode_print(const struct osmo_ss7_instance *inst, uint3
const char *osmo_ss7_pointcode_print2(const struct osmo_ss7_instance *inst, uint32_t pc)
{
static char buf[MAX_PC_STR_LEN];
- return _osmo_ss7_pointcode_print(buf, sizeof(buf), inst, pc);
+ return osmo_ss7_pointcode_print_buf(buf, sizeof(buf), inst, pc);
}
int osmo_ss7_pointcode_parse_mask_or_len(struct osmo_ss7_instance *inst, const char *in)