iPXE
peermux.h
Go to the documentation of this file.
1#ifndef _IPXE_PEERMUX_H
2#define _IPXE_PEERMUX_H
3
4/** @file
5 *
6 * Peer Content Caching and Retrieval (PeerDist) protocol multiplexer
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/list.h>
15#include <ipxe/refcnt.h>
16#include <ipxe/interface.h>
17#include <ipxe/process.h>
18#include <ipxe/uri.h>
19#include <ipxe/xferbuf.h>
20#include <ipxe/pccrc.h>
21
22/** Maximum number of concurrent block downloads */
23#define PEERMUX_MAX_BLOCKS 32
24
25/** PeerDist download content information cache */
27 /** Content information */
29 /** Content information segment */
31 /** Content information block */
33};
34
35/** A PeerDist multiplexed block download */
37 /** PeerDist download multiplexer */
39 /** List of multiplexed blocks */
41 /** Data transfer interface */
43};
44
45/** PeerDist statistics */
47 /** Maximum observed number of peers */
48 unsigned int peers;
49 /** Number of blocks downloaded in total */
50 unsigned int total;
51 /** Number of blocks downloaded from peers */
52 unsigned int local;
53};
54
55/** A PeerDist download multiplexer */
57 /** Reference count */
58 struct refcnt refcnt;
59 /** Data transfer interface */
61 /** Content information interface */
63 /** Original URI */
64 struct uri *uri;
65
66 /** Content information data transfer buffer */
68 /** Content information cache */
70
71 /** Block download initiation process */
73 /** List of busy block downloads */
75 /** List of idle block downloads */
77 /** Block downloads */
79
80 /** Statistics */
82};
83
84extern int peermux_filter ( struct interface *xfer, struct interface *info,
85 struct uri *uri );
86
87#endif /* _IPXE_PEERMUX_H */
u32 info
Definition ar9003_mac.h:0
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
Object interfaces.
Linked lists.
Peer Content Caching and Retrieval: Content Identification [MS-PCCRC].
int peermux_filter(struct interface *xfer, struct interface *info, struct uri *uri)
Add PeerDist content-encoding filter.
Definition peermux.c:413
#define PEERMUX_MAX_BLOCKS
Maximum number of concurrent block downloads.
Definition peermux.h:23
Processes.
Reference counting.
An object interface.
Definition interface.h:125
A doubly-linked list entry (or list head)
Definition list.h:19
A content information block.
Definition pccrc.h:394
PeerDist download content information cache.
Definition peermux.h:26
struct peerdist_info info
Content information.
Definition peermux.h:28
struct peerdist_info_block block
Content information block.
Definition peermux.h:32
struct peerdist_info_segment segment
Content information segment.
Definition peermux.h:30
A content information segment.
Definition pccrc.h:347
Content information.
Definition pccrc.h:317
A PeerDist multiplexed block download.
Definition peermux.h:36
struct peerdist_multiplexer * peermux
PeerDist download multiplexer.
Definition peermux.h:38
struct interface xfer
Data transfer interface.
Definition peermux.h:42
struct list_head list
List of multiplexed blocks.
Definition peermux.h:40
A PeerDist download multiplexer.
Definition peermux.h:56
struct peerdist_statistics stats
Statistics.
Definition peermux.h:81
struct xfer_buffer buffer
Content information data transfer buffer.
Definition peermux.h:67
struct list_head idle
List of idle block downloads.
Definition peermux.h:76
struct peerdist_multiplexed_block block[PEERMUX_MAX_BLOCKS]
Block downloads.
Definition peermux.h:78
struct interface info
Content information interface.
Definition peermux.h:62
struct peerdist_info_cache cache
Content information cache.
Definition peermux.h:69
struct list_head busy
List of busy block downloads.
Definition peermux.h:74
struct refcnt refcnt
Reference count.
Definition peermux.h:58
struct uri * uri
Original URI.
Definition peermux.h:64
struct process process
Block download initiation process.
Definition peermux.h:72
struct interface xfer
Data transfer interface.
Definition peermux.h:60
PeerDist statistics.
Definition peermux.h:46
unsigned int total
Number of blocks downloaded in total.
Definition peermux.h:50
unsigned int peers
Maximum observed number of peers.
Definition peermux.h:48
unsigned int local
Number of blocks downloaded from peers.
Definition peermux.h:52
A Uniform Resource Identifier.
Definition uri.h:65
A data transfer buffer.
Definition xferbuf.h:19
Uniform Resource Identifiers.
Data transfer buffer.