diff options
author | H. Peter Anvin <hpa@zytor.com> | 2011-04-23 16:04:00 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-04-23 16:08:44 -0700 |
commit | 0eefacc5fd49dae600ab86b14557578efd6a2508 (patch) | |
tree | bece465af41ee3f305cfa15925ad32244903909d /core/fs/pxe/url.h | |
parent | d6426caa6772e1887f07e35c15e2ba72a8a2bccd (diff) | |
download | syslinux-4.10-pre2.tar.gz syslinux-4.10-pre2.tar.xz syslinux-4.10-pre2.zip |
pxe: use the unified URL parsing frameworksyslinux-4.10-pre2
Use the unified URL parsing framework for TFTP and HTTP. This should
also make it easier to add new protocols (e.g. FTP) in the near
future.
Note that HTTP redirects are still handled wrong: they really should
be sent all the way back to the top of URL parsing; there are sites in
the field which redirect to FTP URLs, for example.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/fs/pxe/url.h')
-rw-r--r-- | core/fs/pxe/url.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/fs/pxe/url.h b/core/fs/pxe/url.h index baea2b70..53984f3a 100644 --- a/core/fs/pxe/url.h +++ b/core/fs/pxe/url.h @@ -5,10 +5,13 @@ #ifndef CORE_PXE_URL_H #define CORE_PXE_URL_H +#include <stddef.h> +#include <stdint.h> + enum url_type { - URL_NORMAL, - URL_OLD_TFTP, - URL_PREFIX + URL_NORMAL, /* It is a full URL */ + URL_OLD_TFTP, /* It's a ::-style TFTP path */ + URL_SUFFIX /* Prepend the pathname prefix */ }; struct url_info { @@ -16,13 +19,15 @@ struct url_info { char *user; char *passwd; char *host; + uint32_t ip; /* Placeholder field not set by parse_url() */ unsigned int port; char *path; /* Includes query */ enum url_type type; }; +enum url_type url_type(const char *url); void parse_url(struct url_info *ui, char *url); -char *url_escape_unsafe(const char *input); +size_t url_escape_unsafe(char *output, const char *input, size_t bufsize); char *url_unescape(char *buffer, char terminator); #endif /* CORE_PXE_URL_H */ |