From c41bfcbbf0a364eaefe1782a60e41562edd0e3aa Mon Sep 17 00:00:00 2001 From: Neels Janosch Hofmeyr Date: Sat, 26 Nov 2022 02:53:56 +0100 Subject: 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 --- include/osmocom/pfcp/pfcp_ies_custom.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/osmocom/pfcp/pfcp_ies_custom.h') 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 { -- cgit v1.2.3