#ifndef TAR_H_ #define TAR_H_ #include #include #include #include #include struct tar { struct tar_bin_header *tar_entries; }; struct tar_bin_header { char filename[100]; char mode[8]; char uid[8]; char gid[8]; char size[12]; char mtime[12]; char chksum[8]; char typeflag[1]; } __attribute__((aligned(512))); struct tar_header { char filename[100]; size_t size; }; struct tar_file { struct tar_header f_header; const void *f_data; }; extern int tar_init(struct tar *tar, uintptr_t base); extern int tar_open(struct tar *tar, const char *path, struct tar_file *out); extern int tar_file_create_vm_object( const struct tar_file *file, kern_handle_t *out); extern int tar_header_decode( const struct tar_bin_header *in, struct tar_header *out); extern enum fs_status tar_mount( struct fs_context *ctx, void *arg, enum fs_mount_flags flags, struct fs_superblock **out); #endif