Lines Matching full:block

51 	uint16_t block;  member
59 tftp_send(int peer, uint16_t *block, struct tftp_stats *ts) in tftp_send() argument
70 *block = 1; in tftp_send()
77 tftp_log(LOG_DEBUG, "Sending block %d (window block %d)", in tftp_send()
78 *block, windowblock); in tftp_send()
81 window[windowblock].block = *block; in tftp_send()
92 n_data = send_data(peer, *block, sendbuffer, size); in tftp_send()
99 "giving up", *block); in tftp_send()
104 *block); in tftp_send()
107 /* Only check for ACK for last block in window. */ in tftp_send()
116 "giving up", acktry, *block); in tftp_send()
121 acktry, *block); in tftp_send()
132 *block = window[0].block; in tftp_send()
145 * Look for the ACKed block in our open in tftp_send()
149 if (rp->th_block == window[i].block) in tftp_send()
172 *block = window[0].block; in tftp_send()
182 "ACKed block %d", in tftp_send()
183 window[j].block); in tftp_send()
190 * un-ACKed block. in tftp_send()
204 *block = window[i + 1].block; in tftp_send()
214 oldblock = *block; in tftp_send()
215 (*block)++; in tftp_send()
216 if (oldblock > *block) { in tftp_send()
220 * tftp client. Default to rolling block in tftp_send()
223 *block = 0; in tftp_send()
225 *block = atoi(options[OPT_ROLLOVER].o_request); in tftp_send()
238 * - It could be that the first block has already arrived while
243 tftp_receive(int peer, uint16_t *block, struct tftp_stats *ts, in tftp_receive() argument
261 n_ack = send_ack(peer, *block); in tftp_receive()
266 "giving up", *block); in tftp_receive()
271 *block); in tftp_receive()
288 oldblock = *block; in tftp_receive()
289 (*block)++; in tftp_receive()
290 if (oldblock > *block) { in tftp_receive()
294 * tftp client. Default to rolling block in tftp_receive()
297 *block = 0; in tftp_receive()
299 *block = atoi(options[OPT_ROLLOVER].o_request); in tftp_receive()
308 "Receiving DATA block %d (window block %d)", in tftp_receive()
309 *block, windowblock); in tftp_receive()
316 "Timeout #%d on DATA block %d, " in tftp_receive()
317 "giving up", retry, *block); in tftp_receive()
322 "Timeout #%d on DATA block %d", in tftp_receive()
323 retry, *block); in tftp_receive()
338 if (rp->th_block == *block) in tftp_receive()
350 if (*block > windowsize) in tftp_receive()
351 windowstart = *block - windowsize; in tftp_receive()
355 rp->th_block < *block) { in tftp_receive()
358 "Ignoring duplicate DATA block %d", in tftp_receive()
366 "Expected DATA block %d, got block %d", in tftp_receive()
367 *block, rp->th_block); in tftp_receive()
373 *block = oldblock; in tftp_receive()
379 "Expected DATA block, got %s block", in tftp_receive()
401 /* Only send ACKs for the last block in the window. */ in tftp_receive()
406 n_ack = send_ack(peer, *block); in tftp_receive()
412 "giving up", *block); in tftp_receive()
418 *block); in tftp_receive()
423 tftp_log(LOG_DEBUG, "Sent ACK for %d", *block); in tftp_receive()
440 rp->th_opcode == DATA && /* and got a data block */ in tftp_receive()
441 *block == rp->th_block) /* then my last ack was lost */ in tftp_receive()
442 send_ack(peer, *block); /* resend final ack */ in tftp_receive()