18 #define PEERDIST_MAGIC_PATH "/116B50EB-ECE2-41ac-8429-9F9E963361B7/" 34 #define PEERDIST_MSG_VERSION_1_0 0x00000001UL 37 #define PEERDIST_MSG_VERSION_2_0 0x00000002UL 70 #define peerdist_msg_segment_t( digestsize ) \ 72 struct peerdist_msg_segment segment; \ 73 uint8_t id[digestsize]; \ 74 uint8_t pad[ ( -(digestsize) ) & 0x3 ]; \ 75 } __attribute__ (( packed )) 91 #define peerdist_msg_ranges_t( count ) \ 93 struct peerdist_msg_ranges ranges; \ 94 struct peerdist_msg_range range[count]; \ 95 } __attribute__ (( packed )) 108 #define peerdist_msg_block_t( len ) \ 110 struct peerdist_msg_block block; \ 112 } __attribute__ (( packed )) 125 #define peerdist_msg_iv_t( blksize ) \ 127 struct peerdist_msg_iv iv; \ 128 uint8_t data[blksize]; \ 129 } __attribute__ (( packed )) 144 #define peerdist_msg_useless_vrf_t( vrf_len ) \ 146 struct peerdist_msg_useless_vrf vrf; \ 147 uint8_t data[vrf_len]; \ 148 uint8_t pad[ ( -(vrf_len) ) & 0x3 ]; \ 149 } __attribute__ (( packed )) 199 #define PEERDIST_MSG_NEGO_REQ_VERSION PEERDIST_MSG_VERSION_1_0 202 #define PEERDIST_MSG_NEGO_REQ_TYPE 0x00000000UL 213 #define PEERDIST_MSG_NEGO_RESP_VERSION PEERDIST_MSG_VERSION_1_0 216 #define PEERDIST_MSG_NEGO_RESP_TYPE 0x00000001UL 234 #define peerdist_msg_getblklist_t( digestsize, count ) \ 236 struct peerdist_msg_getblklist getblklist; \ 237 peerdist_msg_segment_t ( digestsize ) segment; \ 238 peerdist_msg_ranges_t ( count ) ranges; \ 239 } __attribute__ (( packed )) 242 #define PEERDIST_MSG_GETBLKLIST_VERSION PEERDIST_MSG_VERSION_1_0 245 #define PEERDIST_MSG_GETBLKLIST_TYPE 0x00000002UL 266 #define peerdist_msg_getblks_t( digestsize, count, vrf_len ) \ 268 struct peerdist_msg_getblks getblks; \ 269 peerdist_msg_segment_t ( digestsize ) segment; \ 270 peerdist_msg_ranges_t ( count ) ranges; \ 271 peerdist_msg_useless_vrf_t ( vrf_len ); \ 272 } __attribute__ (( packed )) 275 #define PEERDIST_MSG_GETBLKS_VERSION PEERDIST_MSG_VERSION_1_0 278 #define PEERDIST_MSG_GETBLKS_TYPE 0x00000003UL 298 #define peerdist_msg_blklist_t( digestsize, count ) \ 300 struct peerdist_msg_blklist blklist; \ 301 peerdist_msg_segment_t ( digestsize ) segment; \ 302 peerdist_msg_ranges_t ( count ) ranges; \ 304 } __attribute__ (( packed )) 307 #define PEERDIST_MSG_BLKLIST_VERSION PEERDIST_MSG_VERSION_1_0 310 #define PEERDIST_MSG_BLKLIST_TYPE 0x00000004UL 336 #define peerdist_msg_blk_t( digestsize, len, vrf_len, blksize ) \ 338 struct peerdist_msg_blk blk; \ 339 peerdist_msg_segment_t ( digestsize ) segment; \ 342 peerdist_msg_block_t ( len ) block; \ 343 peerdist_msg_useless_vrf_t ( vrf_len ) vrf; \ 344 peerdist_msg_iv_t ( blksize ) iv; \ 345 } __attribute__ (( packed )) 348 #define PEERDIST_MSG_BLK_VERSION PEERDIST_MSG_VERSION_1_0 351 #define PEERDIST_MSG_BLK_TYPE 0x00000005UL 363 #define peerdist_msg_blk( raw, raw_len, digestsize, blksize, blk ) ( { \ 364 assert ( sizeof ( (blk)->segment.id ) == (digestsize) ); \ 365 assert ( sizeof ( (blk)->block.data ) == 0 ); \ 366 assert ( sizeof ( (blk)->vrf.data ) == 0 ); \ 367 assert ( sizeof ( (blk)->iv.data ) == blksize ); \ 368 peerdist_msg_blk_untyped ( (raw), (raw_len), (digestsize), \
uint16_t minor
Minor version number.
Retrieval protocol block fetch request header.
Retrieval protocol negotiation response.
Retrieval protocol block list request header.
struct peerdist_msg_header hdr
Message header.
Retrieval protocol block list response header.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Access to external ("user") memory.
struct peerdist_msg_header hdr
Message header.
uint32_t first
First block in range.
uint32_t blksize
Cipher block size.
uint32_t userptr_t
A pointer to a user buffer.
Retrieval protocol segment ID header.
Retrieval protocol negotiation request.
Retrieval protocol initialisation vector header.
struct peerdist_msg_header hdr
Message header.
struct peerdist_msg_header hdr
Message header.
uint32_t count
Number of ranges.
struct peerdist_msg_version::@637 __attribute__((packed))
Major:minor version number.
union peerdist_msg_version max
Maximum supported protocol version.
uint16_t major
Major version number.
Retrieval protocol data block header.
Retrieval protocol block range list header.
int peerdist_msg_blk_untyped(userptr_t raw, size_t raw_len, size_t digestsize, size_t blksize, void *out)
peerdist_msg_algorithm
Retrieval protocol cryptographic algorithm IDs.
enum peerdist_msg_algorithm __attribute__
struct peerdist_msg_versions versions
Supported versions.
Retrieval protocol version.
uint32_t len
Length of useless VRF data.
uint32_t raw
Raw version number.
union peerdist_msg_version min
Minimum supported protocol version.
Retrieval protocol block range.
Retrieval protocol supported versions.
struct peerdist_msg_versions versions
Supported versions.
uint32_t count
Number of blocks in range.
uint32_t blksize
Cipher block size.
uint32_t raw
Raw version number.
Retrieval protocol useless VRF data header.
Retrieval protocol block fetch response header.
uint32_t digestsize
Digest size (i.e.
uint32_t len
Length of data block.
struct peerdist_msg_header hdr
Message header.
uint32_t digestsize
Digest size (i.e.
struct peerdist_msg_header hdr
Message header.