#ifndef _IPXE_IMAGE_H
#define _IPXE_IMAGE_H
/**
* @file
*
* Executable images
*
*/
struct uri;
struct image_type;
/** An executable image */
struct image {
/** Reference count */
/** List of registered images */
/** URI of image */
/** Name */
char *name;
/** Flags */
unsigned int flags;
/** Command line to pass to image */
char *cmdline;
/** Raw file image */
/** Length of raw file image */
/** Image type, if known */
/** Replacement image
*
* An image wishing to replace itself with another image (in a
* style similar to a Unix exec() call) should return from its
* exec() method with the replacement image set to point to
* the new image.
*
* If an image unregisters itself as a result of being
* executed, it must make sure that its replacement image (if
* any) is registered, otherwise the replacement is likely to
* be freed before it can be executed.
*/
};
/** Image is registered */
/** Image is selected for execution */
/** Image is trusted */
/** An executable image type */
struct image_type {
/** Name of this image type */
char *name;
/** Probe image
*
* @v image Executable image
* @ret rc Return status code
*
* Return success if the image is of this image type.
*/
/**
* Execute image
*
* @v image Executable image
* @ret rc Return status code
*/
};
/**
* Multiboot image probe priority
*
* Multiboot images are also valid executables in another format
* (e.g. ELF), so we must perform the multiboot probe first.
*/
/**
* Normal image probe priority
*/
/**
* PXE image probe priority
*
* PXE images have no signature checks, so will claim all image files.
* They must therefore be tried last in the probe order list.
*/
/** Executable image type table */
/** An executable image type */
extern struct image *current_image;
/** Iterate over all registered images */
/** Iterate over all registered images, safe against deletion */
/**
* Test for existence of images
*
* @ret existence Some images exist
*/
static inline int have_images ( void ) {
return ( ! list_empty ( &images ) );
}
/**
* Retrieve first image
*
* @ret image Image, or NULL
*/
}
extern struct image * image_find_selected ( void );
/**
* Increment reference count on an image
*
* @v image Image
* @ret image Image
*/
return image;
}
/**
* Decrement reference count on an image
*
* @v image Image
*/
}
/**
* Clear image command line
*
* @v image Image
*/
}
/**
* Set image as trusted
*
* @v image Image
*/
}
/**
* Set image as untrusted
*
* @v image Image
*/
}
#endif /* _IPXE_IMAGE_H */