diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2018-07-03 19:36:43 -0500 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-07-26 14:08:20 -0500 |
commit | 6ab12830921c1de4eb90a0d471bf5f4677af734c (patch) | |
tree | e843a02a84a0797ab7d0dbb7e4e4cc8d3cb0a3a9 /include/net.h | |
parent | f43308fa0c7834d9707a2c212591275d1e095e50 (diff) | |
download | u-boot-6ab12830921c1de4eb90a0d471bf5f4677af734c.tar.gz |
net: Consolidate the parsing of bootfile
The same basic parsing was implemented in tftp and nfs, so add a helper
function to do the work once.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/net.h')
-rw-r--r-- | include/net.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h index de2d7bba19..62f82c4dca 100644 --- a/include/net.h +++ b/include/net.h @@ -842,6 +842,17 @@ void copy_filename(char *dst, const char *src, int size); /* check if serverip is specified in filename from the command line */ int is_serverip_in_cmd(void); +/** + * net_parse_bootfile - Parse the bootfile env var / cmd line param + * + * @param ipaddr - a pointer to the ipaddr to populate if included in bootfile + * @param filename - a pointer to the string to save the filename part + * @param max_len - The longest - 1 that the filename part can be + * + * return 1 if parsed, 0 if bootfile is empty + */ +int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len); + /* get a random source port */ unsigned int random_port(void); |