92 unsigned int block ) {
93 char uri_string[ 7 +
strlen ( location ) +
101 memset ( &req, 0,
sizeof ( req ) );
104 req.getblks.hdr.len =
htonl (
sizeof ( req ) );
108 req.ranges.ranges.count =
htonl ( 1 );
110 req.ranges.range[0].count =
htonl ( 1 );
113 memset ( &content, 0,
sizeof ( content ) );
115 content.
len =
sizeof ( req );
118 snprintf ( uri_string,
sizeof ( uri_string ),
130 &content ) ) != 0 ) {
131 DBGC ( xfer,
"PCCRR %p could not open %s: %s\n",
160 unsigned int block ) {
161 char uri_string[
strlen ( location ) + 4 +
170 len =
snprintf ( uri_string,
sizeof ( uri_string ),
"%s/%02x/",
174 (
sizeof ( uri_string ) -
len ) );
181 DBGC ( xfer,
"PCCRR %p could not open %s: %s\n",
#define NULL
NULL pointer (VOID *).
struct arbelprm_rc_send_wqe rc
#define assert(condition)
Assert a condition at run-time.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOMEM
Not enough space.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Hyper Text Transport Protocol.
int http_open(struct interface *xfer, struct http_method *method, struct uri *uri, struct http_request_range *range, struct http_request_content *content)
Open HTTP transaction.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
uint8_t block[3][8]
DES-encrypted blocks.
int xfer_open_uri_string(struct interface *intf, const char *uri_string)
Open URI string.
Data transfer interface opening.
Peer Content Caching and Retrieval: Content Identification [MS-PCCRC].
#define PEERDIST_DIGEST_MAX_SIZE
Maximum digest size for any supported algorithm.
struct peerdist_retrieval peerdist_get
PeerDist retrieval protocol using HTTP GET or local file.
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.
struct peerdist_retrieval peerdist_post
PeerDist retrieval protocol using HTTP POST.
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.
Peer Content Caching and Retrieval: Retrieval Protocol [MS-PCCRR].
#define peerdist_msg_getblks_t(digestsize, count, vrf_len)
Retrieval protocol block fetch request.
#define PEERDIST_MAGIC_PATH
Magic retrieval URI path.
#define PEERDIST_MSG_GETBLKS_VERSION
Retrieval protocol block fetch request version.
@ PEERDIST_MSG_AES_128_CBC
AES-128 in CBC mode.
#define PEERDIST_MSG_GETBLKS_TYPE
Retrieval protocol block fetch request type.
uint32_t digestsize
Digest size (i.e.
char * strerror(int errno)
Retrieve string representation of error number.
size_t strlen(const char *src)
Get length of string.
HTTP request content descriptor.
size_t len
Content length.
const void * data
Content data (if any).
A retrieval protocol mechanism.
A Uniform Resource Identifier.
struct uri * parse_uri(const char *uri_string)
Parse URI.
Uniform Resource Identifiers.
static void uri_put(struct uri *uri)
Decrement URI reference count.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.