iPXE
pccrr.h File Reference

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

#include <stdint.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...
struct  peerdist_retrieval
 A retrieval protocol mechanism. More...

Macros

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

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)
 FILE_SECBOOT (PERMITTED)
union peerdist_msg_version __attribute__ ((packed))
 Major:minor version number.

Variables

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

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 20 of file pccrr.h.

Referenced by peerdist_open_post().

◆ PEERDIST_MSG_VERSION_1_0

#define PEERDIST_MSG_VERSION_1_0   0x00000001UL

Retrieval protocol version 1.0.

Definition at line 36 of file pccrr.h.

◆ PEERDIST_MSG_VERSION_2_0

#define PEERDIST_MSG_VERSION_2_0   0x00000002UL

Retrieval protocol version 2.0.

Definition at line 39 of file pccrr.h.

◆ peerdist_msg_segment_t

#define peerdist_msg_segment_t ( digestsize)
Value:
struct { \
uint8_t pad[ ( -(digestsize) ) & 0x3 ]; \
} __attribute__ (( packed ))
u32 pad[9]
Padding.
Definition ar9003_mac.h:23
unsigned char uint8_t
Definition stdint.h:10
#define __attribute__(x)
Definition compiler.h:10
uint16_t segment
Code segment.
Definition librm.h:3
uint32_t digestsize
Digest size (i.e.
Definition pccrr.h:1
Retrieval protocol segment ID header.
Definition pccrr.h:58

Retrieval protocol segment ID.

Parameters
digestsizeDigest size

Definition at line 72 of file pccrr.h.

72#define peerdist_msg_segment_t( digestsize ) \
73 struct { \
74 struct peerdist_msg_segment segment; \
75 uint8_t id[digestsize]; \
76 uint8_t pad[ ( -(digestsize) ) & 0x3 ]; \
77 } __attribute__ (( packed ))

◆ peerdist_msg_ranges_t

#define peerdist_msg_ranges_t ( count)
Value:
struct { \
struct peerdist_msg_ranges ranges; \
} __attribute__ (( packed ))
static unsigned int count
Number of entries.
Definition dwmac.h:220
struct pci_range range
PCI bus:dev.fn address range.
Definition pcicloud.c:40
Retrieval protocol block range.
Definition pccrr.h:50
Retrieval protocol block range list header.
Definition pccrr.h:80

Retrieval protocol block range list.

Parameters
countNumber of ranges

Definition at line 93 of file pccrr.h.

93#define peerdist_msg_ranges_t( count ) \
94 struct { \
95 struct peerdist_msg_ranges ranges; \
96 struct peerdist_msg_range range[count]; \
97 } __attribute__ (( packed ))

◆ peerdist_msg_block_t

#define peerdist_msg_block_t ( len)
Value:
struct { \
} __attribute__ (( packed ))
ring len
Length.
Definition dwmac.h:226
uint8_t data[48]
Additional event data.
Definition ena.h:11
uint8_t block[3][8]
DES-encrypted blocks.
Definition mschapv2.h:1
Retrieval protocol data block header.
Definition pccrr.h:100

Retrieval protocol data block.

Definition at line 110 of file pccrr.h.

110#define peerdist_msg_block_t( len ) \
111 struct { \
112 struct peerdist_msg_block block; \
113 uint8_t data[len]; \
114 } __attribute__ (( packed ))

◆ peerdist_msg_iv_t

#define peerdist_msg_iv_t ( blksize)
Value:
struct { \
struct peerdist_msg_iv iv; \
} __attribute__ (( packed ))
uint32_t blksize
Cipher block size.
Definition pccrr.h:1
Retrieval protocol initialisation vector header.
Definition pccrr.h:117
u8 iv[16]
Initialization vector.
Definition wpa.h:33

Retrieval protocol initialisation vector.

Definition at line 127 of file pccrr.h.

127#define peerdist_msg_iv_t( blksize ) \
128 struct { \
129 struct peerdist_msg_iv iv; \
130 uint8_t data[blksize]; \
131 } __attribute__ (( packed ))

◆ 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 ))
Retrieval protocol useless VRF data header.
Definition pccrr.h:134

