Lines Matching refs:session

286 /* this type is used to model a session connection/state
287 * if session->packet is != NULL, then the connection is delayed
307 session_free( Session session )
309 if (session) {
310 if (session->packet) {
311 queued_packet_free(session->packet);
312 session->packet = NULL;
314 qemu_free( session );
321 session_to_string( Session session )
324 const char* format = (session->protocol == _PROTOCOL_TCP) ? "TCP" : "UDP";
326 (session->src_ip >> 24) & 255, (session->src_ip >> 16) & 255,
327 (session->src_ip >> 8) & 255, (session->src_ip) & 255, session->src_port,
328 (session->dst_ip >> 24) & 255, (session->dst_ip >> 16) & 255,
329 (session->dst_ip >> 8) & 255, (session->dst_ip) & 255, session->dst_port);
426 Session session;
431 for (session = delay->sessions; session != NULL; session = session->next)
433 QueuedPacket packet = session->packet;
438 if (session->expiration <= now) {
440 //fprintf(stderr, "NetDelay:RST: sending creation for %s\n", session_to_string(session) );
442 session->packet = NULL;
447 rearm_time = session->expiration;
449 else if ( session->expiration < rearm_time )
450 rearm_time = session->expiration;
484 Session session = delay->sessions;
485 delay->sessions = session->next;
486 session->next = NULL;
487 if (session->packet) {
488 QueuedPacket packet = session->packet;
491 session_free(session);
518 Session session = *lookup;
519 if (session != NULL) {
522 *lookup = session->next;
523 session_free( session );
531 Session session = *lookup;
533 if (session != NULL) {
534 if (session->packet != NULL) {
542 /* establish a new session slightly in the future */
550 session = qemu_malloc( sizeof(*session) );
552 session->next = delay->sessions;
553 delay->sessions = session;
556 session->expiration = qemu_get_clock_ms( SHAPER_CLOCK ) + latency;
558 session->src_ip = info->src_ip;
559 session->dst_ip = info->dst_ip;
560 session->src_port = info->src_port;
561 session->dst_port = info->dst_port;
562 session->protocol = info->protocol;
564 session->packet = queued_packet_create( data, size, opaque, 1 );
581 Session session = delay->sessions;
582 delay->sessions = session->next;
583 session_free(session);