iPXE
Data Structures | Macros | Enumerations | Functions | Variables
pccrr.h File Reference

Peer Content Caching and Retrieval: Retrieval Protocol [MS-PCCRR]. More...

#include <stdint.h>
#include <ipxe/uaccess.h>

Go to the source code of this file.

Data Structures

union  peerdist_msg_version
 Retrieval protocol version. More...
 
struct  peerdist_msg_versions
 Retrieval protocol supported versions. More...
 
struct  peerdist_msg_range
 Retrieval protocol block range. More...
 
struct  peerdist_msg_segment
 Retrieval protocol segment ID header. More...
 
struct  peerdist_msg_ranges
 Retrieval protocol block range list header. More...
 
struct  peerdist_msg_block
 Retrieval protocol data block header. More...
 
struct  peerdist_msg_iv
 Retrieval protocol initialisation vector header. More...
 
struct  peerdist_msg_useless_vrf
 Retrieval protocol useless VRF data header. More...
 
struct  peerdist_msg_header
 Retrieval protocol message header. More...
 
struct  peerdist_msg_transport_header
 Retrieval protocol transport response header. More...
 
struct  peerdist_msg_nego_req
 Retrieval protocol negotiation request. More...
 
struct  peerdist_msg_nego_resp
 Retrieval protocol negotiation response. More...
 
struct  peerdist_msg_getblklist
 Retrieval protocol block list request header. More...
 
struct  peerdist_msg_getblks
 Retrieval protocol block fetch request header. More...
 
struct  peerdist_msg_blklist
 Retrieval protocol block list response header. More...
 
struct  peerdist_msg_blk
 Retrieval protocol block fetch response header. More...
 

Macros

#define PEERDIST_MAGIC_PATH   "/116B50EB-ECE2-41ac-8429-9F9E963361B7/"
 Magic retrieval URI path. More...
 
#define PEERDIST_MSG_VERSION_1_0   0x00000001UL
 Retrieval protocol version 1.0. More...
 
#define PEERDIST_MSG_VERSION_2_0   0x00000002UL
 Retrieval protocol version 2.0. More...
 
#define peerdist_msg_segment_t(digestsize)
 Retrieval protocol segment ID. More...
 
#define peerdist_msg_ranges_t(count)
 Retrieval protocol block range list. More...
 
#define peerdist_msg_block_t(len)
 Retrieval protocol data block. More...
 
#define peerdist_msg_iv_t(blksize)
 Retrieval protocol initialisation vector. More...
 
#define peerdist_msg_useless_vrf_t(vrf_len)
 Retrieval protocol useless VRF data. More...
 
#define PEERDIST_MSG_NEGO_REQ_VERSION   PEERDIST_MSG_VERSION_1_0
 Retrieval protocol negotiation request version. More...
 
#define PEERDIST_MSG_NEGO_REQ_TYPE   0x00000000UL
 Retrieval protocol negotiation request type. More...
 
#define PEERDIST_MSG_NEGO_RESP_VERSION   PEERDIST_MSG_VERSION_1_0
 Retrieval protocol negotiation response version. More...
 
#define PEERDIST_MSG_NEGO_RESP_TYPE   0x00000001UL
 Retrieval protocol negotiation response type. More...
 
#define peerdist_msg_getblklist_t(digestsize, count)
 Retrieval protocol block list request. More...
 
#define PEERDIST_MSG_GETBLKLIST_VERSION   PEERDIST_MSG_VERSION_1_0
 Retrieval protocol block list request version. More...
 
#define PEERDIST_MSG_GETBLKLIST_TYPE   0x00000002UL
 Retrieval protocol block list request type. More...
 
#define peerdist_msg_getblks_t(digestsize, count, vrf_len)
 Retrieval protocol block fetch request. More...
 
#define PEERDIST_MSG_GETBLKS_VERSION   PEERDIST_MSG_VERSION_1_0
 Retrieval protocol block fetch request version. More...
 
#define PEERDIST_MSG_GETBLKS_TYPE   0x00000003UL
 Retrieval protocol block fetch request type. More...
 
#define peerdist_msg_blklist_t(digestsize, count)
 Retrieval protocol block list response. More...
 
#define PEERDIST_MSG_BLKLIST_VERSION   PEERDIST_MSG_VERSION_1_0
 Retrieval protocol block list response version. More...
 
#define PEERDIST_MSG_BLKLIST_TYPE   0x00000004UL
 Retrieval protocol block list response type. More...
 
