iPXE
Data Structures | Defines | 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...

Defines

#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.
#define peerdist_msg_blk(raw, raw_len, digestsize, blksize, blk)
 Parse retrieval protocol block fetch response.

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.
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.
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.

Detailed Description

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

All fields are in network byte order.

Definition in file pccrr.h.


Define Documentation

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

Magic retrieval URI path.

Definition at line 18 of file pccrr.h.

Referenced by peerblk_retrieval_uri().

#define PEERDIST_MSG_VERSION_1_0   0x00000001UL

Retrieval protocol version 1.0.

Definition at line 34 of file pccrr.h.

#define PEERDIST_MSG_VERSION_2_0   0x00000002UL

Retrieval protocol version 2.0.

Definition at line 37 of file pccrr.h.

Value:
struct {                                                        \
                struct peerdist_msg_segment segment;                    \
                uint8_t id[digestsize];                                 \
                uint8_t pad[ ( -(digestsize) ) & 0x3 ];                 \
        } __attribute__ (( packed ))

Retrieval protocol segment ID.

Parameters:
digestsizeDigest size

Definition at line 70 of file pccrr.h.

Value:
struct {                                                        \
                struct peerdist_msg_ranges ranges;                      \
                struct peerdist_msg_range range[count];                 \
        } __attribute__ (( packed ))

Retrieval protocol block range list.

Parameters:
countNumber of ranges

Definition at line 91 of file pccrr.h.

#define peerdist_msg_block_t (   len)
Value:
struct {                                                        \
                struct peerdist_msg_block block;                        \
                uint8_t data[len];                                      \
        } __attribute__ (( packed ))

Retrieval protocol data block.

Definition at line 108 of file pccrr.h.

#define peerdist_msg_iv_t (   blksize)
Value:
struct {                                                        \
                struct peerdist_msg_iv iv;                              \
                uint8_t data[blksize];                                  \
        } __attribute__ (( packed ))

Retrieval protocol initialisation vector.

Definition at line 125 of file pccrr.h.

#define peerdist_msg_useless_vrf_t (   vrf_len)
Value:
struct {                                                        \
                struct peerdist_msg_useless_vrf vrf;                    \
                uint8_t data[vrf_len];                                  \
                uint8_t pad[ ( -(vrf_len) ) & 0x3 ];                    \
        } __attribute__ (( packed ))

Retrieval protocol useless VRF data.

Definition at line 144 of file pccrr.h.

Retrieval protocol negotiation request version.

Definition at line 199 of file pccrr.h.

#define PEERDIST_MSG_NEGO_REQ_TYPE   0x00000000UL

Retrieval protocol negotiation request type.

Definition at line 202 of file pccrr.h.

Retrieval protocol negotiation response version.

Definition at line 213 of file pccrr.h.

#define PEERDIST_MSG_NEGO_RESP_TYPE   0x00000001UL

Retrieval protocol negotiation response type.

Definition at line 216 of file pccrr.h.

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.

Parameters:
digestsizeDigest size
countBlock range count

Definition at line 234 of file pccrr.h.

Retrieval protocol block list request version.

Definition at line 242 of file pccrr.h.

#define PEERDIST_MSG_GETBLKLIST_TYPE   0x00000002UL

Retrieval protocol block list request type.

Definition at line 245 of file pccrr.h.

#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.

Parameters:
digestsizeDigest size
countBlock range count
vrf_lenLength of uselessness

Definition at line 266 of file pccrr.h.

Referenced by peerblk_retrieval_open().

Retrieval protocol block fetch request version.

Definition at line 275 of file pccrr.h.

Referenced by peerblk_retrieval_open().

#define PEERDIST_MSG_GETBLKS_TYPE   0x00000003UL

Retrieval protocol block fetch request type.

Definition at line 278 of file pccrr.h.

Referenced by peerblk_retrieval_open().

#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 ))

Retrieval protocol block list response.

Parameters:
digestsizeDigest size
countBlock range count

Definition at line 298 of file pccrr.h.

Retrieval protocol block list response version.

Definition at line 307 of file pccrr.h.

#define PEERDIST_MSG_BLKLIST_TYPE   0x00000004UL

Retrieval protocol block list response type.

Definition at line 310 of file pccrr.h.

#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 ))

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.

Retrieval protocol block fetch response version.

Definition at line 348 of file pccrr.h.

#define PEERDIST_MSG_BLK_TYPE   0x00000005UL

Retrieval protocol block fetch response type.

Definition at line 351 of file pccrr.h.

Referenced by peerblk_parse_header().

#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 );                    \
        } )

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

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.

                            {
        /** No encryption */
        PEERDIST_MSG_PLAINTEXT = 0x00000000UL,
        /** AES-128 in CBC mode */
        PEERDIST_MSG_AES_128_CBC = 0x00000001UL,
        /** AES-192 in CBC mode */
        PEERDIST_MSG_AES_192_CBC = 0x00000002UL,
        /** AES-256 in CBC mode */
        PEERDIST_MSG_AES_256_CBC = 0x00000003UL,
};

Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
union peerdist_msg_version __attribute__ ( (packed)  )

Major:minor version number.

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

Variable Documentation

Minor version number.

Definition at line 32 of file pccrr.h.

Major version number.

Definition at line 34 of file pccrr.h.

Raw version number.

Definition at line 33 of file pccrr.h.

Minimum supported protocol version.

Definition at line 47 of file pccrr.h.

Maximum supported protocol version.

Definition at line 49 of file pccrr.h.

First block in range.

Definition at line 55 of file pccrr.h.

Number of blocks in range.

Number of ranges.

Definition at line 57 of file pccrr.h.

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

Cipher block size.

Definition at line 124 of file pccrr.h.

Protocol version.

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

Definition at line 171 of file pccrr.h.

Message type.

Definition at line 173 of file pccrr.h.

Cryptographic algorithm ID.

Definition at line 177 of file pccrr.h.

Message header.

Definition at line 198 of file pccrr.h.

Supported versions.

Definition at line 200 of file pccrr.h.