volume_id
3
HAL Library

# volume_id

## Synopsis

    #define     VOLUME_ID_VERSION
    #define     PACKED
    #define     VOLUME_ID_LABEL_SIZE
    #define     VOLUME_ID_UUID_SIZE
    #define     VOLUME_ID_FORMAT_SIZE
    #define     VOLUME_ID_PATH_MAX
    #define     VOLUME_ID_PARTITIONS_MAX
    struct      volume_id_partition;
    struct      volume_id;
    struct volume_id* volume_id_open_fd         (int fd);
    struct volume_id* volume_id_open_node       (const char *path);
    int         volume_id_probe_all             (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_filesystem      (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_raid            (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    void        volume_id_close                 (struct volume_id *id);
    int         volume_id_probe_cramfs          (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_ext             (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_vfat            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_hfs_hfsplus     (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_hpfs            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_iso9660         (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_jfs             (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_minix           (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_ntfs            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_ocfs1           (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_ocfs2           (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_reiserfs        (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_romfs           (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_sysv            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_udf             (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_ufs             (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_vxfs            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_xfs             (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_squashfs        (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_linux_swap      (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_luks            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_linux_raid      (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_lvm1            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_lvm2            (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_intel_software_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_highpoint_37x_raid
                                                (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_highpoint_45x_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_lsi_mega_raid   (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_nvidia_raid     (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_promise_fasttrack_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_silicon_medley_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_via_raid        (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);
    int         volume_id_probe_msdos_part_table
                                                (struct volume_id *id,
                                                 uint64_t off);
    int         volume_id_probe_mac_partition_map
                                                (struct volume_id *id,
                                                 uint64_t off);

## Description

## Details

### VOLUME_ID_VERSION

    #define VOLUME_ID_VERSION		59

### PACKED

    #define PACKED				__attribute__((packed))

### VOLUME_ID_LABEL_SIZE

    #define VOLUME_ID_LABEL_SIZE		64

### VOLUME_ID_UUID_SIZE

    #define VOLUME_ID_UUID_SIZE		36

### VOLUME_ID_FORMAT_SIZE

    #define VOLUME_ID_FORMAT_SIZE		32

### VOLUME_ID_PATH_MAX

    #define VOLUME_ID_PATH_MAX		256

### VOLUME_ID_PARTITIONS_MAX

    #define VOLUME_ID_PARTITIONS_MAX	256

### struct volume_id_partition

    struct volume_id_partition {
    	enum		volume_id_usage usage_id;
    	char		*usage;
    	char		*type;
    	uint64_t	off;
    	uint64_t	len;
    	uint8_t		partition_type_raw;
    };

### struct volume_id

    struct volume_id {
    	uint8_t		label_raw[VOLUME_ID_LABEL_SIZE];
    	size_t		label_raw_len;
    	char		label[VOLUME_ID_LABEL_SIZE+1];
    	uint8_t		uuid_raw[VOLUME_ID_UUID_SIZE];
    	size_t		uuid_raw_len;
    	char		uuid[VOLUME_ID_UUID_SIZE+1];
    	enum		volume_id_usage usage_id;
    	char		*usage;
    	char		*type;
    	char		type_version[VOLUME_ID_FORMAT_SIZE];

    	struct volume_id_partition *partitions;
    	size_t		partition_count;

    	int		fd;
    	uint8_t		*sbbuf;
    	size_t		sbbuf_len;
    	uint8_t		*seekbuf;
    	uint64_t	seekbuf_off;
    	size_t		seekbuf_len;
    	int		fd_close:1;
    };

### volume_id_open_fd ()

    struct volume_id* volume_id_open_fd         (int fd);

`fd` :

Returns :

### volume_id_open_node ()

    struct volume_id* volume_id_open_node       (const char *path);

`path` :

Returns :

### volume_id_probe_all ()

    int         volume_id_probe_all             (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_filesystem ()

    int         volume_id_probe_filesystem      (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_raid ()

    int         volume_id_probe_raid            (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_close ()

    void        volume_id_close                 (struct volume_id *id);

`id` :

### volume_id_probe_cramfs ()

    int         volume_id_probe_cramfs          (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_ext ()

    int         volume_id_probe_ext             (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_vfat ()

    int         volume_id_probe_vfat            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_hfs_hfsplus ()

    int         volume_id_probe_hfs_hfsplus     (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_hpfs ()

    int         volume_id_probe_hpfs            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_iso9660 ()

    int         volume_id_probe_iso9660         (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_jfs ()

    int         volume_id_probe_jfs             (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_minix ()

    int         volume_id_probe_minix           (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_ntfs ()

    int         volume_id_probe_ntfs            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_ocfs1 ()

    int         volume_id_probe_ocfs1           (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_ocfs2 ()

    int         volume_id_probe_ocfs2           (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_reiserfs ()

    int         volume_id_probe_reiserfs        (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_romfs ()

    int         volume_id_probe_romfs           (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_sysv ()

    int         volume_id_probe_sysv            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_udf ()

    int         volume_id_probe_udf             (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_ufs ()

    int         volume_id_probe_ufs             (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_vxfs ()

    int         volume_id_probe_vxfs            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_xfs ()

    int         volume_id_probe_xfs             (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_squashfs ()

    int         volume_id_probe_squashfs        (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_linux_swap ()

    int         volume_id_probe_linux_swap      (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_luks ()

    int         volume_id_probe_luks            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_linux_raid ()

    int         volume_id_probe_linux_raid      (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_lvm1 ()

    int         volume_id_probe_lvm1            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_lvm2 ()

    int         volume_id_probe_lvm2            (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_intel_software_raid ()

    int         volume_id_probe_intel_software_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_highpoint_37x_raid ()

    int         volume_id_probe_highpoint_37x_raid
                                                (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_highpoint_45x_raid ()

    int         volume_id_probe_highpoint_45x_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_lsi_mega_raid ()

    int         volume_id_probe_lsi_mega_raid   (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_nvidia_raid ()

    int         volume_id_probe_nvidia_raid     (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_promise_fasttrack_raid ()

    int         volume_id_probe_promise_fasttrack_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_silicon_medley_raid ()

    int         volume_id_probe_silicon_medley_raid
                                                (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_via_raid ()

    int         volume_id_probe_via_raid        (struct volume_id *id,
                                                 uint64_t off,
                                                 uint64_t size);

`id` :

`off` :

`size` :

Returns :

### volume_id_probe_msdos_part_table ()

    int         volume_id_probe_msdos_part_table
                                                (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :

### volume_id_probe_mac_partition_map ()

    int         volume_id_probe_mac_partition_map
                                                (struct volume_id *id,
                                                 uint64_t off);

`id` :

`off` :

Returns :