#define peerdist_msg_blk_t(digestsize, len, vrf_len, blksize)
 Retrieval protocol block fetch response. More...
 
#define PEERDIST_MSG_BLK_VERSION   PEERDIST_MSG_VERSION_1_0
 Retrieval protocol block fetch response version. More...
 
#define PEERDIST_MSG_BLK_TYPE   0x00000005UL
 Retrieval protocol block fetch response type. More...
 
#define peerdist_msg_blk(raw, raw_len, digestsize, blksize, blk)
 Parse retrieval protocol block fetch response. More...
 

Enumerations

enum  peerdist_msg_algorithm { PEERDIST_MSG_PLAINTEXT = 0x00000000UL, PEERDIST_MSG_AES_128_CBC = 0x00000001UL, PEERDIST_MSG_AES_192_CBC = 0x00000002UL, PEERDIST_MSG_AES_256_CBC = 0x00000003UL }
 Retrieval protocol cryptographic algorithm IDs. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
union peerdist_msg_version __attribute__ ((packed))
 Major:minor version number. More...
 
int peerdist_msg_blk_untyped (userptr_t raw, size_t raw_len, size_t digestsize, size_t blksize, void *out)
 

Variables

uint16_t minor
 Minor version number. More...
 
uint16_t major
 Major version number. More...
 
uint32_t raw
 Raw version number. More...
 
union peerdist_msg_version min
 Minimum supported protocol version. More...
 
union peerdist_msg_version max
 Maximum supported protocol version. More...
 
uint32_t first
 First block in range. More...
 
uint32_t count
 Number of blocks in range. More...
 
