net: net_utils: Move ip_to_string to lib/net_utils.c

The function string_to_ip is already in net_utils, which is
compiled unconditionally, but ip_to_string is currently only
accessible if the legacy network stack is selected. This
commit puts ip_to_string in net_utils.c and removes it from the
legacy network code.

Signed-off-by: Adriano Cordova <adrianox@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Adriano Cordova
2024-11-11 18:09:45 -03:00
committed by Heinrich Schuchardt
parent 1327c2a8d6
commit 9063dba2d3
3 changed files with 21 additions and 11 deletions

View File

@@ -426,6 +426,16 @@ void string_to_enetaddr(const char *addr, uint8_t *enetaddr);
*/
struct in_addr string_to_ip(const char *s);
/**
* ip_to_string() - Convert a string to ip address
*
* Implemented in lib/net_utils.c (built unconditionally)
*
* @x: Input ip to parse
* @s: string containing the parsed ip address
*/
void ip_to_string(struct in_addr x, char *s);
/* copy a filename (allow for "..." notation, limit length) */
void copy_filename(char *dst, const char *src, int size);