summaryrefslogtreecommitdiff
path: root/netio.h
diff options
context:
space:
mode:
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);