iPXE
pccrd.h
Go to the documentation of this file.
00001 #ifndef _IPXE_PCCRD_H
00002 #define _IPXE_PCCRD_H
00003 
00004 /** @file
00005  *
00006  * Peer Content Caching and Retrieval: Discovery Protocol [MS-PCCRD]
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 /** PeerDist discovery port */
00013 #define PEERDIST_DISCOVERY_PORT 3702
00014 
00015 /** PeerDist discovery IPv4 address (239.255.255.250) */
00016 #define PEERDIST_DISCOVERY_IPV4 \
00017         ( ( 239 << 24 ) | ( 255 << 16 ) | ( 255 << 8 ) | ( 250 << 0 ) )
00018 
00019 /** PeerDist discovery IPv6 address (ff02::c) */
00020 #define PEERDIST_DISCOVERY_IPV6 \
00021         { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc }
00022 
00023 /** A PeerDist discovery reply block count */
00024 struct peerdist_discovery_block_count {
00025         /** Count (as an eight-digit hex value) */
00026         char hex[8];
00027 } __attribute__ (( packed ));
00028 
00029 /** A PeerDist discovery reply */
00030 struct peerdist_discovery_reply {
00031         /** List of segment ID strings
00032          *
00033          * The list is terminated with a zero-length string.
00034          */
00035         char *ids;
00036         /** List of peer locations
00037          *
00038          * The list is terminated with a zero-length string.
00039          */
00040         char *locations;
00041 };
00042 
00043 extern char * peerdist_discovery_request ( const char *uuid, const char *id );
00044 extern int peerdist_discovery_reply ( char *data, size_t len,
00045                                       struct peerdist_discovery_reply *reply );
00046 
00047 #endif /* _IPXE_PCCRD_H */