Lines Matching defs:tftpfile

399 	struct tftp_handle *tftpfile;
415 tftpfile = (struct tftp_handle *) malloc(sizeof(*tftpfile));
416 if (!tftpfile)
419 memset(tftpfile, 0, sizeof(*tftpfile));
420 tftpfile->tftp_blksize = TFTP_REQUESTED_BLKSIZE;
421 tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
426 tftpfile->off = 0;
427 tftpfile->path = strdup(path);
428 if (tftpfile->path == NULL) {
429 free(tftpfile);
433 res = tftp_makereq(tftpfile);
436 free(tftpfile->path);
437 free(tftpfile);
440 f->f_fsdata = (void *) tftpfile;
449 struct tftp_handle *tftpfile;
450 tftpfile = (struct tftp_handle *) f->f_fsdata;
457 needblock = tftpfile->off / tftpfile->tftp_blksize + 1;
459 if (tftpfile->currblock > needblock) { /* seek backwards */
460 tftp_senderr(tftpfile, 0, "No error: read aborted");
461 tftp_makereq(tftpfile); /* no error check, it worked
465 while (tftpfile->currblock < needblock) {
468 res = tftp_getnextblock(tftpfile);
475 if (tftpfile->islastblock)
479 if (tftpfile->currblock == needblock) {
482 offinblock = tftpfile->off % tftpfile->tftp_blksize;
484 inbuffer = tftpfile->validsize - offinblock;
488 tftpfile->off);
493 bcopy(tftpfile->lastdata.t.th_data + offinblock,
497 tftpfile->off += count;
500 if ((tftpfile->islastblock) && (count == inbuffer))
519 struct tftp_handle *tftpfile;
520 tftpfile = (struct tftp_handle *) f->f_fsdata;
524 if (tftpfile) {
525 free(tftpfile->path);
526 free(tftpfile);
542 struct tftp_handle *tftpfile;
543 tftpfile = (struct tftp_handle *) f->f_fsdata;
556 struct tftp_handle *tftpfile;
557 tftpfile = (struct tftp_handle *) f->f_fsdata;
561 tftpfile->off = offset;
564 tftpfile->off += offset;
570 return (tftpfile->off);