Lines Matching defs:packet
139 /* Calculate new t_ipi (inter packet interval) by
209 * args: s - packet size (in bytes)
227 * Function called by the send timer (to send packet)
528 TFRC_DEBUG((LOG_INFO, "TFRC - Sender is using packet size %u\n", ccb->s));
530 ccb->x.num = ccb->s; /* set transmissionrate to 1 packet per second */
542 /* init packet history */
578 /* Empty packet history */
594 * Ask TFRC whether one can send a packet or not
615 TFRC_DEBUG((LOG_INFO, "TFRC - Asked to send packet when terminating!\n"));
625 /* check to see if we have memory to add to packet history */
628 TFRC_DEBUG((LOG_INFO, "TFRC - Not enough memory to add packet to packet history (send refused)! (tfrc_send_packet)\n"));
638 TFRC_DEBUG((LOG_INFO, "TFRC - DCCP ask permission to send first data packet (tfrc_send_packet)\n"));
639 microtime(&(cb->t_nom)); /* set nominal send time for initial packet */
668 /* Packet can be sent */
713 /* Notify sender that a packet has been sent
716 * dataSize - packet size
722 struct s_hist_entry *packet;
730 TFRC_DEBUG((LOG_INFO, "TFRC - Packet sent when terminating!\n"));
736 /* check if we have sent a data packet */
739 packet = TAILQ_FIRST(&(cb->hist));
740 if (packet == NULL)
741 panic("TFRC - Packet does not exist in history! (tfrc_send_packet_sent)");
742 else if (packet != NULL && packet->t_sent.tv_sec >= 0)
743 panic("TFRC - No unsent packet in history! (tfrc_send_packet_sent)");
744 packet->t_sent = t_now;
745 packet->seq = cb->pcb->seq_snd;
747 if (packet->win_count != cb->last_win_count) {
749 cb->last_win_count = packet->win_count;
751 TFRC_DEBUG((LOG_INFO, "TFRC - Packet sent (%llu, %u, (%lu.%lu)",
752 packet->seq, packet->win_count, packet->t_sent.tv_sec, packet->t_sent.tv_usec));
767 panic("TFRC - First packet sent is noted as a data packet in tfrc_send_packet_sent\n");
772 * packet which never can have
806 /* Check if next packet can not be sent immediately */
820 /* Notify that a an ack package was received (i.e. a feedback packet)
845 TFRC_DEBUG((LOG_INFO, "TFRC - Sender received a packet when terminating!\n"));
908 "TFRC - Packet does not exist in history (seq=%llu)! (tfrc_send_packet_recv)", cb->pcb->ack_rcv));
1039 /* Find a data packet in history
1043 * returns: elm points to found packet, otherwise NULL
1058 /* Find next data packet in history
1061 * returns: elm points to found packet, otherwise NULL
1162 * Send a feedback packet
1206 /* Find largest win_count so far (data packet with highest seqnum so far) */
1211 panic("No data packet in history! (tfrc_recv_send_feedback)");
1238 TFRC_DEBUG_TIME((LOG_INFO, "TFRC - Sending a feedback packet with (t_elapsed %u, pinv %x, x_recv %u, ack=%llu) (tfrc_recv_send_feedback)\n", ntohs(t_elapsed), ntohl(pinv), ntohl(x_recv), elm->seq));
1263 panic("Packet history contains no data packets! (tfrc_recv_calcFirstLI)\n");
1334 /* Add packet to recv history (sorted on seqnum)
1337 * packet - packet to insert
1338 * returns: 1 if the packet was considered lost, 0 otherwise
1342 tfrc_recv_add_hist(struct tfrc_recv_ccb * cb, struct r_hist_entry * packet)
1346 u_int32_t seq_num = packet->seq;
1349 TFRC_DEBUG((LOG_INFO, "TFRC - Adding packet (seq=%llu,win_count=%u,type=%u,ndp=%u) to history! (tfrc_recv_add_hist)\n", packet->seq, packet->win_count, packet->type, packet->ndp));
1352 TAILQ_INSERT_HEAD(&(cb->hist), packet, linfo);
1359 TAILQ_INSERT_HEAD(&(cb->hist), packet, linfo);
1370 TAILQ_INSERT_AFTER(&(cb->hist), elm, packet, linfo);
1380 free(packet, M_TEMP);
1381 TFRC_DEBUG((LOG_INFO, "TFRC - Packet already lost! (tfrc_recv_add_hist)\n"));
1388 TAILQ_INSERT_TAIL(&(cb->hist), packet, linfo);
1424 /* we have found a packet older than
1468 /* todo: find a lost data packet by comparing
1475 /* locate a lost data packet */
1504 * seq_loss - sequence number of lost packet (-1 for none)
1505 * win_loss - window counter for previous (from the lost packet view) packet
1518 if (seq_loss != -1) { /* we have found a packet loss! */
1594 TFRC_DEBUG((LOG_INFO, "TFRC - Highest data packet received %llu (tfrc_recv_updateLI)\n", elm->seq));
1626 TFRC_DEBUG((LOG_INFO, "TFRC - Receiver is using packet size %u\n", ccb->s));
1628 /* init packet history */
1659 /* Empty packet history */
1687 * Tell TFRC that a packet has been received
1693 struct r_hist_entry *packet;
1717 TFRC_DEBUG((LOG_INFO, "TFRC - Received not data/dataack/ack packet! (tfrc_recv_packet_recv)"));
1723 /* Add packet to history */
1725 packet = malloc(sizeof(struct r_hist_entry), M_TEMP, M_NOWAIT); /* M_TEMP?? */
1726 if (packet == NULL) {
1727 TFRC_DEBUG((LOG_INFO, "TFRC - Not enough memory to add received packet to history (consider it lost)! (tfrc_recv_packet_recv)"));
1731 microtime(&(packet->t_recv));
1732 packet->seq = cb->pcb->seq_rcv;
1733 packet->type = cb->pcb->type_rcv;
1734 packet->ndp = cb->pcb->ndp_rcv;
1738 packet->win_count = win_count;
1740 ins = tfrc_recv_add_hist(cb, packet);
1742 /* check if we got a data packet */
1747 TFRC_DEBUG((LOG_INFO, "TFRC - Send an initial feedback packet (tfrc_recv_packet_recv)\n"));
1767 TFRC_DEBUG((LOG_INFO, "TFRC - Send a feedback packet because p>p_prev (tfrc_recv_packet_recv)\n"));
1782 TFRC_DEBUG((LOG_INFO, "TFRC - Send a feedback packet (%i)(win_count larger) (tfrc_recv_packet_recv)\n", (win_count - cb->last_counter + TFRC_WIN_COUNT_LIMIT) % TFRC_WIN_COUNT_LIMIT));