diff options
| author | Michael Brown | 2015-07-28 16:56:23 +0200 |
|---|---|---|
| committer | Michael Brown | 2015-07-28 17:09:14 +0200 |
| commit | 51b99d8bc8148d759b86d670c4393cf9299ff8ff (patch) | |
| tree | a19a9ceebcd9e1b69dddc3f6c171dbf85288410e /src/include | |
| parent | [peerdist] Include trimmed range within content information block (diff) | |
| download | ipxe-51b99d8bc8148d759b86d670c4393cf9299ff8ff.tar.gz ipxe-51b99d8bc8148d759b86d670c4393cf9299ff8ff.tar.xz ipxe-51b99d8bc8148d759b86d670c4393cf9299ff8ff.zip | |
[peerdist] Add support for constructing and decoding discovery messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ipxe/errfile.h | 1 | ||||
| -rw-r--r-- | src/include/ipxe/pccrd.h | 47 |
2 files changed, 48 insertions, 0 deletions
diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h index de50fab98..9976387d6 100644 --- a/src/include/ipxe/errfile.h +++ b/src/include/ipxe/errfile.h @@ -246,6 +246,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #define ERRFILE_rndis ( ERRFILE_NET | 0x003d0000 ) #define ERRFILE_pccrc ( ERRFILE_NET | 0x003e0000 ) #define ERRFILE_stp ( ERRFILE_NET | 0x003f0000 ) +#define ERRFILE_pccrd ( ERRFILE_NET | 0x00400000 ) #define ERRFILE_image ( ERRFILE_IMAGE | 0x00000000 ) #define ERRFILE_elf ( ERRFILE_IMAGE | 0x00010000 ) diff --git a/src/include/ipxe/pccrd.h b/src/include/ipxe/pccrd.h new file mode 100644 index 000000000..3daa92f29 --- /dev/null +++ b/src/include/ipxe/pccrd.h @@ -0,0 +1,47 @@ +#ifndef _IPXE_PCCRD_H +#define _IPXE_PCCRD_H + +/** @file + * + * Peer Content Caching and Retrieval: Discovery Protocol [MS-PCCRD] + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +/** PeerDist discovery port */ +#define PEERDIST_DISCOVERY_PORT 3702 + +/** PeerDist discovery IPv4 address (239.255.255.250) */ +#define PEERDIST_DISCOVERY_IPV4 \ + ( ( 239 << 24 ) | ( 255 << 16 ) | ( 255 << 8 ) | ( 250 << 0 ) ) + +/** PeerDist discovery IPv6 address (ff02::c) */ +#define PEERDIST_DISCOVERY_IPV6 \ + { 0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xc } + +/** A PeerDist discovery reply block count */ +struct peerdist_discovery_block_count { + /** Count (as an eight-digit hex value) */ + char hex[8]; +} __attribute__ (( packed )); + +/** A PeerDist discovery reply */ +struct peerdist_discovery_reply { + /** List of segment ID strings + * + * The list is terminated with a zero-length string. + */ + char *ids; + /** List of peer locations + * + * The list is terminated with a zero-length string. + */ + char *locations; +}; + +extern char * peerdist_discovery_request ( const char *uuid, const char *id ); +extern int peerdist_discovery_reply ( char *data, size_t len, + struct peerdist_discovery_reply *reply ); + +#endif /* _IPXE_PCCRD_H */ |
