65#define PEERDIST_DISCOVERY_REQUEST \
66 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \
68 "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" " \
69 "xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" " \
70 "xmlns:wsd=\"http://schemas.xmlsoap.org/ws/2005/04/discovery\" " \
71 "xmlns:PeerDist=\"http://schemas.microsoft.com/p2p/" \
72 "2007/09/PeerDistributionDiscovery\">" \
75 "urn:schemas-xmlsoap-org:ws:2005:04:discovery" \
78 "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe" \
87 "PeerDist:PeerDistData" \
89 "<wsd:Scopes MatchBy=\"http://schemas.xmlsoap.org/ws/" \
90 "2005/04/discovery/strcmp0\">" \
235 DBGC ( reply,
"PCCRD %p missing <wsd:Scopes> tag\n", reply );
242 DBGC ( reply,
"PCCRD %p missing <wsd:XAddrs> tag\n", reply );
248 "PeerDist:BlockCount" );
249 if ( ! blockcount ) {
250 DBGC ( reply,
"PCCRD %p missing <PeerDist:BlockCount> tag\n",
258 max = (
strlen ( blockcount ) /
sizeof ( *count ) );
263 for ( i = 0,
in = scopes,
out = scopes ; *
in ; i++,
in += skip ) {
267 DBGC ( reply,
"PCCRD %p too many segment IDs\n",
275 sizeof ( zcount.
hex ) ) == 0 )
#define NULL
NULL pointer (VOID *)
int asprintf(char **strp, const char *fmt,...)
Write a formatted string to newly allocated memory.
#define assert(condition)
Assert a condition at run-time.
int isspace(int character)
Check to see if character is a space.
uint64_t tag
Identity tag.
uint8_t data[48]
Additional event data.
uint32_t start
Starting offset.
static unsigned int count
Number of entries.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define ENOENT
No such file or directory.
#define EPROTO
Protocol error.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
u8 request[0]
List of IEs requested.
uint32_t end
Ending offset.
static char * peerdist_discovery_reply_values(char *data, size_t len, const char *name)
Locate discovery reply values.
static char * peerdist_discovery_reply_tag(char *data, size_t len, const char *tag)
Locate discovery reply tag.
int peerdist_discovery_reply(char *data, size_t len, struct peerdist_discovery_reply *reply)
Parse discovery reply.
char * peerdist_discovery_request(const char *uuid, const char *id)
Construct discovery request.
#define PEERDIST_DISCOVERY_REQUEST
Discovery request format.
Peer Content Caching and Retrieval: Discovery Protocol [MS-PCCRD].
char hex[8]
Count (as an eight-digit hex value)
int open(const char *uri_string)
Open file.
#define container_of(ptr, type, field)
Get containing structure.
int strncmp(const char *first, const char *second, size_t max)
Compare strings.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
char * strcpy(char *dest, const char *src)
Copy string.
size_t strlen(const char *src)
Get length of string.
A PeerDist discovery reply block count.
char hex[8]
Count (as an eight-digit hex value)
A PeerDist discovery reply.
char * ids
List of segment ID strings.
char * locations
List of peer locations.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
static struct evtchn_close * close