Home | History | Annotate | Download | only in qemu

Lines Matching refs:packet

46  * we're going to implement a scheme where, when we send a packet of
47 * 'count' bytes, no other packet will go through in the same direction for
48 * at least 'count*8/MAX_RATE' seconds. any successive packet that is "sent"
69 QueuedPacket packet;
70 size_t packet_size = sizeof(*packet);
75 packet = qemu_malloc(packet_size);
76 packet->next = NULL;
77 packet->expiration = 0;
78 packet->size = (size_t)size;
79 packet->opaque = opaque;
82 packet->data = (void*)(packet+1);
83 memcpy( (char*)packet->data, (char*)data, packet->size );
85 packet->data = (void*)data;
87 return packet;
91 queued_packet_free( QueuedPacket packet )
93 if (packet) {
94 qemu_free( packet );
120 QueuedPacket packet = shaper->packets;
121 shaper->packets = packet->next;
122 packet->next = NULL;
123 queued_packet_free(packet);
137 QueuedPacket packet;
139 while ((packet = shaper->packets) != NULL) {
142 if (packet->expiration > now)
145 shaper->packets = packet->next;
146 shaper->send_func( packet->data, packet->size, packet->opaque );
147 queued_packet_free(packet);
188 QueuedPacket packet = shaper->packets;
189 shaper->packets = packet->next;
190 shaper->send_func(packet->data, packet->size, packet->opaque);
191 qemu_free(packet);
227 /* create new packet, add it to the queue */
229 QueuedPacket packet;
231 packet = queued_packet_create( data, size, opaque, shaper->do_copy );
233 packet->expiration = shaper->block_until;
241 if (node == NULL || node->expiration > packet->expiration )
245 packet->next = *pnode;
246 *pnode = packet;
248 if (packet == shaper->packets)
249 qemu_mod_timer( shaper->timer, packet->expiration );
287 * if session->packet is != NULL, then the connection is delayed
297 QueuedPacket packet;
310 if (session->packet) {
311 queued_packet_free(session->packet);
312 session->packet = NULL;
335 /* returns TRUE if this corresponds to a SYN packet */
342 /* enough room for a Ethernet MAC packet ? */
346 /* is it an IP packet ? */
364 /* must be TCP or UDP packet */
433 QueuedPacket packet = session->packet;
435 if (packet == NULL)
439 /* send the SYN packet now */
441 delay->send_func( packet->data, packet->size, packet->opaque );
442 session->packet = NULL;
443 queued_packet_free( packet );
487 if (session->packet) {
488 QueuedPacket packet = session->packet;
489 delay->send_func( packet->data, packet->size, packet->opaque );
534 if (session->packet != NULL) {
536 * send the original SYN packet yet, just eat this one
564 session->packet = queued_packet_create( data, size, opaque, 1 );