From 53d2d9e3c37d6170341818a254e18d341ee15511 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 26 Aug 2015 22:35:42 +0100 Subject: [uri] Generalise tftp_uri() to pxe_uri() Merge the functionality of parse_next_server_and_filename() and tftp_uri() into a single pxe_uri(), which takes a server address (IPv4/IPv6/none) and a filename, and produces a URI using the rule: - if the filename is a hierarchical absolute URI (i.e. includes a scheme such as "http://" or "tftp://") then use that URI and ignore the server address, - otherwise, if the server address is recognised (according to sa_family) then construct a TFTP URI based on the server address, port, and filename - otherwise fail. Signed-off-by: Michael Brown --- src/include/ipxe/uri.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/uri.h b/src/include/ipxe/uri.h index ce6a684c9..3879a0e73 100644 --- a/src/include/ipxe/uri.h +++ b/src/include/ipxe/uri.h @@ -206,8 +206,8 @@ extern char * resolve_path ( const char *base_path, const char *relative_path ); extern struct uri * resolve_uri ( const struct uri *base_uri, struct uri *relative_uri ); -extern struct uri * tftp_uri ( struct in_addr next_server, unsigned int port, - const char *filename ); +extern struct uri * pxe_uri ( struct sockaddr *sa_server, + const char *filename ); extern void churi ( struct uri *uri ); #endif /* _IPXE_URI_H */ -- cgit v1.2.3-55-g7522