|
iPXE
|
Data URIs. More...
#include <string.h>#include <strings.h>#include <errno.h>#include <ipxe/base64.h>#include <ipxe/blob.h>#include <ipxe/open.h>#include <ipxe/datauri.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (PERMITTED) | |
| int | datauri_parse (struct uri *uri, void *buf) |
| Parse data URI. | |
| static int | datauri_open (struct interface *xfer, struct uri *uri) |
| Open data URI. | |
Variables | |
| struct uri_opener data_uri_opener | __uri_opener |
| Data URI opener. | |
Data URIs.
The "data" URI scheme is defined in RFC 2397. In the interest of reducing code size, we support only a practical subset of the specification. Media types will be ignored (and must not contain a literal comma character). Base64 encoding is supported.
URI encoding will already have been stripped by the URI parser. Special characters may therefore be used in the URI string (e.g. "hello%20world"). However, URI-encoded NUL bytes (%00) will not work as expected, since they will be interpreted as terminating the URI string. If NUL bytes are required, then Base64 encoding must be used instead.
Definition in file datauri.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | PERMITTED | ) |
| int datauri_parse | ( | struct uri * | uri, |
| void * | buf ) |
Parse data URI.
| uri | Data URI |
| buf | Buffer to fill in |
| len | Length of data, or negative error |
The buffer length must be at least the size reported by datauri_max_len().
Definition at line 62 of file datauri.c.
References base64_decode(), DBGC, DBGC_HDA, EINVAL, len, uri::opaque, rc, strchr(), strcpy(), strerror(), strlen(), and strncasecmp().
Referenced by datauri_fail_okx(), datauri_okx(), and datauri_open().
Open data URI.
| xfer | Data transfer interface |
| uri | URI |
| rc | Return status code |
Definition at line 118 of file datauri.c.
References blob_open(), data, datauri_max_len(), datauri_parse(), ENOMEM, free, len, malloc(), and rc.
| struct uri_opener data_uri_opener __uri_opener |
Data URI opener.