/** @file
TCP timer related functions.
Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Tcp4Main.h"
/**
Connect timeout handler.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
);
/**
Timeout handler for TCP retransmission timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
);
/**
Timeout handler for window probe timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
);
/**
Timeout handler for keepalive timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
);
/**
Timeout handler for FIN_WAIT_2 timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
);
/**
Timeout handler for 2MSL timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
);
};
/**
Close the TCP connection.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
TcpClose (
)
{
}
/**
Connect timeout handler.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
"because conenction timer timeout for TCB %p\n", Tcb));
}
"connection timer timeout for TCB %p\n", Tcb));
}
}
}
/**
Timeout handler for TCP retransmission timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
"timeout for TCB %p\n", Tcb));
//
// Set the congestion window. FlightSize is the
// amount of data that has been sent but not
// yet ACKed.
//
"because too many timeouts for TCB %p\n", Tcb));
}
return ;
}
TcpBackoffRto (Tcb);
}
/**
Timeout handler for window probe timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
//
// This is the timer for sender's SWSA. RFC1122 requires
// a timer set for sender's SWSA, and suggest combine it
// with window probe timer. If data is sent, don't set
// the probe timer, since retransmit timer is on.
//
return ;
}
}
/**
Timeout handler for keepalive timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
Tcb->KeepAliveProbes++;
//
// Too many Keep-alive probes, drop the connection
//
}
return ;
}
}
/**
Timeout handler for FIN_WAIT_2 timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
"because FIN_WAIT2 timer timeouts for TCB %p\n", Tcb));
}
/**
Timeout handler for 2MSL timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
"because TIME_WAIT timer timeouts for TCB %p\n", Tcb));
}
/**
Update the timer status and the next expire time according to the timers
to expire in a specific future time slot.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
//
// Don't use a too large value to init NextExpire
// since mTcpTick wraps around as sequence no does.
//
}
}
}
/**
Enable a TCP timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
@param Timer The index of the timer to be enabled.
@param TimeOut The timeout value of this timer.
**/
)
{
}
/**
Clear one TCP timer.
@param Tcb Pointer to the TCP_CB of this TCP instance.
@param Timer The index of the timer to be cleared.
**/
)
{
}
/**
Clear all TCP timers.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
Tcb->EnabledTimer = 0;
}
/**
Enable the window prober timer and set the timeout value.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
if (!Tcb->ProbeTimerOn) {
} else {
}
}
}
/**
Enable the keepalive timer and set the timeout value.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
return ;
}
//
// Set the timer to KeepAliveIdle if either
// 1. the keepalive timer is off
// 2. The keepalive timer is on, but the idle
// is less than KeepAliveIdle, that means the
// connection is alive since our last probe.
//
Tcb->KeepAliveProbes = 0;
} else {
}
}
/**
Backoff the RTO.
@param Tcb Pointer to the TCP_CB of this TCP instance.
**/
)
{
//
// Fold the RTT estimate if too many times, the estimate
// may be wrong, fold it. So the next time a valid
// measurement is sampled, we can start fresh.
//
}
}
}
/**
Heart beat timer handler.
@param Context Context of the timer event, ignored.
**/
)
{
mTcpTick++;
mTcpGlobalIss += 100;
//
// Don't use LIST_FOR_EACH, which isn't delete safe.
//
continue;
}
//
// The connection is doing RTT measurement.
//
Tcb->RttMeasure++;
}
if (Tcb->DelayedAck != 0) {
TcpSendAck (Tcb);
}
//
// No timer is active or no timer expired
//
((--Tcb->NextExpire) > 0)) {
continue;
}
//
// Call the timeout handler for each expired timer.
//
//
// disable the timer before calling the handler
// in case the handler enables it again.
//
//
// The Tcb may have been deleted by the timer, or
// no other timer is set.
//
(Tcb->EnabledTimer == 0)) {
break;
}
}
}
//
// If the Tcb still exist or some timer is set, update the timer
//
if (Index == TCP_TIMER_NUMBER) {
}
}
}
/**
Heart beat timer handler, queues the DPC at TPL_CALLBACK.
@param Event Timer event signaled, ignored.
@param Context Context of the timer event, ignored.
**/
)
{
}