uint32_t digestsize
 Digest size (i.e. More...
 
uint32_t len
 Length of data block. More...
 
uint32_t blksize
 Cipher block size. More...
 
union peerdist_msg_version version
 Protocol version. More...
 
uint32_t type
 Message type. More...
 
uint32_t algorithm
 Cryptographic algorithm ID. More...
 
enum peerdist_msg_algorithm __attribute__
 
struct peerdist_msg_header hdr
 Message header. More...
 
struct peerdist_msg_versions versions
 Supported versions. More...
 

Detailed Description

Peer Content Caching and Retrieval: Retrieval Protocol [MS-PCCRR].

All fields are in network byte order.

Definition in file pccrr.h.

Macro Definition Documentation

◆ PEERDIST_MAGIC_PATH

#define PEERDIST_MAGIC_PATH   "/116B50EB-ECE2-41ac-8429-9F9E963361B7/"

Magic retrieval URI path.

Definition at line 18 of file pccrr.h.

◆ PEERDIST_MSG_VERSION_1_0

#define PEERDIST_MSG_VERSION_1_0   0x00000001UL

Retrieval protocol version 1.0.

Definition at line 34 of file pccrr.h.

◆ PEERDIST_MSG_VERSION_2_0

#define PEERDIST_MSG_VERSION_2_0   0x00000002UL

Retrieval protocol version 2.0.

Definition at line 37 of file pccrr.h.

◆ peerdist_msg_segment_t

#define peerdist_msg_segment_t (   digestsize)
Value:
struct { \
uint8_t id[digestsize]; \
uint8_t pad[ ( -(digestsize) ) & 0x3 ]; \
} __attribute__ (( packed ))
uint16_t segment
Code segment.
Definition: librm.h:252
u32 pad[9]
Padding.
Definition: ar9003_mac.h:90
Retrieval protocol segment ID header.
Definition: pccrr.h:56
enum peerdist_msg_algorithm __attribute__
uint32_t digestsize
Digest size (i.e.
Definition: pccrr.h:14

Retrieval protocol segment ID.

Parameters
digestsizeDigest size

Definition at line 70 of file pccrr.h.

◆ peerdist_msg_ranges_t

#define peerdist_msg_ranges_t (   count)
Value:
struct { \
struct peerdist_msg_ranges ranges; \
} __attribute__ (( packed ))
uint32_t count
Number of blocks in range.
Definition: pccrr.h:16
static __always_inline void struct pci_range * range
Definition: pcidirect.h:46
Retrieval protocol block range list header.
Definition: pccrr.h:78
enum peerdist_msg_algorithm __attribute__
Retrieval protocol block range.
Definition: pccrr.h:48

Retrieval protocol block range list.

Parameters
countNumber of ranges

Definition at line 91 of file pccrr.h.

◆ peerdist_msg_block_t

#define peerdist_msg_block_t (   len)
Value:
struct { \
uint8_t data[len]; \
} __attribute__ (( packed ))
uint32_t len
Length of data block.
Definition: pccrr.h:14
Retrieval protocol data block header.
Definition: pccrr.h:98
enum peerdist_msg_algorithm __attribute__
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:12
uint8_t data[48]
Additional event data.
Definition: ena.h:22

Retrieval protocol data block.

Definition at line 108 of file pccrr.h.

◆ peerdist_msg_iv_t

#define peerdist_msg_iv_t (   blksize)
Value:
struct { \
struct peerdist_msg_iv iv; \
uint8_t data[blksize]; \
} __attribute__ (( packed ))
u8 iv[16]
Initialization vector.
Definition: wpa.h:60
Retrieval protocol initialisation vector header.
Definition: pccrr.h:115
enum peerdist_msg_algorithm __attribute__
uint8_t data[48]
Additional event data.
Definition: ena.h:22
uint32_t blksize
Cipher block size.
Definition: pccrr.h:14

Retrieval protocol initialisation vector.

Definition at line 125 of file pccrr.h.

◆ peerdist_msg_useless_vrf_t

#define peerdist_msg_useless_vrf_t (   vrf_len)
Value:
struct { \
uint8_t data[vrf_len]; \
uint8_t pad[ ( -(vrf_len) ) & 0x3 ]; \
} __attribute__ (( packed ))
u32 pad[9]
Padding.
Definition: ar9003_mac.h:90
enum peerdist_msg_algorithm __attribute__
uint8_t data[48]
Additional event data.
Definition: ena.h:22
Retrieval protocol useless VRF data header.
Definition: pccrr.h:132

Retrieval protocol useless VRF data.

Definition at line 144 of file pccrr.h.

◆ PEERDIST_MSG_NEGO_REQ_VERSION

#define PEERDIST_MSG_NEGO_REQ_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol negotiation request version.

Definition at line 199 of file pccrr.h.

◆ PEERDIST_MSG_NEGO_REQ_TYPE

#define PEERDIST_MSG_NEGO_REQ_TYPE   0x00000000UL

Retrieval protocol negotiation request type.

Definition at line 202 of file pccrr.h.

◆ PEERDIST_MSG_NEGO_RESP_VERSION

#define PEERDIST_MSG_NEGO_RESP_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol negotiation response version.

Definition at line 213 of file pccrr.h.

◆ PEERDIST_MSG_NEGO_RESP_TYPE

#define PEERDIST_MSG_NEGO_RESP_TYPE   0x00000001UL

Retrieval protocol negotiation response type.

Definition at line 216 of file pccrr.h.

◆ peerdist_msg_getblklist_t

#define peerdist_msg_getblklist_t (   digestsize,
  count 
)
Value:
struct { \
struct peerdist_msg_getblklist getblklist; \
peerdist_msg_segment_t ( digestsize ) segment; \
peerdist_msg_ranges_t ( count ) ranges; \
} __attribute__ (( packed ))
uint16_t segment
Code segment.
Definition: librm.h:252
Retrieval protocol block list request header.
Definition: pccrr.h:219
uint32_t count
Number of blocks in range.
Definition: pccrr.h:16
enum peerdist_msg_algorithm __attribute__
uint32_t digestsize
Digest size (i.e.
Definition: pccrr.h:14

Retrieval protocol block list request.

Parameters
digestsizeDigest size
countBlock range count

Definition at line 234 of file pccrr.h.

◆ PEERDIST_MSG_GETBLKLIST_VERSION

#define PEERDIST_MSG_GETBLKLIST_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block list request version.

Definition at line 242 of file pccrr.h.

◆ PEERDIST_MSG_GETBLKLIST_TYPE

#define PEERDIST_MSG_GETBLKLIST_TYPE   0x00000002UL

Retrieval protocol block list request type.

Definition at line 245 of file pccrr.h.

◆ peerdist_msg_getblks_t

#define peerdist_msg_getblks_t (   digestsize,
  count,
  vrf_len 
)
Value:
struct { \
struct peerdist_msg_getblks getblks; \
peerdist_msg_segment_t ( digestsize ) segment; \
peerdist_msg_ranges_t ( count ) ranges; \
peerdist_msg_useless_vrf_t ( vrf_len ); \
} __attribute__ (( packed ))
uint16_t segment
Code segment.
Definition: librm.h:252
Retrieval protocol block fetch request header.
Definition: pccrr.h:248
uint32_t count
Number of blocks in range.
Definition: pccrr.h:16
enum peerdist_msg_algorithm __attribute__
uint32_t digestsize
Digest size (i.e.
Definition: pccrr.h:14

Retrieval protocol block fetch request.

Parameters
digestsizeDigest size
countBlock range count
vrf_lenLength of uselessness

Definition at line 266 of file pccrr.h.

◆ PEERDIST_MSG_GETBLKS_VERSION

#define PEERDIST_MSG_GETBLKS_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block fetch request version.

Definition at line 275 of file pccrr.h.

◆ PEERDIST_MSG_GETBLKS_TYPE

#define PEERDIST_MSG_GETBLKS_TYPE   0x00000003UL

Retrieval protocol block fetch request type.

Definition at line 278 of file pccrr.h.

◆ peerdist_msg_blklist_t

#define peerdist_msg_blklist_t (   digestsize,
  count 
)
Value:
struct { \
struct peerdist_msg_blklist blklist; \
peerdist_msg_segment_t ( digestsize ) segment; \
peerdist_msg_ranges_t ( count ) ranges; \
uint32_t next; \
} __attribute__ (( packed ))
uint16_t segment
Code segment.
Definition: librm.h:252
uint32_t next
Next descriptor address.
Definition: myson.h:18
Retrieval protocol block list response header.
Definition: pccrr.h:281
uint32_t count
Number of blocks in range.
Definition: pccrr.h:16
enum peerdist_msg_algorithm __attribute__
uint32_t digestsize
Digest size (i.e.
Definition: pccrr.h:14

Retrieval protocol block list response.

Parameters
digestsizeDigest size
countBlock range count

Definition at line 298 of file pccrr.h.

◆ PEERDIST_MSG_BLKLIST_VERSION

#define PEERDIST_MSG_BLKLIST_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block list response version.

Definition at line 307 of file pccrr.h.

◆ PEERDIST_MSG_BLKLIST_TYPE

#define PEERDIST_MSG_BLKLIST_TYPE   0x00000004UL

Retrieval protocol block list response type.

Definition at line 310 of file pccrr.h.

◆ peerdist_msg_blk_t

#define peerdist_msg_blk_t (   digestsize,
  len,
  vrf_len,
  blksize 
)
Value:
struct { \
struct peerdist_msg_blk blk; \
peerdist_msg_segment_t ( digestsize ) segment; \
uint32_t index; \
uint32_t next; \
peerdist_msg_block_t ( len ) block; \
peerdist_msg_useless_vrf_t ( vrf_len ) vrf; \
peerdist_msg_iv_t ( blksize ) iv; \
} __attribute__ (( packed ))
uint32_t len
Length of data block.
Definition: pccrr.h:14
uint16_t segment
Code segment.
Definition: librm.h:252
uint32_t next
Next descriptor address.
Definition: myson.h:18
long index
Definition: bigint.h:61
u8 iv[16]
Initialization vector.
Definition: wpa.h:60
enum peerdist_msg_algorithm __attribute__
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:12
uint32_t blksize
Cipher block size.
Definition: pccrr.h:14
Retrieval protocol block fetch response header.
Definition: pccrr.h:313
uint32_t digestsize
Digest size (i.e.
Definition: pccrr.h:14

Retrieval protocol block fetch response.

Parameters
digestsizeDigest size
lenData block length
vrf_lenLength of uselessness
blksizeCipher block size

Definition at line 336 of file pccrr.h.

◆ PEERDIST_MSG_BLK_VERSION

#define PEERDIST_MSG_BLK_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block fetch response version.

Definition at line 348 of file pccrr.h.

◆ PEERDIST_MSG_BLK_TYPE

#define PEERDIST_MSG_BLK_TYPE   0x00000005UL

Retrieval protocol block fetch response type.

Definition at line 351 of file pccrr.h.

◆ peerdist_msg_blk

#define peerdist_msg_blk (   raw,
  raw_len,
  digestsize,
  blksize,
  blk 
)
Value:
( { \
assert ( sizeof ( (blk)->segment.id ) == (digestsize) ); \
assert ( sizeof ( (blk)->block.data ) == 0 ); \
assert ( sizeof ( (blk)->vrf.data ) == 0 ); \
assert ( sizeof ( (blk)->iv.data ) == blksize ); \
peerdist_msg_blk_untyped ( (raw), (raw_len), (digestsize), \
(blksize), blk ); \
} )
uint16_t segment
Code segment.
Definition: librm.h:252
u8 iv[16]
Initialization vector.
Definition: wpa.h:60
static size_t raw_len
Definition: base16.h:53
uint8_t block[3][8]
DES-encrypted blocks.
Definition: mschapv2.h:12
uint32_t raw
Raw version number.
Definition: pccrr.h:14
uint32_t blksize
Cipher block size.
Definition: pccrr.h:14
uint32_t digestsize
Digest size (i.e.
Definition: pccrr.h:14

Parse retrieval protocol block fetch response.

Parameters
rawRaw data
raw_lenLength of raw data
digestsizeDigest size
blksizeCipher block size
blkStructure to fill in
Return values
rcReturn status code

Definition at line 363 of file pccrr.h.

Enumeration Type Documentation

◆ peerdist_msg_algorithm

Retrieval protocol cryptographic algorithm IDs.

Enumerator
PEERDIST_MSG_PLAINTEXT 

No encryption.

PEERDIST_MSG_AES_128_CBC 

AES-128 in CBC mode.

PEERDIST_MSG_AES_192_CBC 

AES-192 in CBC mode.

PEERDIST_MSG_AES_256_CBC 

AES-256 in CBC mode.

Definition at line 168 of file pccrr.h.

168  {
169  /** No encryption */
170  PEERDIST_MSG_PLAINTEXT = 0x00000000UL,
171  /** AES-128 in CBC mode */
172  PEERDIST_MSG_AES_128_CBC = 0x00000001UL,
173  /** AES-192 in CBC mode */
174  PEERDIST_MSG_AES_192_CBC = 0x00000002UL,
175  /** AES-256 in CBC mode */
176  PEERDIST_MSG_AES_256_CBC = 0x00000003UL,
177 };
AES-128 in CBC mode.
Definition: pccrr.h:172
No encryption.
Definition: pccrr.h:170
AES-192 in CBC mode.
Definition: pccrr.h:174
AES-256 in CBC mode.
Definition: pccrr.h:176

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ __attribute__()

union peerdist_msg_version __attribute__ ( (packed)  )

Major:minor version number.

◆ peerdist_msg_blk_untyped()

int peerdist_msg_blk_untyped ( userptr_t  raw,
size_t  raw_len,
size_t  digestsize,
size_t  blksize,
void *  out 
)

Variable Documentation

◆ minor

uint16_t minor

Minor version number.

Definition at line 25 of file pccrr.h.

◆ major

uint16_t major

Major version number.

Definition at line 27 of file pccrr.h.

◆ raw

uint32_t raw

Raw version number.

Definition at line 14 of file pccrr.h.

◆ min

Minimum supported protocol version.

Definition at line 14 of file pccrr.h.

◆ max

Maximum supported protocol version.

Definition at line 16 of file pccrr.h.

◆ first

uint32_t first

◆ count

uint32_t count

Number of blocks in range.

Number of ranges.

Definition at line 16 of file pccrr.h.

◆ digestsize

uint32_t digestsize

◆ len

uint32_t len

Length of data block.

Length (excluding this header)

Message size (including this header)

Length of useless VRF data.

This seems to be identical in both purpose and value to the length found within the message header, and therefore serves no useful purpose.

Definition at line 14 of file pccrr.h.

◆ blksize

uint32_t blksize

Cipher block size.

Block length in bytes.

Definition at line 14 of file pccrr.h.

Referenced by efi_pxe_mtftp(), peerblk_parse_iv(), pxe_tftp_open(), sandev_parse_iso9660(), and tftp_send_rrq().

◆ version

union peerdist_msg_version version

Protocol version.

This is the protocol version in which the message type was first defined.

Definition at line 18 of file pccrr.h.

◆ type

uint32_t type

Message type.

Definition at line 20 of file pccrr.h.

◆ algorithm

uint32_t algorithm

Cryptographic algorithm ID.

Definition at line 24 of file pccrr.h.

◆ __attribute__

◆ hdr

struct peerdist_msg_header hdr

Message header.

Definition at line 14 of file pccrr.h.

◆ versions

struct peerdist_msg_versions versions

Supported versions.

Definition at line 16 of file pccrr.h.