iPXE
Data Fields
uri Struct Reference

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 parametersparams
 Form parameters. More...
 

Detailed Description

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:

http://www.ipxe.org/wiki :

scheme = "http", host = "www.ipxe.org", path = "/wiki"

/var/lib/tftpboot :

path = "/var/lib/tftpboot"

bob@n.nosp@m.owhe.nosp@m.re.co.nosp@m.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.

Definition at line 64 of file uri.h.

Field Documentation

◆ refcnt

struct refcnt uri::refcnt

Reference count.

Definition at line 66 of file uri.h.

Referenced by parse_uri(), uri_dup(), uri_get(), and uri_put().

◆ scheme

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().

◆ opaque

const char* uri::opaque

◆ user

const char* uri::user

◆ password

const char* uri::password

◆ host

const char* uri::host

◆ port

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().

◆ path

const char* uri::path

◆ epath

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().

◆ equery

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().

◆ efragment

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().

◆ params

struct parameters* uri::params

The documentation for this struct was generated from the following file: