55 struct uri uri_redacted;
56 char *uri_string_redacted;
60 memcpy ( &uri_redacted,
uri,
sizeof ( uri_redacted ) );
66 if ( ! uri_string_redacted ) {
88 goto err_create_downloader;
93 goto err_monojob_wait;
98 goto err_register_image;
103 err_create_downloader:
108 free ( uri_string_redacted );
195 printf (
"Could not create image\n" );
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
struct uri * cwuri
Current working URI.
int create_downloader(struct interface *job, struct image *image)
Instantiate a downloader.
uint64_t tag
Identity tag.
uint8_t data[48]
Additional event data.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOMEM
Not enough space.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
struct image * alloc_image(struct uri *uri)
Allocate executable image.
struct image * find_image(const char *name)
Find image by name.
int register_image(struct image *image)
Register executable image.
struct image * image_memory(const char *name, const void *data, size_t len)
Create registered image from block of memory.
#define IMAGE_TRUSTED
Image is trusted.
static void image_put(struct image *image)
Decrement reference count on an image.
#define IMAGE_TAGS
Image tag table.
#define IMAGE_HIDDEN
Image will be hidden from enumeration.
#define IMAGE_AUTO_UNREGISTER
Image will be automatically unregistered after execution.
int imgdownload(struct uri *uri, unsigned long timeout, struct image **image)
Download a new image.
int imgmem(const char *name, const void *data, size_t len)
Create image from block of memory.
int imgdownload_string(const char *uri_string, unsigned long timeout, struct image **image)
Download a new image.
int imgacquire(const char *name_uri, unsigned long timeout, struct image **image)
Acquire an image.
void imgstat(struct image *image)
Display status of an image.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
Data transfer interface opening.
static void(* free)(struct refcnt *refcnt))
char * strerror(int errno)
Retrieve string representation of error number.
char * name
Name of this image type.
struct image_type * type
Image type, if known.
size_t len
Length of raw file image.
char * cmdline
Command line to pass to image.
A Uniform Resource Identifier.
const char * user
User name.
const char * password
Password.
const char * efragment
Fragment (with original URI encoding)
const char * equery
Query (with original URI encoding)
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
struct uri * parse_uri(const char *uri_string)
Parse URI.
struct uri * resolve_uri(const struct uri *base_uri, struct uri *relative_uri)
Resolve base+relative URI.
char * format_uri_alloc(const struct uri *uri)
Format URI.
Uniform Resource Identifiers.
static void uri_put(struct uri *uri)
Decrement URI reference count.
int printf(const char *fmt,...)
Write a formatted string to the console.