#include <pushback.h>
Inheritance diagram for PushbackTimer:


Public Types | |
| enum | TimerStatus { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING } |
Public Member Functions | |
| PushbackTimer (PushbackAgent *agent) | |
| void | insert (PushbackEvent *event) |
| void | cancelStatus (RateLimitSession *rls) |
| void | removeEvents (RateLimitSession *rls) |
| int | containsRefresh (int qid) |
| void | sched (double delay) |
| void | resched (double delay) |
| void | cancel () |
| void | force_cancel () |
| int | status () |
Public Attributes | |
| PushbackEvent * | firstEvent_ |
Protected Member Functions | |
| virtual void | expire (Event *e) |
| void | schedule () |
| void | sanityCheck () |
| virtual void | handle (Event *) |
Protected Attributes | |
| PushbackAgent * | agent_ |
| int | status_ |
| Event | event_ |
|
|
Definition at line 66 of file timer-handler.h.
00066 { TIMER_IDLE, TIMER_PENDING, TIMER_HANDLING };
|
|
|
Definition at line 180 of file pushback.h. References agent, agent_, and firstEvent_.
00180 : firstEvent_(NULL) { agent_ = agent;} |
|
Here is the call graph for this function:

|
|
Definition at line 1087 of file pushback.cc. References agent_, TimerHandler::cancel(), PushbackEvent::eventID_, firstEvent_, PushbackEvent::next_, PushbackAgent::printMsg(), PushbackAgent::prnMsg, PUSHBACK_STATUS_EVENT, PushbackEvent::rls_, and schedule(). Referenced by PushbackAgent::processPushbackStatus().
01087 {
01088
01089 if (firstEvent_==NULL) {
01090 sprintf(agent_->prnMsg, " Error timer list empty\n");
01091 agent_->printMsg(agent_->prnMsg, 0);
01092 //return;
01093 exit(-1);
01094 }
01095
01096 if (firstEvent_->eventID_==PUSHBACK_STATUS_EVENT && firstEvent_->rls_==rls) {
01097 cancel();
01098 PushbackEvent * event = firstEvent_;
01099 firstEvent_=firstEvent_->next_;
01100 delete(event);
01101 schedule();
01102 return;
01103 }
01104
01105 PushbackEvent * previous = firstEvent_;
01106 PushbackEvent * current = firstEvent_->next_;
01107
01108 while (current!=NULL) {
01109 if (current->eventID_ == PUSHBACK_STATUS_EVENT && current->rls_==rls) {
01110 previous->next_=current->next_;
01111 delete(current);
01112 return;
01113 }
01114 previous=current;
01115 current=current->next_;
01116 }
01117
01118 sprintf(agent_->prnMsg, "Error status timer not found\n");
01119 agent_->printMsg(agent_->prnMsg, 0);
01120 exit(-1);
01121 }
|
Here is the call graph for this function:

|
|
Definition at line 1124 of file pushback.cc. References PushbackEvent::eventID_, firstEvent_, PushbackEvent::next_, PUSHBACK_REFRESH_EVENT, and PushbackEvent::qid_. Referenced by PushbackAgent::identifyAggregate().
01124 {
01125 PushbackEvent * listItem = firstEvent_;
01126 while (listItem!=NULL) {
01127 if (listItem->eventID_ == PUSHBACK_REFRESH_EVENT && listItem->qid_==qid)
01128 return 1;
01129 listItem = listItem->next_;
01130 }
01131 return 0;
01132 }
|
|
|
Implements TimerHandler. Definition at line 999 of file pushback.cc. References agent_, firstEvent_, PushbackEvent::next_, schedule(), and PushbackAgent::timeout().
00999 {
01000
01001 if (firstEvent_ == NULL) {
01002 printf("PushbackTimer: No event found on expiry\n");
01003 exit(-1);
01004 }
01005
01006 PushbackEvent * event = firstEvent_;
01007 firstEvent_= firstEvent_->next_;
01008 schedule();
01009
01010 agent_->timeout(event);
01011 delete(event);
01012 }
|
Here is the call graph for this function:

|
|
Definition at line 60 of file timer-handler.h. References TimerHandler::_cancel(), TimerHandler::status_, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING. Referenced by TcpAgent::cancel_rtx_timer(), TcpSessionAgent::cancel_rtx_timer(), TcpFsAgent::cancel_rtx_timer(), AbsTcpAgent::cancel_timer(), TcpAgent::cancel_timers(), TcpSessionAgent::cancel_timers(), FullTcpAgent::cancel_timers(), TcpFsAgent::cancel_timers(), SinkAgent::command(), UnslottedAlohaMac::end_of_contention(), GAFAgent::processDiscoveryMsg(), RTPAgent::rate_change(), TfrcAgent::stop(), RTPAgent::stop(), and SinkAgent::stop().
00060 { // cancel!
00061 if (status_ == TIMER_PENDING) {
00062 _cancel();
00063 status_ = TIMER_IDLE;
00064 }
00065 }
|
Here is the call graph for this function:

