diff options
author | Tom Rini <trini@konsulko.com> | 2024-11-18 10:46:06 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-11-18 10:46:06 -0600 |
commit | b7d4c80fce449b8f8a3cb3cb279487e81863af04 (patch) | |
tree | 9a0180d3b77f74afb350892cf1305c1a47b5c5ee /lib/net_utils.c | |
parent | b9e0048b6d0c8d7329e1bf8f7df65bb4b0f3ce03 (diff) | |
parent | 9063dba2d326e07682338cdb636787e99f1bf3f5 (diff) |
Merge tag 'efi-next-2024-11-18' of https://source.denx.de/u-boot/custodians/u-boot-efi into next
CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/23430
- Prepare for implementing the EFI_HTTP_PROTOCOL:
- Make wget functionality callable even if the wget command is not
built (add CONFIG_WGET symbol).
- Ensure that wget_with_dns() works the same with the old network
stack and with lwIP.
- Put server_name and port into wget_ctx.
- Integrate struct wget_info into wget code.
- Move ip_to_string to lib/net_utils.c
Diffstat (limited to 'lib/net_utils.c')
-rw-r--r-- | lib/net_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/net_utils.c b/lib/net_utils.c index c70fef0d991..621f6512b62 100644 --- a/lib/net_utils.c +++ b/lib/net_utils.c @@ -152,6 +152,17 @@ out_err: } #endif +void ip_to_string(struct in_addr x, char *s) +{ + x.s_addr = ntohl(x.s_addr); + sprintf(s, "%d.%d.%d.%d", + (int) ((x.s_addr >> 24) & 0xff), + (int) ((x.s_addr >> 16) & 0xff), + (int) ((x.s_addr >> 8) & 0xff), + (int) ((x.s_addr >> 0) & 0xff) + ); +} + void string_to_enetaddr(const char *addr, uint8_t *enetaddr) { char *end; |