1 /* 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
9 /* HTTPS authentication mode */
10 enum auth_mode {
11 AUTH_NONE,
12 AUTH_OPTIONAL,
13 AUTH_REQUIRED,
14 };
15
16 extern char *cacert;
17 extern size_t cacert_size;
18 extern enum auth_mode cacert_auth_mode;
19 extern bool cacert_initialized;
20
21 extern int net_try_count;
22
23 int set_cacert_builtin(void);
24
25 enum proto_t {
26 TFTPGET
27 };
28
eth_is_on_demand_init(void)29 static inline int eth_is_on_demand_init(void)
30 {
31 return 1;
32 }
33
34 int eth_init_state_only(void); /* Set active state */
35
36 int net_lwip_dns_init(void);
37 int net_lwip_eth_start(void);
38 struct netif *net_lwip_new_netif(struct udevice *udev);
39 struct netif *net_lwip_new_netif_noip(struct udevice *udev);
40 void net_lwip_remove_netif(struct netif *netif);
41 struct netif *net_lwip_get_netif(void);
42 int net_lwip_rx(struct udevice *udev, struct netif *netif);
43 int net_lwip_dns_resolve(char *name_or_ip, ip_addr_t *ip);
44
45 /**
46 * wget_validate_uri() - varidate the uri
47 *
48 * @uri: uri string of target file of wget
49 * Return: true if uri is valid, false if uri is invalid
50 */
51 bool wget_validate_uri(char *uri);
52
53 int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
54 int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
55 int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
56
57 #endif /* __NET_LWIP_H__ */
58