Commit Graph

10 Commits

Author SHA1 Message Date
Christian Ebner
be5d68aa8a format/encoder/decoder: new pxar entry type Prelude
Introduces a new pxar format entry type `Prelude` and the associated
encoder and decoder methods.
A prelude starts with header marker `PXAR_PRELUDE` followed by raw
byte content, used to store additional metadata associated with the
pxar archive, e.g. command line arguments passed on archive creation.

The prelude's content has no fixed encoding format but is stored as
an raw, arbitrary byte slice. A prelude entry is encoded right after
a pxar format version entry, both being encoded in the metadata
archive in case of an archive with dedicated payload output.

The prelude is not backwards compatible to pxar format version 1.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-06-05 09:24:22 +02:00
Christian Ebner
0983094c87 format/encoder/decoder: new pxar entry type Version
Introduces a new pxar format entry type `Version` and the associated
encoder and decoder methods. The format version entry is only allowed
once, as the first entry of the pxar archive, marked with a
`PXAR_FORMAT_VERSION` header followed by the encoded version number.
If not present, the default format version 1 is assumed as encoding
format for the archive.

The entry allows to early detect incompatibility with an encoded
archive and bail or switch mode based on the encountered version.

The format version entry is not backwards compatible to pxar format
version 1.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-06-05 09:24:22 +02:00
Christian Ebner
ef8b723734 format: add payload stream start marker
Mark the beginning of the payload stream with a magic number. Allows for
version and file type detection.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-06-05 09:24:22 +02:00
Christian Ebner
d51db63953 encoder/format: finish payload stream with marker
Mark the end of the optional payload stream, this makes sure that at
least some bytes are written to the stream (as empty archives are not
allowed by the proxmox backup server) and possible injected chunks
must be consumed.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-06-05 09:24:22 +02:00
Christian Ebner
d3447d0149 format/examples: add header type PXAR_PAYLOAD_REF
Introduces the header type `PXAR_PAYLOAD_REF` to mark regular file
entry payloads, not encoded within the regular pxar archive but
rather redirected to a dedicated payload output writer.
It therefore substitutes the `PXAR_PAYLOAD` header type for these
entries.

The header marks the start and size for a `PayloadRef` typed object
in the archive, storing the offset to the payload header offset in the
payload stream of the dedicated payload output as well as the payload
size.

The `PayloadRef` provides the means to store, serialize and
deserialize the entry.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-05-23 14:39:11 +02:00
Christian Ebner
f5be8e5c6d format/examples: Fix typo in PXAR_PAYLOAD description
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-02-28 19:09:31 +01:00
Christian Ebner
00d36bf97b format: Document source of format const values
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2023-05-17 11:27:08 +02:00
Wolfgang Bumiller
57bee6f8f0 update mk-format-hashes for a new ENTRY
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-07-29 07:31:22 +02:00
Wolfgang Bumiller
37774a671d formatting fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-25 12:14:07 +02:00
Wolfgang Bumiller
1b1e52a46a new hashes for the entire archive foramt
This breaks all previous pxar files and represents a clear
cut off of the catar format.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-06-24 13:31:34 +02:00