Update the timer status and the next expire time according to the timers to expire in a specific future time slot. @param[in, out] Tcb Pointer to the TCP_CB of this TCP instance. **/
| 335 | |
| 336 | **/ |
| 337 | VOID |
| 338 | TcpUpdateTimer ( |
| 339 | IN OUT TCP_CB *Tcb |
| 340 | ) |
| 341 | { |
| 342 | UINT16 Index; |
| 343 | |
| 344 | // |
| 345 | // Don't use a too large value to init NextExpire |
| 346 | // since mTcpTick wraps around as sequence no does. |
| 347 | // |
| 348 | Tcb->NextExpire = TCP_EXPIRE_TIME; |
| 349 | TCP_CLEAR_FLG (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON); |
| 350 | |
| 351 | for (Index = 0; Index < TCP_TIMER_NUMBER; Index++) { |
| 352 | |
| 353 | if (TCP_TIMER_ON (Tcb->EnabledTimer, Index) && |
| 354 | TCP_TIME_LT (Tcb->Timer[Index], mTcpTick + Tcb->NextExpire) |
| 355 | ) { |
| 356 | |
| 357 | Tcb->NextExpire = TCP_SUB_TIME (Tcb->Timer[Index], mTcpTick); |
| 358 | TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_TIMER_ON); |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | Enable a TCP timer. |
no outgoing calls
no test coverage detected