Lines Matching refs:thispkt
354 MEMPACKET *thispkt; in mempacket_test_read() local
360 if ((thispkt = sk_MEMPACKET_value(ctx->pkts, 0)) == NULL in mempacket_test_read()
361 || thispkt->num != ctx->currpkt) { in mempacket_test_read()
369 if (outl > thispkt->len) in mempacket_test_read()
370 outl = thispkt->len; in mempacket_test_read()
372 if (thispkt->type != INJECT_PACKET_IGNORE_REC_SEQ in mempacket_test_read()
380 for (rem = thispkt->len, rec = thispkt->data; rem > 0; rem -= len) { in mempacket_test_read()
415 memcpy(out, thispkt->data, outl); in mempacket_test_read()
416 mempacket_free(thispkt); in mempacket_test_read()
427 MEMPACKET *thispkt; in mempacket_swap_epoch() local
440 thispkt = sk_MEMPACKET_value(ctx->pkts, numpkts - 1); in mempacket_swap_epoch()
441 if (thispkt == NULL) in mempacket_swap_epoch()
444 for (rem = thispkt->len, rec = thispkt->data; rem > 0; rem -= len, rec += len) { in mempacket_swap_epoch()
472 thispkt->len -= prevlen; in mempacket_swap_epoch()
473 pktnum = thispkt->num; in mempacket_swap_epoch()
479 thispkt = OPENSSL_malloc(sizeof(*thispkt)); in mempacket_swap_epoch()
480 if (thispkt == NULL) { in mempacket_swap_epoch()
484 thispkt->type = INJECT_PACKET; in mempacket_swap_epoch()
485 thispkt->data = tmp; in mempacket_swap_epoch()
486 thispkt->len = prevlen; in mempacket_swap_epoch()
487 thispkt->num = pktnum + 1; in mempacket_swap_epoch()
488 if (sk_MEMPACKET_insert(ctx->pkts, thispkt, numpkts) <= 0) { in mempacket_swap_epoch()
490 OPENSSL_free(thispkt); in mempacket_swap_epoch()
507 MEMPACKET *thispkt; in mempacket_move_packet() local
519 thispkt = sk_MEMPACKET_value(ctx->pkts, s); in mempacket_move_packet()
520 if (thispkt == NULL) in mempacket_move_packet()
524 if (sk_MEMPACKET_delete(ctx->pkts, s) != thispkt) in mempacket_move_packet()
527 thispkt->num -= (s - d); in mempacket_move_packet()
528 if (sk_MEMPACKET_insert(ctx->pkts, thispkt, d) <= 0) in mempacket_move_packet()
533 thispkt = sk_MEMPACKET_value(ctx->pkts, i); in mempacket_move_packet()
534 thispkt->num++; in mempacket_move_packet()
543 MEMPACKET *thispkt = NULL, *looppkt, *nextpkt, *allpkts[3]; in mempacket_test_inject() local
574 if (!TEST_ptr(allpkts[i] = OPENSSL_malloc(sizeof(*thispkt)))) in mempacket_test_inject()
576 thispkt = allpkts[i]; in mempacket_test_inject()
578 if (!TEST_ptr(thispkt->data = OPENSSL_malloc(inl))) in mempacket_test_inject()
588 memcpy(thispkt->data, in + len, inl - len); in mempacket_test_inject()
589 thispkt->len = inl - len; in mempacket_test_inject()
591 memcpy(thispkt->data, in, inl); in mempacket_test_inject()
592 thispkt->len = inl; in mempacket_test_inject()
594 thispkt->num = (pktnum >= 0) ? (unsigned int)pktnum : ctx->lastpkt + i; in mempacket_test_inject()
595 thispkt->type = type; in mempacket_test_inject()
602 if (looppkt->num > thispkt->num) { in mempacket_test_inject()
603 if (sk_MEMPACKET_insert(ctx->pkts, thispkt, i) == 0) in mempacket_test_inject()
622 } else if (looppkt->num == thispkt->num) { in mempacket_test_inject()
628 thispkt->num++; in mempacket_test_inject()
636 thispkt = allpkts[i]; in mempacket_test_inject()
637 if (!sk_MEMPACKET_push(ctx->pkts, thispkt)) in mempacket_test_inject()
661 MEMPACKET *thispkt; in mempacket_test_ctrl() local
677 thispkt = sk_MEMPACKET_value(ctx->pkts, 0); in mempacket_test_ctrl()
678 if (thispkt == NULL) in mempacket_test_ctrl()
681 ret = thispkt->len; in mempacket_test_ctrl()