blob: 1c3583f82a1a5fec4fc4e5238c95ac88d22d3f77 [file] [log] [blame]
Jerome Forissier64abd782024-10-16 12:04:00 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef __NET_LWIP_H__
4#define __NET_LWIP_H__
5
6#include <lwip/ip4.h>
7#include <lwip/netif.h>
8
Jerome Forissier6a78e962024-10-16 12:04:05 +02009enum proto_t {
10 TFTPGET
11};
12
Jerome Forissier64abd782024-10-16 12:04:00 +020013struct netif *net_lwip_new_netif(struct udevice *udev);
14struct netif *net_lwip_new_netif_noip(struct udevice *udev);
15void net_lwip_remove_netif(struct netif *netif);
16struct netif *net_lwip_get_netif(void);
Jerome Forissier1ff00362024-10-16 12:04:03 +020017int net_lwip_rx(struct udevice *udev, struct netif *netif);
18
Jerome Forissier359d4ed2024-10-16 12:04:09 +020019/**
20 * wget_with_dns() - runs dns host IP address resulution before wget
21 *
22 * @dst_addr: destination address to download the file
23 * @uri: uri string of target file of wget
24 * Return: downloaded file size, negative if failed
25 */
26
27int wget_with_dns(ulong dst_addr, char *uri);
28/**
29 * wget_validate_uri() - varidate the uri
30 *
31 * @uri: uri string of target file of wget
32 * Return: true if uri is valid, false if uri is invalid
33 */
34bool wget_validate_uri(char *uri);
35
Jerome Forissier1ff00362024-10-16 12:04:03 +020036int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
Jerome Forissierbc4d8822024-10-16 12:04:07 +020037int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
Jerome Forissier8f29e002024-10-16 12:04:06 +020038int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
Jerome Forissier359d4ed2024-10-16 12:04:09 +020039int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
Jerome Forissier64abd782024-10-16 12:04:00 +020040
41#endif /* __NET_LWIP_H__ */