aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeels Janosch Hofmeyr <nhofmeyr@sysmocom.de>2022-11-26 02:53:56 +0100
committerNeels Janosch Hofmeyr <nhofmeyr@sysmocom.de>2022-11-26 03:04:13 +0100
commitc41bfcbbf0a364eaefe1782a60e41562edd0e3aa (patch)
treeb9ceeb34b4bc72de2122cf6ccd5de1ff4b425cae /include
parent25c4c9b355f294c954dfed7017db9ace20d6de09 (diff)
add osmo_pfcp_ip_addrs_to_str_*()
Move static function ip_addrs_to_str_buf() to public API as osmo_pfcp_ip_addrs_to_str_buf() and osmo_pfcp_ip_addrs_to_str_c(). So far the static function was only used in places where it follows other strings, so that it made sense to always start with a comma. Move this comma out of the function to the callers. Sensibly handle a NULL pointer and an empty address set. Rationale: osmo-upf would like to print an osmo_pfcp_ip_addrs struct in logging. Change-Id: I5f67db8d347690cbb1ce273a2d072636859f1bf6
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/pfcp/pfcp_ies_custom.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/pfcp/pfcp_ies_custom.h b/include/osmocom/pfcp/pfcp_ies_custom.h
index f273a87..565fee2 100644
--- a/include/osmocom/pfcp/pfcp_ies_custom.h
+++ b/include/osmocom/pfcp/pfcp_ies_custom.h
@@ -37,6 +37,8 @@ struct osmo_pfcp_ip_addrs {
};
int osmo_pfcp_ip_addrs_set(struct osmo_pfcp_ip_addrs *dst, const struct osmo_sockaddr *addr);
+int osmo_pfcp_ip_addrs_to_str_buf(char *buf, size_t buflen, const struct osmo_pfcp_ip_addrs *addrs);
+char *osmo_pfcp_ip_addrs_to_str_c(void *ctx, const struct osmo_pfcp_ip_addrs *addrs);
/* 3GPP TS 29.244 8.2.38, IETF RFC 1035 3.1 */
struct osmo_pfcp_ie_node_id {