summaryrefslogtreecommitdiff
path: root/netio.h
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2008-11-13 16:17:55 +0000
committerDimitri Sokolyuk <demon@dim13.org>2008-11-13 16:17:55 +0000
commit51b913eb2ff91adfe8cd5e417759a6057c5a8a21 (patch)
tree95c550a91c9111de2f65b3c86ee0c81fef8f5398 /netio.h
XBitTorrent
Diffstat (limited to 'netio.h')
-rw-r--r--netio.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/netio.h b/netio.h
new file mode 100644
index 0000000..1728d4f
--- /dev/null
+++ b/netio.h
@@ -0,0 +1,28 @@
+struct btchunk { /* rbuf: request buffer */
+ LIST_ENTRY(btchunk) link;
+ int ref; /* how many peers points here */
+ int piece; /* requested piece numer */
+ u_char *sha1;
+ size_t len;
+ char *data;
+
+ int nblk; /* bitfield of blocks ? */
+ int blkdone; /* increment by read or write
+ since that both operations
+ cannot be simultan it isn't
+ a problem */
+};
+
+// LIST_HEAD(btplist, btpiece);
+
+struct btrequest {
+ LIST_ENTRY(btrequest) link;
+ struct btpeer *peer;
+ struct btchunk *chunk;
+ size_t offset;
+ size_t length;
+ size_t transmitted; /* howmany is already read/written */
+
+};
+
+// LIST_HEAD(btrlist, btrequest);