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