Retrieval protocol useless VRF data.

Definition at line 146 of file pccrr.h.

146#define peerdist_msg_useless_vrf_t( vrf_len ) \
147 struct { \
148 struct peerdist_msg_useless_vrf vrf; \
149 uint8_t data[vrf_len]; \
150 uint8_t pad[ ( -(vrf_len) ) & 0x3 ]; \
151 } __attribute__ (( packed ))

◆ PEERDIST_MSG_NEGO_REQ_VERSION

#define PEERDIST_MSG_NEGO_REQ_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol negotiation request version.

Definition at line 201 of file pccrr.h.

◆ PEERDIST_MSG_NEGO_REQ_TYPE

#define PEERDIST_MSG_NEGO_REQ_TYPE   0x00000000UL

Retrieval protocol negotiation request type.

Definition at line 204 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 215 of file pccrr.h.

◆ PEERDIST_MSG_NEGO_RESP_TYPE

#define PEERDIST_MSG_NEGO_RESP_TYPE   0x00000001UL

Retrieval protocol negotiation response type.

Definition at line 218 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 ))
Retrieval protocol block list request header.
Definition pccrr.h:221

Retrieval protocol block list request.

Parameters
digestsizeDigest size
countBlock range count

Definition at line 236 of file pccrr.h.

236#define peerdist_msg_getblklist_t( digestsize, count ) \
237 struct { \
238 struct peerdist_msg_getblklist getblklist; \
239 peerdist_msg_segment_t ( digestsize ) segment; \
240 peerdist_msg_ranges_t ( count ) ranges; \
241 } __attribute__ (( packed ))

◆ PEERDIST_MSG_GETBLKLIST_VERSION

#define PEERDIST_MSG_GETBLKLIST_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block list request version.

Definition at line 244 of file pccrr.h.

◆ PEERDIST_MSG_GETBLKLIST_TYPE

#define PEERDIST_MSG_GETBLKLIST_TYPE   0x00000002UL

Retrieval protocol block list request type.

Definition at line 247 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 ))
Retrieval protocol block fetch request header.
Definition pccrr.h:250

Retrieval protocol block fetch request.

Parameters
digestsizeDigest size
countBlock range count
vrf_lenLength of uselessness

Definition at line 268 of file pccrr.h.

268#define peerdist_msg_getblks_t( digestsize, count, vrf_len ) \
269 struct { \
270 struct peerdist_msg_getblks getblks; \
271 peerdist_msg_segment_t ( digestsize ) segment; \
272 peerdist_msg_ranges_t ( count ) ranges; \
273 peerdist_msg_useless_vrf_t ( vrf_len ); \
274 } __attribute__ (( packed ))

Referenced by peerdist_open_post().

◆ PEERDIST_MSG_GETBLKS_VERSION

#define PEERDIST_MSG_GETBLKS_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block fetch request version.

Definition at line 277 of file pccrr.h.

Referenced by peerdist_open_post().

◆ PEERDIST_MSG_GETBLKS_TYPE

#define PEERDIST_MSG_GETBLKS_TYPE   0x00000003UL

Retrieval protocol block fetch request type.

Definition at line 280 of file pccrr.h.

Referenced by peerdist_open_post().

◆ 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; \
} __attribute__ (( packed ))
unsigned int uint32_t
Definition stdint.h:12
uint32_t next
Next descriptor address.
Definition dwmac.h:11
Retrieval protocol block list response header.
Definition pccrr.h:283

Retrieval protocol block list response.

Parameters
digestsizeDigest size
countBlock range count

Definition at line 300 of file pccrr.h.

300#define peerdist_msg_blklist_t( digestsize, count ) \
301 struct { \
302 struct peerdist_msg_blklist blklist; \
303 peerdist_msg_segment_t ( digestsize ) segment; \
304 peerdist_msg_ranges_t ( count ) ranges; \
305 uint32_t next; \
306 } __attribute__ (( packed ))

◆ PEERDIST_MSG_BLKLIST_VERSION

#define PEERDIST_MSG_BLKLIST_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block list response version.

Definition at line 309 of file pccrr.h.

