libosmocore/tests/socket
Neels Hofmeyr 09d6574a45 add osmo_sockaddr_to_str_c(), osmo_sockaddr_to_str_buf2()
To easily log and print a sockaddr using OTC_SELECT, add
osmo_sockaddr_to_str_c().

Implement osmo_sockaddr_to_str_buf2() using osmo_strbuf, so that we can
return the chars_needed which osmo_sockaddr_to_str_c() uses.

From previous osmo_sockaddr_to_str_buf(), call
osmo_sockaddr_to_str_buf2() and return NULL if the buf_len was
insufficient, to mimick previous behavior. This makes it more
consistently returning NULL for insufficient buf_len, as shown in the
tweak that is needed in socket_test.c. Before osmo_sockaddr_to_str_buf()
would return a truncated port number, now it's all or NULL.

I will use osmo_sockaddr_to_str_c() in the new osmo-upf implementation.

Related: SYS#5599
Change-Id: I12771bf8a021e6785217b1faad03c09ec1cfef0e
2022-01-31 15:03:53 +00:00
..
socket_sctp_test.c treewide: remove FSF address 2021-12-14 12:44:03 +01:00
socket_sctp_test.err tests: Split SCTP tests to its own file and run them conditionally 2020-08-25 14:22:03 +02:00
socket_sctp_test.ok tests: Split SCTP tests to its own file and run them conditionally 2020-08-25 14:22:03 +02:00
socket_test.c add osmo_sockaddr_to_str_c(), osmo_sockaddr_to_str_buf2() 2022-01-31 15:03:53 +00:00
socket_test.err socket: introduce osmo_sock_init_osa & osmo_sock_init_osa_ofd 2020-09-02 18:42:21 +02:00
socket_test.ok add osmo_sockaddr_to_str_buf/osmo_sockaddr_to_str 2020-10-12 15:13:43 +00:00