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 FILE_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 */
40  struct list_head list;
41  /** Data transfer interface */
42  struct interface xfer;
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 */
60  struct interface xfer;
61  /** Content information interface */
62  struct interface info;
63  /** Original URI */
64  struct uri *uri;
65 
66  /** Content information data transfer buffer */
68  /** Content information cache */
70 
71  /** Block download initiation process */
72  struct process process;
73  /** List of busy block downloads */
74  struct list_head busy;
75  /** List of idle block downloads */
76  struct list_head idle;
77  /** Block downloads */
79 
80  /** Statistics */
82 };
83 
84 extern int peermux_filter ( struct interface *xfer, struct interface *info,
85  struct uri *uri );
86 
87 #endif /* _IPXE_PEERMUX_H */
A process.
Definition: process.h:18
u32 info
Definition: ar9003_mac.h:24
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:413
A data transfer buffer.
Definition: xferbuf.h:19
PeerDist statistics.
Definition: peermux.h:46
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Uniform Resource Identifiers.
A PeerDist multiplexed block download.
Definition: peermux.h:36
unsigned int peers
Maximum observed number of peers.
Definition: peermux.h:48
struct peerdist_info_cache cache
Content information cache.
Definition: peermux.h:69
A doubly-linked list entry (or list head)
Definition: list.h:19
struct peerdist_multiplexer * peermux
PeerDist download multiplexer.
Definition: peermux.h:38
A reference counter.
Definition: refcnt.h:27
A content information block.
Definition: pccrc.h:394
A PeerDist download multiplexer.
Definition: peermux.h:56
unsigned int total
Number of blocks downloaded in total.
Definition: peermux.h:50
An object interface.
Definition: interface.h:125
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:40
struct peerdist_multiplexed_block block[PEERMUX_MAX_BLOCKS]
Block downloads.
Definition: peermux.h:78
Processes.
struct peerdist_info_block block
Content information block.
Definition: peermux.h:32
struct interface xfer
Data transfer interface.
Definition: peermux.h:42
PeerDist download content information cache.
Definition: peermux.h:26
struct list_head idle
List of idle block downloads.
Definition: peermux.h:76
struct peerdist_statistics stats
Statistics.
Definition: peermux.h:81
struct interface xfer
Data transfer interface.
Definition: peermux.h:60
struct peerdist_info_segment segment
Content information segment.
Definition: peermux.h:30
unsigned int local
Number of blocks downloaded from peers.
Definition: peermux.h:52
struct list_head busy
List of busy block downloads.
Definition: peermux.h:74
Reference counting.
A Uniform Resource Identifier.
Definition: uri.h:65
struct xfer_buffer buffer
Content information data transfer buffer.
Definition: peermux.h:67
FILE_SECBOOT(PERMITTED)
#define PEERMUX_MAX_BLOCKS
Maximum number of concurrent block downloads.
Definition: peermux.h:23
struct interface info
Content information interface.
Definition: peermux.h:62
struct uri * uri
Original URI.
Definition: peermux.h:64
struct peerdist_info info
Content information.
Definition: peermux.h:28
Data transfer buffer.