◆ PEERDIST_MSG_BLKLIST_TYPE

#define PEERDIST_MSG_BLKLIST_TYPE   0x00000004UL

Retrieval protocol block list response type.

Definition at line 312 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; \
peerdist_msg_block_t ( len ) block; \
peerdist_msg_useless_vrf_t ( vrf_len ) vrf; \
peerdist_msg_iv_t ( blksize ) iv; \
} __attribute__ (( packed ))
long index
Definition bigint.h:30
Retrieval protocol block fetch response header.
Definition pccrr.h:315

Retrieval protocol block fetch response.

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

Definition at line 338 of file pccrr.h.

338#define peerdist_msg_blk_t( digestsize, len, vrf_len, blksize ) \
339 struct { \
340 struct peerdist_msg_blk blk; \
341 peerdist_msg_segment_t ( digestsize ) segment; \
342 uint32_t index; \
343 uint32_t next; \
344 peerdist_msg_block_t ( len ) block; \
345 peerdist_msg_useless_vrf_t ( vrf_len ) vrf; \
346 peerdist_msg_iv_t ( blksize ) iv; \
347 } __attribute__ (( packed ))

◆ PEERDIST_MSG_BLK_VERSION

#define PEERDIST_MSG_BLK_VERSION   PEERDIST_MSG_VERSION_1_0

Retrieval protocol block fetch response version.

Definition at line 350 of file pccrr.h.

◆ PEERDIST_MSG_BLK_TYPE

#define PEERDIST_MSG_BLK_TYPE   0x00000005UL

Retrieval protocol block fetch response type.

Definition at line 353 of file pccrr.h.

Referenced by peerblk_parse_header().

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 170 of file pccrr.h.

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

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ __attribute__()

union peerdist_msg_version __attribute__ ( (packed) )

Major:minor version number.

Variable Documentation

◆ minor

uint16_t minor

Minor version number.

Definition at line 1 of file pccrr.h.

◆ major

uint16_t major

Major version number.

Definition at line 3 of file pccrr.h.

◆ raw

uint32_t raw ( void )

Raw version number.

Definition at line 1 of file pccrr.h.

◆ min

Minimum supported protocol version.

Definition at line 1 of file pccrr.h.

◆ max

Maximum supported protocol version.

Definition at line 3 of file pccrr.h.

◆ first

◆ count

uint32_t count

Number of blocks in range.

Number of ranges.

Definition at line 3 of file pccrr.h.

◆ 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 1 of file pccrr.h.

◆ blksize

uint32_t blksize

◆ version

union peerdist_msg_version version

Protocol version.

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

Definition at line 5 of file pccrr.h.

◆ type

uint32_t type

Message type.

Definition at line 7 of file pccrr.h.

◆ algorithm

uint32_t algorithm

Cryptographic algorithm ID.

Definition at line 11 of file pccrr.h.

◆ hdr

struct peerdist_msg_header hdr

Message header.

Definition at line 1 of file pccrr.h.

◆ versions

struct peerdist_msg_versions versions

Supported versions.

Definition at line 3 of file pccrr.h.

◆ peerdist_post

struct peerdist_retrieval peerdist_post
extern

PeerDist retrieval protocol using HTTP POST.

Definition at line 143 of file pccrr.c.

143 {
144 .name = "POST",
145 .open = peerdist_open_post,
146};
static int peerdist_open_post(struct interface *xfer, const char *location, size_t digestsize, const uint8_t *id, unsigned int block)
Open retrieval protocol connection using HTTP POST.
Definition pccrr.c:90

Referenced by peerdisc_create(), and peerdisc_socket_rx().

◆ peerdist_get

struct peerdist_retrieval peerdist_get
extern

PeerDist retrieval protocol using HTTP GET or local file.

Definition at line 190 of file pccrr.c.

190 {
191 .name = "GET",
192 .open = peerdist_open_get,
193};
static int peerdist_open_get(struct interface *xfer, const char *location, size_t digestsize, const uint8_t *id, unsigned int block)
Open retrieval protocol connection using HTTP GET or local file.
Definition pccrr.c:158

Referenced by peerdisc_create().