blob: 1d507b13b06ded2965f6f8365316ed7f946a9470 [file] [log] [blame]
Jerome Forissier64abd782024-10-16 12:04:00 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef __NET_COMMON_H__
4#define __NET_COMMON_H__
5
6#include <asm/cache.h>
7#include <command.h>
8#include <env.h>
9#include <hexdump.h>
10#include <linux/if_ether.h>
Adriano Cordovaf0e60c82024-11-11 18:08:56 -030011#include <linux/sizes.h>
Jerome Forissier64abd782024-10-16 12:04:00 +020012#include <linux/types.h>
13#include <rand.h>
14#include <time.h>
15
16#define DEBUG_NET_PKT_TRACE 0 /* Trace all packet data */
17
18/*
19 * The number of receive packet buffers, and the required packet buffer
20 * alignment in memory.
21 *
22 */
23#define PKTBUFSRX CONFIG_SYS_RX_ETH_BUFFER
24#define PKTALIGN ARCH_DMA_MINALIGN
25
26/* IPv4 addresses are always 32 bits in size */
27struct in_addr {
28 __be32 s_addr;
29};
30
31#define PROT_IP 0x0800 /* IP protocol */
32#define PROT_ARP 0x0806 /* IP ARP protocol */
33#define PROT_WOL 0x0842 /* ether-wake WoL protocol */
34#define PROT_RARP 0x8035 /* IP ARP protocol */
35#define PROT_VLAN 0x8100 /* IEEE 802.1q protocol */
36#define PROT_IPV6 0x86dd /* IPv6 over bluebook */
37#define PROT_PPP_SES 0x8864 /* PPPoE session messages */
38#define PROT_NCSI 0x88f8 /* NC-SI control packets */
39
40#define IPPROTO_ICMP 1 /* Internet Control Message Protocol */
41#define IPPROTO_TCP 6 /* Transmission Control Protocol */
42#define IPPROTO_UDP 17 /* User Datagram Protocol */
43
44#define IP_OFFS 0x1fff /* ip offset *= 8 */
45#define IP_FLAGS 0xe000 /* first 3 bits */
46#define IP_FLAGS_RES 0x8000 /* reserved */
47#define IP_FLAGS_DFRAG 0x4000 /* don't fragments */
48#define IP_FLAGS_MFRAG 0x2000 /* more fragments */
49
50#define IP_HDR_SIZE (sizeof(struct ip_hdr))
51
52#define IP_MIN_FRAG_DATAGRAM_SIZE (IP_HDR_SIZE + 8)
53
54/*
55 * Internet Protocol (IP) + UDP header.
56 */
57struct ip_udp_hdr {
58 u8 ip_hl_v; /* header length and version */
59 u8 ip_tos; /* type of service */
60 u16 ip_len; /* total length */
61 u16 ip_id; /* identification */
62 u16 ip_off; /* fragment offset field */
63 u8 ip_ttl; /* time to live */
64 u8 ip_p; /* protocol */
65 u16 ip_sum; /* checksum */
66 struct in_addr ip_src; /* Source IP address */
67 struct in_addr ip_dst; /* Destination IP address */
68 u16 udp_src; /* UDP source port */
69 u16 udp_dst; /* UDP destination port */
70 u16 udp_len; /* Length of UDP packet */
71 u16 udp_xsum; /* Checksum */
Jerome Forissier97083502024-11-07 12:27:57 +010072} __packed;
Jerome Forissier64abd782024-10-16 12:04:00 +020073
74#define IP_UDP_HDR_SIZE (sizeof(struct ip_udp_hdr))
75#define UDP_HDR_SIZE (IP_UDP_HDR_SIZE - IP_HDR_SIZE)
76
77/* Number of packets processed together */
78#define ETH_PACKETS_BATCH_RECV 32
79
80/* ARP hardware address length */
81#define ARP_HLEN 6
82/*
83 * The size of a MAC address in string form, each digit requires two chars
84 * and five separator characters to form '00:00:00:00:00:00'.
85 */
86#define ARP_HLEN_ASCII (ARP_HLEN * 2) + (ARP_HLEN - 1)
87
Jerome Forissier97083502024-11-07 12:27:57 +010088#define ARP_HDR_SIZE (8 + 20) /* Size assuming ethernet */
Jerome Forissier64abd782024-10-16 12:04:00 +020089
90# define ARP_ETHER 1 /* Ethernet hardware address */
91
92/*
93 * Maximum packet size; used to allocate packet storage. Use
Jerome Forissier97083502024-11-07 12:27:57 +010094 * the maximum Ethernet frame size as specified by the Ethernet
Jerome Forissier64abd782024-10-16 12:04:00 +020095 * standard including the 802.1Q tag (VLAN tagging).
96 * maximum packet size = 1522
97 * maximum packet size and multiple of 32 bytes = 1536
98 */
99#define PKTSIZE 1522
100#ifndef CONFIG_DM_DSA
101#define PKTSIZE_ALIGN 1536
102#else
103/* Maximum DSA tagging overhead (headroom and/or tailroom) */
104#define DSA_MAX_OVR 256
105#define PKTSIZE_ALIGN (1536 + DSA_MAX_OVR)
106#endif
107
108/*
109 * Maximum receive ring size; that is, the number of packets
110 * we can buffer before overflow happens. Basically, this just
111 * needs to be enough to prevent a packet being discarded while
112 * we are processing the previous one.
113 * Used only in drivers/net/mvgbe.c.
114 */
115#define RINGSZ 4
116#define RINGSZ_LOG2 2
117
118extern int net_restart_wrap; /* Tried all network devices */
119extern uchar *net_rx_packets[PKTBUFSRX]; /* Receive packets */
120extern const u8 net_bcast_ethaddr[ARP_HLEN]; /* Ethernet broadcast address */
121extern char net_boot_file_name[1024];/* Boot File name */
Jerome Forissier1ff00362024-10-16 12:04:03 +0200122extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */
123/* Indicates whether the pxe path prefix / config file was specified in dhcp option */
124extern char *pxelinux_configfile;
Jerome Forissier64abd782024-10-16 12:04:00 +0200125
126/**
127 * compute_ip_checksum() - Compute IP checksum
128 *
129 * @addr: Address to check (must be 16-bit aligned)
130 * @nbytes: Number of bytes to check (normally a multiple of 2)
131 * Return: 16-bit IP checksum
132 */
Jerome Forissier97083502024-11-07 12:27:57 +0100133unsigned compute_ip_checksum(const void *addr, unsigned int nbytes);
Jerome Forissier64abd782024-10-16 12:04:00 +0200134
135/**
136 * ip_checksum_ok() - check if a checksum is correct
137 *
138 * This works by making sure the checksum sums to 0
139 *
140 * @addr: Address to check (must be 16-bit aligned)
141 * @nbytes: Number of bytes to check (normally a multiple of 2)
142 * Return: true if the checksum matches, false if not
143 */
Jerome Forissier97083502024-11-07 12:27:57 +0100144int ip_checksum_ok(const void *addr, unsigned int nbytes);
Jerome Forissier64abd782024-10-16 12:04:00 +0200145
146/**
147 * add_ip_checksums() - add two IP checksums
148 *
149 * @offset: Offset of first sum (if odd we do a byte-swap)
150 * @sum: First checksum
151 * @new_sum: New checksum to add
152 * Return: updated 16-bit IP checksum
153 */
Jerome Forissier97083502024-11-07 12:27:57 +0100154unsigned add_ip_checksums(unsigned offset, unsigned sum, unsigned int new_sum);
Jerome Forissier64abd782024-10-16 12:04:00 +0200155
156/*
157 * The devname can be either an exact name given by the driver or device tree
158 * or it can be an alias of the form "eth%d"
159 */
160struct udevice *eth_get_dev_by_name(const char *devname);
161int eth_is_active(struct udevice *dev); /* Test device for active state */
162
163/*
164 * Get the hardware address for an ethernet interface .
165 * Args:
166 * base_name - base name for device (normally "eth")
167 * index - device index number (0 for first)
168 * enetaddr - returns 6 byte hardware address
169 * Returns:
170 * Return true if the address is valid.
171 */
172int eth_env_get_enetaddr_by_index(const char *base_name, int index,
173 uchar *enetaddr);
174
175/**
176 * eth_env_set_enetaddr_by_index() - set the MAC address environment variable
177 *
178 * This sets up an environment variable with the given MAC address (@enetaddr).
179 * The environment variable to be set is defined by <@base_name><@index>addr.
180 * If @index is 0 it is omitted. For common Ethernet this means ethaddr,
181 * eth1addr, etc.
182 *
183 * @base_name: Base name for variable, typically "eth"
184 * @index: Index of interface being updated (>=0)
185 * @enetaddr: Pointer to MAC address to put into the variable
186 * Return: 0 if OK, other value on error
187 */
188int eth_env_set_enetaddr_by_index(const char *base_name, int index,
Jerome Forissier97083502024-11-07 12:27:57 +0100189 uchar *enetaddr);
Jerome Forissier64abd782024-10-16 12:04:00 +0200190
191/*
192 * Initialize USB ethernet device with CONFIG_DM_ETH
193 * Returns:
194 * 0 is success, non-zero is error status.
195 */
196int usb_ether_init(void);
197
198int eth_init(void); /* Initialize the device */
Jerome Forissierc8d070c2024-10-16 12:04:01 +0200199int eth_start_udev(struct udevice *dev); /* ->start() if not already running */
Jerome Forissier64abd782024-10-16 12:04:00 +0200200int eth_send(void *packet, int length); /* Send a packet */
201#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
202int eth_receive(void *packet, int length); /* Receive a packet*/
203extern void (*push_packet)(void *packet, int length);
204#endif
205int eth_rx(void); /* Check for received packets */
206
207/**
208 * reset_phy() - Reset the Ethernet PHY
209 *
210 * This should be implemented by boards if CONFIG_RESET_PHY_R is enabled
211 */
212void reset_phy(void);
213
214#if CONFIG_IS_ENABLED(NET) || CONFIG_IS_ENABLED(NET_LWIP)
215/**
216 * eth_set_enable_bootdevs() - Enable or disable binding of Ethernet bootdevs
217 *
218 * These get in the way of bootstd testing, so are normally disabled by tests.
219 * This provide control of this setting. It only affects binding of Ethernet
220 * devices, so if that has already happened, this flag does nothing.
221 *
222 * @enable: true to enable binding of bootdevs when binding new Ethernet
223 * devices, false to disable it
224 */
225void eth_set_enable_bootdevs(bool enable);
226#else
227static inline void eth_set_enable_bootdevs(bool enable) {}
228#endif
229
230static inline void net_send_packet(uchar *pkt, int len)
231{
232 if (DEBUG_NET_PKT_TRACE)
233 print_hex_dump_bytes("tx: ", DUMP_PREFIX_OFFSET, pkt, len);
234 /* Currently no way to return errors from eth_send() */
Jerome Forissier97083502024-11-07 12:27:57 +0100235 (void)eth_send(pkt, len);
Jerome Forissier64abd782024-10-16 12:04:00 +0200236}
237
238enum eth_recv_flags {
239 /*
240 * Check hardware device for new packets (otherwise only return those
241 * which are already in the memory buffer ready to process)
242 */
243 ETH_RECV_CHECK_DEVICE = 1 << 0,
244};
245
246/**
247 * struct eth_ops - functions of Ethernet MAC controllers
248 *
249 * start: Prepare the hardware to send and receive packets
250 * send: Send the bytes passed in "packet" as a packet on the wire
251 * recv: Check if the hardware received a packet. If so, set the pointer to the
252 * packet buffer in the packetp parameter. If not, return an error or 0 to
253 * indicate that the hardware receive FIFO is empty. If 0 is returned, the
254 * network stack will not process the empty packet, but free_pkt() will be
255 * called if supplied
256 * free_pkt: Give the driver an opportunity to manage its packet buffer memory
257 * when the network stack is finished processing it. This will only be
258 * called when no error was returned from recv - optional
259 * stop: Stop the hardware from looking for packets - may be called even if
260 * state == PASSIVE
261 * mcast: Join or leave a multicast group (for TFTP) - optional
262 * write_hwaddr: Write a MAC address to the hardware (used to pass it to Linux
263 * on some platforms like ARM). This function expects the
264 * eth_pdata::enetaddr field to be populated. The method can
265 * return -ENOSYS to indicate that this is not implemented for
266 this hardware - optional.
267 * read_rom_hwaddr: Some devices have a backup of the MAC address stored in a
268 * ROM on the board. This is how the driver should expose it
269 * to the network stack. This function should fill in the
270 * eth_pdata::enetaddr field - optional
271 * set_promisc: Enable or Disable promiscuous mode
272 * get_sset_count: Number of statistics counters
273 * get_string: Names of the statistic counters
274 * get_stats: The values of the statistic counters
275 */
276struct eth_ops {
277 int (*start)(struct udevice *dev);
278 int (*send)(struct udevice *dev, void *packet, int length);
279 int (*recv)(struct udevice *dev, int flags, uchar **packetp);
280 int (*free_pkt)(struct udevice *dev, uchar *packet, int length);
281 void (*stop)(struct udevice *dev);
282 int (*mcast)(struct udevice *dev, const u8 *enetaddr, int join);
283 int (*write_hwaddr)(struct udevice *dev);
284 int (*read_rom_hwaddr)(struct udevice *dev);
285 int (*set_promisc)(struct udevice *dev, bool enable);
286 int (*get_sset_count)(struct udevice *dev);
287 void (*get_strings)(struct udevice *dev, u8 *data);
288 void (*get_stats)(struct udevice *dev, u64 *data);
289};
290
291#define eth_get_ops(dev) ((struct eth_ops *)(dev)->driver->ops)
292
293struct udevice *eth_get_dev(void); /* get the current device */
Adriano Cordova7f2bcd42025-03-03 11:13:11 -0300294void eth_set_dev(struct udevice *dev); /* set a device */
Jerome Forissier64abd782024-10-16 12:04:00 +0200295unsigned char *eth_get_ethaddr(void); /* get the current device MAC */
296int eth_rx(void); /* Check for received packets */
297void eth_halt(void); /* stop SCC */
298const char *eth_get_name(void); /* get name of current device */
299int eth_get_dev_index(void);
300
301int eth_initialize(void); /* Initialize network subsystem */
302void eth_try_another(int first_restart); /* Change the device */
303void eth_set_current(void); /* set nterface to ethcur var */
304
305enum eth_state_t {
306 ETH_STATE_INIT,
307 ETH_STATE_PASSIVE,
308 ETH_STATE_ACTIVE
309};
310
311/**
312 * struct eth_pdata - Platform data for Ethernet MAC controllers
313 *
314 * @iobase: The base address of the hardware registers
315 * @enetaddr: The Ethernet MAC address that is loaded from EEPROM or env
316 * @phy_interface: PHY interface to use - see PHY_INTERFACE_MODE_...
317 * @max_speed: Maximum speed of Ethernet connection supported by MAC
318 * @priv_pdata: device specific plat
319 */
320struct eth_pdata {
321 phys_addr_t iobase;
322 unsigned char enetaddr[ARP_HLEN];
323 int phy_interface;
324 int max_speed;
325 void *priv_pdata;
326};
327
328struct ethernet_hdr {
329 u8 et_dest[ARP_HLEN]; /* Destination node */
330 u8 et_src[ARP_HLEN]; /* Source node */
331 u16 et_protlen; /* Protocol or length */
Jerome Forissier97083502024-11-07 12:27:57 +0100332} __packed;
Jerome Forissier64abd782024-10-16 12:04:00 +0200333
334/* Ethernet header size */
335#define ETHER_HDR_SIZE (sizeof(struct ethernet_hdr))
336
337/**
338 * net_random_ethaddr - Generate software assigned random Ethernet address
339 * @addr: Pointer to a six-byte array containing the Ethernet address
340 *
341 * Generate a random Ethernet address (MAC) that is not multicast
342 * and has the local assigned bit set.
343 */
344static inline void net_random_ethaddr(uchar *addr)
345{
346 int i;
347 unsigned int seed = get_ticks();
348
349 for (i = 0; i < 6; i++)
350 addr[i] = rand_r(&seed);
351
352 addr[0] &= 0xfe; /* clear multicast bit */
353 addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
354}
355
356/**
357 * is_zero_ethaddr - Determine if give Ethernet address is all zeros.
358 * @addr: Pointer to a six-byte array containing the Ethernet address
359 *
360 * Return true if the address is all zeroes.
361 */
362static inline int is_zero_ethaddr(const u8 *addr)
363{
364 return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
365}
366
367/**
368 * is_multicast_ethaddr - Determine if the Ethernet address is a multicast.
369 * @addr: Pointer to a six-byte array containing the Ethernet address
370 *
371 * Return true if the address is a multicast address.
372 * By definition the broadcast address is also a multicast address.
373 */
374static inline int is_multicast_ethaddr(const u8 *addr)
375{
376 return 0x01 & addr[0];
377}
378
379/*
380 * is_broadcast_ethaddr - Determine if the Ethernet address is broadcast
381 * @addr: Pointer to a six-byte array containing the Ethernet address
382 *
383 * Return true if the address is the broadcast address.
384 */
385static inline int is_broadcast_ethaddr(const u8 *addr)
386{
387 return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) ==
388 0xff;
389}
390
391/*
392 * is_valid_ethaddr - Determine if the given Ethernet address is valid
393 * @addr: Pointer to a six-byte array containing the Ethernet address
394 *
395 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
396 * a multicast address, and is not FF:FF:FF:FF:FF:FF.
397 *
398 * Return true if the address is valid.
399 */
400static inline int is_valid_ethaddr(const u8 *addr)
401{
402 /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
403 * explicitly check for it here. */
404 return !is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr);
405}
406
407/**
408 * string_to_enetaddr() - Parse a MAC address
409 *
410 * Convert a string MAC address
411 *
412 * Implemented in lib/net_utils.c (built unconditionally)
413 *
414 * @addr: MAC address in aa:bb:cc:dd:ee:ff format, where each part is a 2-digit
415 * hex value
416 * @enetaddr: Place to put MAC address (6 bytes)
417 */
418void string_to_enetaddr(const char *addr, uint8_t *enetaddr);
419
420/**
421 * string_to_ip() - Convert a string to ip address
422 *
423 * Implemented in lib/net_utils.c (built unconditionally)
424 *
425 * @s: Input string to parse
426 * @return: in_addr struct containing the parsed IP address
427 */
428struct in_addr string_to_ip(const char *s);
429
Adriano Cordovab080e0a2024-11-11 18:09:45 -0300430/**
Heinrich Schuchardt73c867a2024-11-19 11:09:07 +0100431 * ip_to_string() - Convert an IPv4 address to a string
Adriano Cordovab080e0a2024-11-11 18:09:45 -0300432 *
433 * Implemented in lib/net_utils.c (built unconditionally)
434 *
435 * @x: Input ip to parse
436 * @s: string containing the parsed ip address
437 */
438void ip_to_string(struct in_addr x, char *s);
439
Jerome Forissier64abd782024-10-16 12:04:00 +0200440/* copy a filename (allow for "..." notation, limit length) */
441void copy_filename(char *dst, const char *src, int size);
442
443/* Processes a received packet */
444void net_process_received_packet(uchar *in_packet, int len);
445
446/**
447 * update_tftp - Update firmware over TFTP (via DFU)
448 *
449 * This function updates board's firmware via TFTP
450 *
451 * @param addr - memory address where data is stored
452 * @param interface - the DFU medium name - e.g. "mmc"
453 * @param devstring - the DFU medium number - e.g. "1"
454 *
455 * Return: - 0 on success, other value on failure
456 */
457int update_tftp(ulong addr, char *interface, char *devstring);
458
459/**
Jerome Forissier97083502024-11-07 12:27:57 +0100460 * env_get_ip() - Convert an environment value to an ip address
Jerome Forissier64abd782024-10-16 12:04:00 +0200461 *
462 * @var: Environment variable to convert. The value of this variable must be
Jerome Forissier97083502024-11-07 12:27:57 +0100463 * in the format a.b.c.d, where each value is a decimal number from
Jerome Forissier64abd782024-10-16 12:04:00 +0200464 * 0 to 255
465 * Return: IP address, or 0 if invalid
466 */
467static inline struct in_addr env_get_ip(char *var)
468{
469 return string_to_ip(env_get(var));
470}
471
472int net_init(void);
473
Jerome Forissier6a78e962024-10-16 12:04:05 +0200474/* NET compatibility */
475enum proto_t;
476int net_loop(enum proto_t protocol);
477
Jerome Forissier64abd782024-10-16 12:04:00 +0200478/**
479 * dhcp_run() - Run DHCP on the current ethernet device
480 *
481 * This sets the autoload variable, then puts it back to similar to its original
482 * state (y, n or unset).
483 *
484 * @addr: Address to load the file into (0 if @autoload is false)
485 * @fname: Filename of file to load (NULL if @autoload is false or to use the
486 * default filename)
487 * @autoload: true to load the file, false to just get the network IP
488 * @return 0 if OK, -EINVAL if the environment failed, -ENOENT if ant file was
489 * not found
490 */
491int dhcp_run(ulong addr, const char *fname, bool autoload);
492
493/**
494 * do_tftpb - Run the tftpboot command
495 *
496 * @cmdtp: Command information for tftpboot
497 * @flag: Command flags (CMD_FLAG_...)
498 * @argc: Number of arguments
499 * @argv: List of arguments
500 * Return: result (see enum command_ret_t)
501 */
502int do_tftpb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
503
504/**
Adriano Cordovab479fc42024-12-04 00:05:16 -0300505 * wget_do_request() - sends a wget request
506 *
507 * Sends a wget request, if DNS resolution is enabled it resolves the
508 * given uri.
Jerome Forissier64abd782024-10-16 12:04:00 +0200509 *
510 * @dst_addr: destination address to download the file
511 * @uri: uri string of target file of wget
Adriano Cordova450b2342024-11-11 18:08:59 -0300512 * Return: zero on success, negative if failed
Jerome Forissier64abd782024-10-16 12:04:00 +0200513 */
Adriano Cordovab479fc42024-12-04 00:05:16 -0300514int wget_do_request(ulong dst_addr, char *uri);
Jerome Forissier64abd782024-10-16 12:04:00 +0200515/**
516 * wget_validate_uri() - varidate the uri
517 *
518 * @uri: uri string of target file of wget
519 * Return: true if uri is valid, false if uri is invalid
520 */
521bool wget_validate_uri(char *uri);
522//int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
523
Adriano Cordovaf0e60c82024-11-11 18:08:56 -0300524/**
525 * enum wget_http_method - http method
526 */
527enum wget_http_method {
528 WGET_HTTP_METHOD_GET,
529 WGET_HTTP_METHOD_POST,
530 WGET_HTTP_METHOD_PATCH,
531 WGET_HTTP_METHOD_OPTIONS,
532 WGET_HTTP_METHOD_CONNECT,
533 WGET_HTTP_METHOD_HEAD,
534 WGET_HTTP_METHOD_PUT,
535 WGET_HTTP_METHOD_DELETE,
536 WGET_HTTP_METHOD_TRACE,
537 WGET_HTTP_METHOD_MAX
538};
539
540/**
541 * define MAX_HTTP_HEADERS_SIZE - maximum headers buffer size
542 *
543 * When receiving http headers, wget fills a buffer with up
544 * to MAX_HTTP_HEADERS_SIZE bytes of header information.
545 */
546#define MAX_HTTP_HEADERS_SIZE SZ_64K
547
548/**
549 * struct wget_http_info - wget parameters
550 * @method: HTTP Method. Filled by client.
551 * @status_code: HTTP status code. Filled by wget.
552 * @file_size: download size. Filled by wget.
553 * @buffer_size: size of client-provided buffer. Filled by client.
554 * @set_bootdev: set boot device with download. Filled by client.
555 * @check_buffer_size: check download does not exceed buffer size.
556 * Filled by client.
557 * @hdr_cont_len: content length according to headers. Filled by wget
558 * @headers: buffer for headers. Filled by wget.
559 */
560struct wget_http_info {
561 enum wget_http_method method;
562 u32 status_code;
563 ulong file_size;
564 ulong buffer_size;
565 bool set_bootdev;
566 bool check_buffer_size;
567 u32 hdr_cont_len;
568 char *headers;
569};
570
Adriano Cordova929a5542024-11-11 18:08:57 -0300571extern struct wget_http_info default_wget_info;
572extern struct wget_http_info *wget_info;
573int wget_request(ulong dst_addr, char *uri, struct wget_http_info *info);
574
Jerome Forissier64abd782024-10-16 12:04:00 +0200575#endif /* __NET_COMMON_H__ */