|
| #define | PEERDIST_DISCOVERY_PORT 3702 |
| | PeerDist discovery port.
|
| #define | PEERDIST_DISCOVERY_IPV4 ( ( 239 << 24 ) | ( 255 << 16 ) | ( 255 << 8 ) | ( 250 << 0 ) ) |
| | PeerDist discovery IPv4 address (239.255.255.250)
|
| #define | PEERDIST_DISCOVERY_IPV6 { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc } |
| | PeerDist discovery IPv6 address (ff02::c)
|
Peer Content Caching and Retrieval: Discovery Protocol [MS-PCCRD].
Definition in file pccrd.h.
| int peerdist_discovery_reply |
( |
char * | data, |
|
|
size_t | len, |
|
|
struct peerdist_discovery_reply * | reply ) |
|
extern |
Parse discovery reply.
- Parameters
-
| data | Reply data (not NUL-terminated, will be modified) |
| len | Length of reply data |
| reply | Discovery reply to fill in |
- Return values
-
The discovery reply includes pointers to strings within the modified reply data.
Definition at line 217 of file pccrd.c.
218 {
220 .hex = "00000000",
221 };
224 unsigned int i;
225 char *scopes;
226 char *xaddrs;
227 char *blockcount;
230 size_t skip;
231
232
234 if ( ! scopes ) {
235 DBGC ( reply,
"PCCRD %p missing <wsd:Scopes> tag\n", reply );
237 }
238
239
241 if ( ! xaddrs ) {
242 DBGC ( reply,
"PCCRD %p missing <wsd:XAddrs> tag\n", reply );
244 }
245
246
248 "PeerDist:BlockCount" );
249 if ( ! blockcount ) {
250 DBGC ( reply,
"PCCRD %p missing <PeerDist:BlockCount> tag\n",
251 reply );
253 }
254
255
256
257
258 max = (
strlen ( blockcount ) /
sizeof ( *count ) );
261
262
263 for ( i = 0,
in = scopes,
out = scopes ; *
in ; i++,
in += skip ) {
264
265
267 DBGC ( reply,
"PCCRD %p too many segment IDs\n",
268 reply );
270 }
271
272
275 sizeof ( zcount.
hex ) ) == 0 )
276 continue;
279 }
281
282
285
286 return 0;
287}
uint8_t data[48]
Additional event data.
static unsigned int count
Number of entries.
#define ENOENT
No such file or directory.
#define EPROTO
Protocol error.
static char * peerdist_discovery_reply_values(char *data, size_t len, const char *name)
Locate discovery reply values.
char hex[8]
Count (as an eight-digit hex value)
#define container_of(ptr, type, field)
Get containing structure.
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)
char * ids
List of segment ID strings.
char * locations
List of peer locations.
References container_of, count, data, DBGC, ENOENT, EPROTO, hex, peerdist_discovery_block_count::hex, peerdist_discovery_reply::ids, in, len, peerdist_discovery_reply::locations, max, memcmp(), out, peerdist_discovery_reply_values(), strcpy(), and strlen().