]> Git Repo - J-u-boot.git/blobdiff - include/net.h
lib: uuid: supporting building as part of host tools
[J-u-boot.git] / include / net.h
index e254df7d7f4374856f8d096171fe7bd88ba3a654..bb2ae20f52aa3318e8d9c2881615cbbcb598e5b6 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/cache.h>
 #include <asm/byteorder.h>     /* for nton* / ntoh* stuff */
 #include <env.h>
+#include <hexdump.h>
 #include <log.h>
 #include <time.h>
 #include <linux/if_ether.h>
@@ -29,6 +30,7 @@ struct udevice;
 #define DEBUG_DEV_PKT 0                /* Packets or info directed to the device */
 #define DEBUG_NET_PKT 0                /* Packets on info on the network at large */
 #define DEBUG_INT_STATE 0      /* Internal network state changes */
+#define DEBUG_NET_PKT_TRACE 0  /* Trace all packet data */
 
 /*
  *     The number of receive packet buffers, and the required packet buffer
@@ -223,7 +225,6 @@ int eth_get_dev_index(void);                /* get the device index */
 int eth_env_set_enetaddr_by_index(const char *base_name, int index,
                                 uchar *enetaddr);
 
-
 /*
  * Initialize USB ethernet device with CONFIG_DM_ETH
  * Returns:
@@ -640,6 +641,8 @@ uchar * net_get_async_tx_pkt_buf(void);
 /* Transmit a packet */
 static inline void net_send_packet(uchar *pkt, int len)
 {
+       if (DEBUG_NET_PKT_TRACE)
+               print_hex_dump_bytes("tx: ", DUMP_PREFIX_OFFSET, pkt, len);
        /* Currently no way to return errors from eth_send() */
        (void) eth_send(pkt, len);
 }
@@ -926,4 +929,21 @@ void eth_set_enable_bootdevs(bool enable);
 static inline void eth_set_enable_bootdevs(bool enable) {}
 #endif
 
+/**
+ * wget_with_dns() - runs dns host IP address resulution before wget
+ *
+ * @dst_addr:  destination address to download the file
+ * @uri:       uri string of target file of wget
+ * Return:     downloaded file size, negative if failed
+ */
+int wget_with_dns(ulong dst_addr, char *uri);
+
+/**
+ * wget_validate_uri() - varidate the uri
+ *
+ * @uri:       uri string of target file of wget
+ * Return:     true if uri is valid, false if uri is invalid
+ */
+bool wget_validate_uri(char *uri);
+
 #endif /* __NET_H__ */
This page took 0.029326 seconds and 4 git commands to generate.