|
|
Implements Handler. Reimplemented in EmpFtpTrafSession, EmpWebPage, EmpWebTrafSession, HBTimer, WebPage, and WebTrafSession. Definition at line 69 of file timer-handler.cc. References abort(), TimerHandler::expire(), TimerHandler::status_, TimerHandler::TIMER_HANDLING, TimerHandler::TIMER_IDLE, and TimerHandler::TIMER_PENDING. Referenced by WebTrafSession::handle(), WebPage::handle(), HBTimer::handle(), EmpWebTrafSession::handle(), EmpWebPage::handle(), and EmpFtpTrafSession::handle().
00070 {
00071 if (status_ != TIMER_PENDING) // sanity check
00072 abort();
00073 status_ = TIMER_HANDLING;
00074 expire(e);
00075 // if it wasn't rescheduled, it's done
00076 if (status_ == TIMER_HANDLING)
00077 status_ = TIMER_IDLE;
00078 }
|
Here is the call graph for this function:

|
|
Definition at line 1016 of file pushback.cc. References agent_, firstEvent_, PushbackEvent::next_, PushbackAgent::printMsg(), PushbackAgent::prnMsg, sanityCheck(), schedule(), PushbackEvent::setSucc(), PushbackEvent::time_, and PushbackEvent::type(). Referenced by PushbackAgent::identifyAggregate(), PushbackAgent::initialUpdate(), PushbackAgent::processPushbackRefresh(), PushbackAgent::processPushbackRequest(), PushbackAgent::pushbackCheck(), and PushbackAgent::pushbackRefresh().
01016 {
01017
01018 sprintf(agent_->prnMsg,"%s timer set\n", PushbackEvent::type(event));
01019 agent_->printMsg(agent_->prnMsg,4);
01020 if (firstEvent_ == NULL) {
01021 firstEvent_ = event;
01022 schedule();
01023 return;
01024 }
01025
01026 if (event->time_ < firstEvent_->time_) {
01027 event->setSucc(firstEvent_);
01028 firstEvent_=event;
01029 schedule();
01030 return;
01031 }
01032
01033 PushbackEvent * listItem = firstEvent_;
01034 while (listItem->next_!=NULL && listItem->next_->time_ <= event->time_) {
01035 listItem = listItem->next_;
01036 }
01037
01038 event->setSucc(listItem->next_);
01039 listItem->setSucc(event);
01040
01041 //comment the sanity check out later
01042 sanityCheck();
01043
01044 return;
01045 }
|
Here is the call graph for this function:

|
|
Definition at line 1048 of file pushback.cc. References TimerHandler::cancel(), firstEvent_, PushbackEvent::next_, PushbackEvent::rls_, and schedule(). Referenced by PushbackAgent::pushbackCancel().
01048 {
01049 if (firstEvent_==NULL) return;
01050 while (firstEvent_!= NULL && firstEvent_->rls_==rls) {
01051 cancel();
01052 PushbackEvent * event = firstEvent_;
01053 firstEvent_=firstEvent_->next_;
01054 delete(event);
01055 schedule();
01056 }
01057 if (firstEvent_==NULL) return;
01058
01059 PushbackEvent * previous = firstEvent_;
01060 PushbackEvent * current = firstEvent_->next_;
01061 while (current!=NULL) {
01062 if (current->rls_==rls) {
01063 previous->next_=current->next_;
01064 delete(current);
01065 current = previous->next_;
01066 continue;
01067 }
01068 previous=current;
01069 current=current->next_;
01070 }
01071
01072 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 1135 of file pushback.cc. References agent_, firstEvent_, PushbackEvent::next_, PushbackAgent::printMsg(), PushbackAgent::prnMsg, and PushbackEvent::time_. Referenced by insert().
01135 {
01136
01137 if (firstEvent_==NULL || firstEvent_->next_ == NULL) return;
01138
01139 PushbackEvent * listItem = firstEvent_;
01140 while (listItem->next_!=NULL) {
01141 if (listItem->time_ > listItem->next_->time_) {
01142 sprintf(agent_->prnMsg, "Sanity Check Failed\n");
01143 agent_->printMsg(agent_->prnMsg, 0);
01144 exit(-1);
01145 }
01146 listItem = listItem->next_;
01147 }
01148
01149 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 1075 of file pushback.cc. References agent_, Scheduler::clock(), firstEvent_, Scheduler::instance(), PushbackAgent::printMsg(), PushbackAgent::prnMsg, TimerHandler::resched(), and PushbackEvent::time_. Referenced by cancelStatus(), expire(), insert(), and removeEvents().
01075 {
01076
01077 if (firstEvent_== NULL) {
01078 sprintf(agent_->prnMsg,"Timer: Nothing to schedule\n");
01079 agent_->printMsg(agent_->prnMsg, 0);
01080 return;
01081 }
01082
01083 resched(firstEvent_->time_ - Scheduler::instance().clock());
01084 }
|
Here is the call graph for this function:

|
|
|
Definition at line 187 of file pushback.h. Referenced by cancelStatus(), expire(), insert(), PushbackTimer(), sanityCheck(), and schedule(). |
|
|
Definition at line 75 of file timer-handler.h. Referenced by TimerHandler::_cancel(), TimerHandler::_sched(), WebPage::start(), and EmpWebPage::start(). |
|
|
Definition at line 178 of file pushback.h. Referenced by cancelStatus(), containsRefresh(), expire(), insert(), PushbackTimer(), removeEvents(), sanityCheck(), and schedule(). |
|
1.3.3