64 #define PEERDIST_DISCOVERY_REQUEST \ 65 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" \ 67 "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" " \ 68 "xmlns:wsa=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\" " \ 69 "xmlns:wsd=\"http://schemas.xmlsoap.org/ws/2005/04/discovery\" " \ 70 "xmlns:PeerDist=\"http://schemas.microsoft.com/p2p/" \ 71 "2007/09/PeerDistributionDiscovery\">" \ 74 "urn:schemas-xmlsoap-org:ws:2005:04:discovery" \ 77 "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe" \ 86 "PeerDist:PeerDistData" \ 88 "<wsd:Scopes MatchBy=\"http://schemas.xmlsoap.org/ws/" \ 89 "2005/04/discovery/strcmp0\">" \ 234 DBGC ( reply,
"PCCRD %p missing <wsd:Scopes> tag\n", reply );
241 DBGC ( reply,
"PCCRD %p missing <wsd:XAddrs> tag\n", reply );
247 "PeerDist:BlockCount" );
248 if ( ! blockcount ) {
249 DBGC ( reply,
"PCCRD %p missing <PeerDist:BlockCount> tag\n",
257 max = (
strlen ( blockcount ) /
sizeof ( *count ) );
262 for ( i = 0,
in = scopes,
out = scopes ; *
in ; i++,
in += skip ) {
266 DBGC ( reply,
"PCCRD %p too many segment IDs\n",
274 sizeof ( zcount.
hex ) ) == 0 )
A PeerDist discovery reply block count.
static __always_inline void off_t int c
#define PEERDIST_DISCOVERY_REQUEST
Discovery request format.
#define ENOENT
No such file or directory.
char hex[8]
Count (as an eight-digit hex value)
int strncmp(const char *first, const char *second, size_t max)
Compare strings.
uint32_t start
Starting offset.
char * peerdist_discovery_request(const char *uuid, const char *id)
Construct discovery request.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define container_of(ptr, type, field)
Get containing structure.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Peer Content Caching and Retrieval: Discovery Protocol [MS-PCCRD].
A PeerDist discovery reply.
uint16_t count
Number of entries.
char * strcpy(char *dest, const char *src)
Copy string.
char * locations
List of peer locations.
#define EPROTO
Protocol error.
int asprintf(char **strp, const char *fmt,...)
Write a formatted string to newly allocated memory.
int isspace(int character)
Check to see if character is a space.
size_t strlen(const char *src)
Get length of string.
char hex[8]
Count (as an eight-digit hex value)
char * ids
List of segment ID strings.
u8 request[0]
List of IEs requested.
int open(const char *uri_string)
Open file.
uint32_t end
Ending offset.
uint8_t data[48]
Additional event data.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
static char * peerdist_discovery_reply_tag(char *data, size_t len, const char *tag)
Locate discovery reply tag.
static struct evtchn_close * close
int peerdist_discovery_reply(char *data, size_t len, struct peerdist_discovery_reply *reply)
Parse discovery reply.
uint64_t tag
Identity tag.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
static char * peerdist_discovery_reply_values(char *data, size_t len, const char *name)
Locate discovery reply values.