64 #define IMAGE_REGISTERED 0x0001 67 #define IMAGE_TRUSTED 0x0002 70 #define IMAGE_AUTO_UNREGISTER 0x0004 73 #define IMAGE_HIDDEN 0x0008 132 #define PROBE_MULTIBOOT 01 137 #define PROBE_NORMAL 02 148 #define IMAGE_TYPES __table ( struct image_type, "image_types" ) 151 #define __image_type( probe_order ) __table_entry ( IMAGE_TYPES, probe_order ) 162 #define IMAGE_TAGS __table ( struct image_tag, "image_tags" ) 165 #define __image_tag __table_entry ( IMAGE_TAGS, 01 ) 172 #define for_each_image( image ) \ 173 list_for_each_entry ( (image), &images, list ) 176 #define for_each_image_safe( image, tmp ) \ 177 list_for_each_entry_safe ( (image), (tmp), &images, list ) 210 struct image **extracted );
const char * image_argument(struct image *image, const char *key)
Find argument within image command line.
struct image_tag selected_image
userptr_t data
Raw file image.
int image_set_cmdline(struct image *image, const char *cmdline)
Set image command line.
struct image * find_image_tag(struct image_tag *tag)
Find image by tag.
int register_image(struct image *image)
Register executable image.
struct image_type * type
Image type, if known.
static struct image * image_get(struct image *image)
Increment reference count on an image.
An executable image type.
int image_set_data(struct image *image, userptr_t data, size_t len)
Set image data.
struct image * image
Image (weak reference, nullified when image is freed)
Access to external ("user") memory.
int(* exec)(struct image *image)
Execute image.
char * name
Name of this image type.
char * cmdline
Command line to pass to image.
A doubly-linked list entry (or list head)
int image_set_len(struct image *image, size_t len)
Set image length.
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
struct image_tag current_image
uint32_t userptr_t
A pointer to a user buffer.
int image_asn1(struct image *image, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from image.
int(* asn1)(struct image *image, size_t offset, struct asn1_cursor **cursor)
Extract ASN.1 object from image.
int image_set_uri(struct image *image, struct uri *uri)
Set image URI.
void unregister_image(struct image *image)
Unregister executable image.
struct image * alloc_image(struct uri *uri)
Allocate executable image.
static struct image * first_image(void)
Retrieve first image.
struct image * find_image(const char *name)
Find image by name.
static void image_untrust(struct image *image)
Set image as untrusted.
size_t len
Length of raw file image.
#define ref_get(refcnt)
Get additional reference to object.
char * image_strip_suffix(struct image *image)
Strip dot suffix from image name, if present.
#define IMAGE_HIDDEN
Image will be hidden from enumeration.
#define IMAGE_TRUSTED
Image is trusted.
struct uri * uri
URI of image.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void image_put(struct image *image)
Decrement reference count on an image.
int(* extract)(struct image *image, struct image *extracted)
Extract archive image.
struct image * image_memory(const char *name, userptr_t data, size_t len)
Create registered image from block of memory.
int image_extract(struct image *image, const char *name, struct image **extracted)
Extract archive image.
int image_extract_exec(struct image *image)
Extract and execute image.
int image_pixbuf(struct image *image, struct pixel_buffer **pixbuf)
Create pixel buffer from image.
int(* pixbuf)(struct image *image, struct pixel_buffer **pixbuf)
Create pixel buffer from image.
int image_set_trust(int require_trusted, int permanent)
Change image trust requirement.
static void image_clear_cmdline(struct image *image)
Clear image command line.
uint8_t data[48]
Additional event data.
struct image * replacement
Replacement image.
int image_select(struct image *image)
Select image for execution.
int(* probe)(struct image *image)
Probe image.
A Uniform Resource Identifier.
uint16_t offset
Offset to command line.
static void image_trust(struct image *image)
Set image as trusted.
struct list_head list
List of registered images.
static struct image * image_tag(struct image *image, struct image_tag *tag)
Tag image.
uint64_t tag
Identity tag.
int image_exec(struct image *image)
Execute image.
#define NULL
NULL pointer (VOID *)
int image_replace(struct image *replacement)
Set replacement image.
#define ref_put(refcnt)
Drop reference to object.
struct list_head images
List of registered images.
static void image_hide(struct image *image)
Mark image as hidden.
int image_set_name(struct image *image, const char *name)
Set image name.
struct refcnt refcnt
Reference count.