iPXE
|
A Uniform Resource Identifier. More...
#include <uri.h>
Data Fields | |
struct refcnt | refcnt |
Reference count. More... | |
const char * | scheme |
Scheme. More... | |
const char * | opaque |
Opaque part. More... | |
const char * | user |
User name. More... | |
const char * | password |
Password. More... | |
const char * | host |
Host name. More... | |
const char * | port |
Port number. More... | |
const char * | path |
Path (after URI decoding) More... | |
const char * | epath |
Path (with original URI encoding) More... | |
const char * | equery |
Query (with original URI encoding) More... | |
const char * | efragment |
Fragment (with original URI encoding) More... | |
struct parameters * | params |
Request parameters. More... | |
A Uniform Resource Identifier.
Terminology for this data structure is as per uri(7), except that "path" is defined to include the leading '/' for an absolute path.
Note that all fields within a URI are optional and may be NULL.
The pointers to the various fields are packed together so they can be accessed in array fashion in some places in uri.c where doing so saves significant code size.
Some examples are probably helpful:
scheme = "http", host = "www.ipxe.org", path = "/wiki"
/var/lib/tftpboot :
path = "/var/lib/tftpboot"
bob@n : owhe re.co m
scheme = "mailto", opaque = "bob@nowhere.com"
ftp://joe:secret@insecure.org:8081/hidden/path/to?what=is#this
scheme = "ftp", user = "joe", password = "secret", host = "insecure.org", port = "8081", path = "/hidden/path/to", query = "what=is", fragment = "this"
The URI syntax includes a percent-encoding mechanism that can be used to represent characters that would otherwise not be possible, such as a '/' character within the password field. These encodings are decoded during the URI parsing stage, thereby allowing protocol implementations to consume the raw field values directly without further decoding.
Some protocols (such as HTTP) communicate using URI-encoded values. For these protocols, the original encoded substring must be retained verbatim since the choice of whether or not to encode a particular character may have significance to the receiving application. We therefore retain the originally-encoded substrings for the path, query, and fragment fields.
struct refcnt uri::refcnt |
const char* uri::scheme |
Scheme.
Definition at line 68 of file uri.h.
Referenced by http_open(), http_scheme(), netboot(), parse_uri(), uri_dump(), uri_is_absolute(), uri_okx(), and xfer_open_uri().
const char* uri::opaque |
Opaque part.
Definition at line 70 of file uri.h.
Referenced by aoe_parse_uri(), efi_local_open(), fcp_parse_uri(), ib_srp_open_uri(), image_set_uri(), iscsi_open(), parse_uri(), pxe_uri(), uri_dump(), uri_has_opaque(), uri_okx(), and usbblk_open_uri().
const char* uri::user |
User name.
Definition at line 72 of file uri.h.
Referenced by format_uri(), ftp_open(), ftp_user(), http_basic_authenticate(), http_digest_authenticate(), http_ntlm_authenticate(), imgdownload(), parse_uri(), uri_dump(), and uri_okx().
const char* uri::password |
Password.
Definition at line 74 of file uri.h.
Referenced by ftp_open(), ftp_password(), http_basic_authenticate(), http_digest_authenticate(), http_ntlm_authenticate(), imgdownload(), parse_uri(), uri_dump(), and uri_okx().
const char* uri::host |
Host name.
Definition at line 76 of file uri.h.
Referenced by efi_local_open(), fcp_parse_uri(), format_uri(), ftp_open(), http_conn_close(), http_conn_xfer_close(), http_connect(), http_open(), https_filter(), nfs_parse_uri(), parse_uri(), slam_open(), tcp_open_uri(), tftp_core_open(), tftp_reopen(), udp_open_uri(), uri_dump(), and uri_okx().
const char* uri::port |
Port number.
Definition at line 78 of file uri.h.
Referenced by http_open(), parse_uri(), uri_dump(), uri_okx(), and uri_port().
const char* uri::path |
Path (after URI decoding)
Definition at line 80 of file uri.h.
Referenced by efi_local_open(), efi_path_uri(), efi_paths(), fcp_parse_uri(), ftp_open(), ftp_uri_path(), image_set_uri(), nfs_parse_uri(), nfs_uri_free(), nfs_uri_init(), nfs_uri_next_mountpoint(), nfs_uri_next_path_component(), nfs_uri_symlink(), parse_uri(), resolve_uri(), slam_open(), tftp_core_open(), tftp_send_rrq(), tftp_uri(), uri_dump(), uri_has_absolute_path(), uri_has_path(), uri_has_relative_path(), and uri_okx().
const char* uri::epath |
Path (with original URI encoding)
Definition at line 82 of file uri.h.
Referenced by format_uri(), http_open(), parse_uri(), resolve_uri(), uri_dump(), and uri_okx().
const char* uri::equery |
Query (with original URI encoding)
Definition at line 84 of file uri.h.
Referenced by http_open(), imgdownload(), parse_uri(), resolve_uri(), uri_dump(), and uri_okx().
const char* uri::efragment |
Fragment (with original URI encoding)
Definition at line 86 of file uri.h.
Referenced by imgdownload(), parse_uri(), resolve_uri(), uri_dump(), and uri_okx().
struct parameters* uri::params |
Request parameters.
Definition at line 88 of file uri.h.
Referenced by http_format_headers(), http_open_uri(), parse_uri(), resolve_uri(), uri_dump(), uri_dup(), uri_free(), uri_okx(), uri_params_list_okx(), and uri_params_okx().