diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-13 11:07:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-13 11:07:19 +0000 |
commit | c94be01c832866f9c0169963c658e36dd3329cc2 (patch) | |
tree | 6032e13b5c7016f460d4e04e568cb397f28716ca /src/include | |
parent | c584d8950bda4b27ccc2fa03de2cee23a8ae56d2 (diff) | |
download | gnunet-c94be01c832866f9c0169963c658e36dd3329cc2.tar.gz gnunet-c94be01c832866f9c0169963c658e36dd3329cc2.zip |
revised fragmentation API for blocking writes
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_fragmentation_lib.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index bb29a5fba..e91e74c6f 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h | |||
@@ -49,8 +49,10 @@ struct GNUNET_FRAGMENT_Context; | |||
49 | 49 | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * Function that is called with messages | 52 | * Function that is called with messages created by the fragmentation |
53 | * created by the fragmentation module. | 53 | * module. In the case of the 'proc' callback of the |
54 | * GNUNET_FRAGMENT_context_create function, this function must | ||
55 | * eventually call 'GNUNET_FRAGMENT_context_transmission_done'. | ||
54 | * | 56 | * |
55 | * @param cls closure | 57 | * @param cls closure |
56 | * @param msg the message that was created | 58 | * @param msg the message that was created |
@@ -88,6 +90,17 @@ GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | |||
88 | 90 | ||
89 | 91 | ||
90 | /** | 92 | /** |
93 | * Continuation to call from the 'proc' function after the fragment | ||
94 | * has been transmitted (and hence the next fragment can now be | ||
95 | * given to proc). | ||
96 | * | ||
97 | * @param fc fragmentation context | ||
98 | */ | ||
99 | void | ||
100 | GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); | ||
101 | |||
102 | |||
103 | /** | ||
91 | * Process an acknowledgement message we got from the other | 104 | * Process an acknowledgement message we got from the other |
92 | * side (to control re-transmits). | 105 | * side (to control re-transmits). |
93 | * | 106 | * |
@@ -121,6 +134,21 @@ struct GNUNET_DEFRAGMENT_Context; | |||
121 | 134 | ||
122 | 135 | ||
123 | /** | 136 | /** |
137 | * Function that is called with acknowledgement messages created by | ||
138 | * the fragmentation module. Acknowledgements are cummulative, | ||
139 | * so it is OK to only transmit the 'latest' ack message for the same | ||
140 | * message ID. | ||
141 | * | ||
142 | * @param cls closure | ||
143 | * @param id unique message ID (modulo collisions) | ||
144 | * @param msg the message that was created | ||
145 | */ | ||
146 | typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, | ||
147 | uint32_t id, | ||
148 | const struct GNUNET_MessageHeader *msg); | ||
149 | |||
150 | |||
151 | /** | ||
124 | * Create a defragmentation context. | 152 | * Create a defragmentation context. |
125 | * | 153 | * |
126 | * @param stats statistics context | 154 | * @param stats statistics context |
@@ -139,7 +167,7 @@ GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, | |||
139 | unsigned int num_msgs, | 167 | unsigned int num_msgs, |
140 | void *cls, | 168 | void *cls, |
141 | GNUNET_FRAGMENT_MessageProcessor proc, | 169 | GNUNET_FRAGMENT_MessageProcessor proc, |
142 | GNUNET_FRAGMENT_MessageProcessor ackp); | 170 | GNUNET_DEFRAGMENT_AckProcessor ackp); |
143 | 171 | ||
144 | 172 | ||
145 | /** | 173 | /** |