X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=qemu%2Froms%2Fipxe%2Fsrc%2Finclude%2Fipxe%2Fpeermux.h;fp=qemu%2Froms%2Fipxe%2Fsrc%2Finclude%2Fipxe%2Fpeermux.h;h=44cbdb9d647632536c8d610eba4e5acac2347318;hb=437fd90c0250dee670290f9b714253671a990160;hp=0000000000000000000000000000000000000000;hpb=5bbd6fe9b8bab2a93e548c5a53b032d1939eec05;p=kvmfornfv.git diff --git a/qemu/roms/ipxe/src/include/ipxe/peermux.h b/qemu/roms/ipxe/src/include/ipxe/peermux.h new file mode 100644 index 000000000..44cbdb9d6 --- /dev/null +++ b/qemu/roms/ipxe/src/include/ipxe/peermux.h @@ -0,0 +1,73 @@ +#ifndef _IPXE_PEERMUX_H +#define _IPXE_PEERMUX_H + +/** @file + * + * Peer Content Caching and Retrieval (PeerDist) protocol multiplexer + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#include +#include +#include +#include +#include +#include +#include +#include + +/** Maximum number of concurrent block downloads */ +#define PEERMUX_MAX_BLOCKS 32 + +/** PeerDist download content information cache */ +struct peerdist_info_cache { + /** Content information */ + struct peerdist_info info; + /** Content information segment */ + struct peerdist_info_segment segment; + /** Content information block */ + struct peerdist_info_block block; +}; + +/** A PeerDist multiplexed block download */ +struct peerdist_multiplexed_block { + /** PeerDist download multiplexer */ + struct peerdist_multiplexer *peermux; + /** List of multiplexed blocks */ + struct list_head list; + /** Data transfer interface */ + struct interface xfer; +}; + +/** A PeerDist download multiplexer */ +struct peerdist_multiplexer { + /** Reference count */ + struct refcnt refcnt; + /** Data transfer interface */ + struct interface xfer; + /** Content information interface */ + struct interface info; + /** Original URI */ + struct uri *uri; + + /** Content information data transfer buffer */ + struct xfer_buffer buffer; + /** Content information cache */ + struct peerdist_info_cache cache; + + /** Block download initiation process */ + struct process process; + /** List of busy block downloads */ + struct list_head busy; + /** List of idle block downloads */ + struct list_head idle; + /** Block downloads */ + struct peerdist_multiplexed_block block[PEERMUX_MAX_BLOCKS]; +}; + +extern int peermux_filter ( struct interface *xfer, struct interface *info, + struct uri *uri ); + +#endif /* _IPXE_PEERMUX_H */