7 #include <boost/statechart/custom_reaction.hpp>
8 #include <boost/statechart/state.hpp>
9 #include <boost/statechart/state_machine.hpp>
10 #include <boost/statechart/transition.hpp>
21 #include "bgp/bgp_peer_types.h"
28 using std::ostringstream;
31 namespace mpl = boost::mpl;
32 namespace sc = boost::statechart;
39 getenv(
"CONTRAIL_BGP_IDLE_HOLD_TIME_MSECS") ?
40 strtol(getenv(
"CONTRAIL_BGP_IDLE_HOLD_TIME_MSECS"), NULL, 0) : 5000;
44 #define SM_LOG(level, _Msg) \
48 if (LoggingDisabled()) break; \
49 BGP_LOG_SERVER(peer_, (BgpTable *) 0); \
50 BGP_LOG(BgpPeerStateMachine, level, \
51 BGP_LOG_FLAG_SYSLOG, BGP_PEER_DIR_NA, \
52 peer_ ? peer_->ToUVEKey() : "", \
56 #define SM_LOG_NOTICE(_Msg) \
60 if (LoggingDisabled()) break; \
61 BGP_LOG_SERVER(peer_, (BgpTable *) 0); \
62 BGP_LOG_NOTICE(BgpPeerStateMachine, \
63 BGP_LOG_FLAG_SYSLOG, BGP_PEER_DIR_NA, \
64 peer_ ? peer_->ToUVEKey() : "", \
76 static const char *
Name() {
84 static const char *
Name() {
93 static const char *
Name() {
94 return "EvIdleHoldTimerExpired";
107 return "EvConnectTimerExpired";
128 return "EvOpenTimerExpired";
145 return "EvHoldTimerExpired";
164 return "EvTcpConnected";
177 return "EvTcpConnectFail";
190 return "EvTcpPassiveOpen";
216 return "EvTcpDeleteSession";
225 : session(session), subcode(subcode) {
227 data = std::string((
const char *)_data, data_size);
230 return "EvBgpHeaderError";
240 : session(session), msg(msg) {
255 boost::shared_ptr<const BgpProto::OpenMessage>
msg;
260 const uint8_t *_data = NULL,
size_t data_size = 0)
261 : session(session), subcode(subcode) {
266 data.push_back(version);
268 data = std::string((
const char *)_data, data_size);
272 return "EvBgpOpenError";
287 log_level = SandeshLevel::SYS_INFO;
293 return "EvBgpKeepalive";
304 : session(session), msg(msg) {
311 return "EvBgpNotification";
320 boost::shared_ptr<const BgpProto::Notification>
msg;
325 size_t msgsize) : session(session), msg(msg), msgsize(msgsize) {
328 return "EvBgpUpdate";
332 boost::shared_ptr<const BgpProto::Update>
msg;
338 : session(session), subcode(subcode), data(data) {
341 return "EvBgpUpdateError";
357 template <
typename Ev,
int code = 0>
369 template <
typename Ev>
375 template <
typename Ev>
378 &StateMachine::OnIdle<Ev, BgpProto::Notification::FSMErr> >
reaction;
381 template <
typename Ev,
int code>
391 struct Idle : sc::state<Idle, StateMachine> {
394 sc::custom_reaction<EvStart>,
395 sc::custom_reaction<EvIdleHoldTimerExpired>,
396 sc::custom_reaction<EvTcpPassiveOpen>
405 explicit Idle(my_context ctx) : my_base(ctx) {
409 peer->clear_session();
429 return transit<Active>();
431 return discard_event();
436 return transit<Active>();
444 return discard_event();
453 struct Active : sc::state<Active, StateMachine> {
456 sc::custom_reaction<EvConnectTimerExpired>,
457 sc::custom_reaction<EvOpenTimerExpired>,
458 sc::custom_reaction<EvTcpPassiveOpen>,
459 sc::custom_reaction<EvTcpClose>,
460 sc::custom_reaction<EvBgpOpen>,
475 explicit Active(my_context ctx) : my_base(ctx) {
494 if (peer->IsPassive()) {
495 return discard_event();
497 return transit<Connect>();
508 return transit<OpenSent>();
510 return discard_event();
522 return discard_event();
533 return discard_event();
548 return discard_event();
554 return discard_event();
560 peer->SendOpen(session);
561 if (!peer->SetCapabilities(event.
msg.get()))
562 return discard_event();
563 return transit<OpenConfirm>();
571 struct Connect : sc::state<Connect, StateMachine> {
574 sc::custom_reaction<EvConnectTimerExpired>,
575 sc::custom_reaction<EvOpenTimerExpired>,
576 sc::custom_reaction<EvTcpConnected>,
577 sc::custom_reaction<EvTcpConnectFail>,
578 sc::custom_reaction<EvTcpPassiveOpen>,
579 sc::custom_reaction<EvTcpClose>,
580 sc::custom_reaction<EvBgpOpen>,
592 explicit Connect(my_context ctx) : my_base(ctx) {
610 peer->inc_connect_timer_expired();
611 return transit<Active>();
623 return transit<OpenSent>();
633 peer->SendOpen(session);
634 return transit<OpenSent>();
642 return transit<Active>();
652 return discard_event();
663 return discard_event();
669 return transit<Active>();
685 return discard_event();
691 return discard_event();
699 peer->SendOpen(session);
700 if (!peer->SetCapabilities(event.
msg.get()))
701 return discard_event();
702 return transit<OpenConfirm>();
713 struct OpenSent : sc::state<OpenSent, StateMachine> {
716 sc::custom_reaction<EvOpenTimerExpired>,
719 sc::custom_reaction<EvTcpPassiveOpen>,
720 sc::custom_reaction<EvTcpClose>,
721 sc::custom_reaction<EvBgpOpen>,
722 sc::custom_reaction<EvBgpNotification>,
756 return discard_event();
771 return transit<Active>();
773 return discard_event();
787 return transit<Active>();
795 return transit<Active>();
798 return discard_event();
810 uint32_t local_bgp_id = peer->
server()->bgp_identifier();
811 if (event.
msg->identifier > local_bgp_id) {
816 "Connection collision - closing active session");
824 peer->SendOpen(session);
833 if (event.
session != session) {
834 return discard_event();
843 "Connection collision - closing passive session");
854 if (event.
session != session) {
855 return discard_event();
868 if (event.
session != session) {
869 return discard_event();
881 if (event.
session != session) {
882 return discard_event();
890 if (!peer->SetCapabilities(event.
msg.get()))
891 return discard_event();
892 return transit<OpenConfirm>();
901 return discard_event();
911 return discard_event();
919 return transit<Active>();
921 return discard_event();
925 return transit<Idle, StateMachine, EvBgpNotification>(
926 &StateMachine::OnIdle<EvBgpNotification, 0>, event);
940 sc::custom_reaction<EvTcpPassiveOpen>,
943 sc::custom_reaction<EvBgpNotification>,
944 sc::custom_reaction<EvBgpKeepalive>,
960 peer->StartKeepaliveTimer();
981 "Connection rejected - unexpected passive session");
983 return discard_event();
990 return discard_event();
992 return transit<Idle, StateMachine, EvBgpNotification>(
993 &StateMachine::OnIdle<EvBgpNotification, 0>, event);
1001 StateMachine *state_machine = &context<StateMachine>();
1003 return transit<Idle, StateMachine, EvBgpKeepalive>(
1004 &StateMachine::OnIdle<EvBgpKeepalive, 0>, event);
1006 return transit<Established>();
1019 sc::custom_reaction<EvTcpPassiveOpen>,
1023 sc::custom_reaction<EvBgpKeepalive>,
1024 sc::custom_reaction<EvBgpUpdate>,
1033 StateMachine *state_machine = &context<StateMachine>();
1038 peer->NotifyEstablished(
true);
1039 peer->RegisterAllTables();
1043 StateMachine *state_machine = &context<StateMachine>();
1052 StateMachine *state_machine = &context<StateMachine>();
1059 return discard_event();
1064 StateMachine *state_machine = &context<StateMachine>();
1066 return discard_event();
1071 StateMachine *state_machine = &context<StateMachine>();
1074 return discard_event();
1081 : work_queue_(
TaskScheduler::GetInstance()->GetTaskId(
"bgp::StateMachine"),
1082 peer->GetTaskInstance(),
1085 active_session_(NULL),
1086 passive_session_(NULL),
1087 connect_timer_(
TimerManager::CreateTimer(*peer->server()->ioservice(),
1089 TaskScheduler::GetInstance()->GetTaskId(
"bgp::StateMachine"),
1090 peer->GetTaskInstance())),
1091 open_timer_(
TimerManager::CreateTimer(*peer->server()->ioservice(),
1093 TaskScheduler::GetInstance()->GetTaskId(
"bgp::StateMachine"),
1094 peer->GetTaskInstance())),
1095 hold_timer_(
TimerManager::CreateTimer(*peer->server()->ioservice(),
1097 TaskScheduler::GetInstance()->GetTaskId(
"bgp::StateMachine"),
1098 peer->GetTaskInstance())),
1099 idle_hold_timer_(
TimerManager::CreateTimer(*peer->server()->ioservice(),
1101 TaskScheduler::GetInstance()->GetTaskId(
"bgp::StateMachine"),
1102 peer->GetTaskInstance())),
1103 hold_time_(GetConfiguredHoldTime()),
1178 template <
typename Ev,
int code>
1184 template <
typename Ev>
1195 template <
typename Ev,
int code>
1218 int ms = seconds ? seconds * 1000 : 50;
1219 ms = (ms * (100 -
kJitter)) / 100;
1369 const std::string &data) {
1375 if (session && code != 0)
1416 boost::system::error_code error;
1419 if (
peer() &&
peer()->session() &&
peer()->session()->socket() &&
1420 peer()->session()->socket()->available(error) > 0) {
1484 static_cast<BgpProto::Notification *>(msg)));
1492 switch (msg->
type) {
1498 if (
int subcode = open_msg->
Validate(peer)) {
1522 peer = session->
peer();
1528 if (peer && (subcode = update->
Validate(peer, &data))) {
1562 std::string((
const char *)context->
data, context->
data_size)));
1579 return state_names[
state_];
1595 out << state_names[state];
1600 template <
typename Ev>
1602 template <
typename T,
bool (T::*)(StateMachine *) const>
struct SFINAE {};
1604 template <
typename T>
static int Test(...);
1605 static const bool Has =
sizeof(Test<Ev>(0)) ==
sizeof(char);
1608 template <
typename Ev,
bool has_val
idate>
1615 template <
typename Ev>
1618 return boost::bind(&Ev::validate, event, _1);
1622 template <
typename Ev>
1626 ec.
event =
event.intrusive_from_this();
1628 static_cast<const Ev *>(ec.
event.get()));
1638 (event_name ==
"fsm::EvBgpKeepalive" ||
1639 event_name ==
"fsm::EvBgpUpdate")) {
1642 SM_LOG(log_level, msg <<
" " << event_name <<
" in state " <<
StateName());
1648 if (deferred_delete != NULL) {
1658 process_event(*ec.
event);
1691 static tbb::atomic<bool> env_checked = tbb::atomic<bool>();
1692 static tbb::atomic<int> env_hold_time = tbb::atomic<int>();
1696 char *keepalive_time_str = getenv(
"BGP_KEEPALIVE_SECONDS");
1697 if (keepalive_time_str) {
1698 env_hold_time = strtoul(keepalive_time_str, NULL, 0) * 3;
1700 return env_hold_time;
1704 }
else if (env_hold_time) {
1705 return env_hold_time;
1721 assert(!peer_info.get_name().empty());
1731 (event ==
"fsm::EvBgpKeepalive" || event ==
"fsm::EvBgpUpdate")) {
1735 BgpPeerInfoData peer_info;
1736 peer_info.set_name(
peer()->ToUVEKey());
1737 PeerEventInfo event_info;
1740 peer_info.set_event_info(event_info);
1745 const string &reason) {
1750 BgpPeerInfoData peer_info;
1751 peer_info.set_name(
peer()->ToUVEKey());
1754 static_cast<BgpProto::Notification::Code>(code), subcode));
1759 const string &reason) {
1764 BgpPeerInfoData peer_info;
1765 peer_info.set_name(
peer()->ToUVEKey());
1768 static_cast<BgpProto::Notification::Code>(code), subcode));
1778 BgpPeerInfoData peer_info;
1779 peer_info.set_name(
peer()->ToUVEKey());
1780 PeerStateInfo state_info;
1784 peer_info.set_state_info(state_info);
1791 BgpPeerInfoData peer_info;
1792 peer_info.set_name(
peer()->ToUVEKey());
1800 BgpPeerInfoData peer_info;
1801 peer_info.set_name(
peer()->ToUVEKey());
1818 BgpPeerInfoData peer_info;
1819 peer_info.set_name(
peer()->ToUVEKey());
1820 PeerStateInfo state_info;
1824 peer_info.set_state_info(state_info);
1826 PeerEventInfo event_info;
1829 peer_info.set_event_info(event_info);
void OnIdleNotification(const fsm::EvBgpNotification &event)
virtual const std::string ToString() const
const std::string & LastStateName() const
sc::transition< Ev, Idle, StateMachine,&StateMachine::OnIdleCease< Ev > > reaction
void set_last_notification_out(int code, int subcode, const std::string &reason)
int Validate(BgpPeer *peer) const
bool IsQueueEmpty() const
sc::result react(const EvTcpPassiveOpen &event)
const std::string last_notification_in_error() const
virtual void DeleteSession(TcpSession *session)
EvValidate operator()(const Ev *event)
virtual void StartConnectTimer(int seconds)
The TaskScheduler keeps track of what tasks are currently schedulable. When a task is enqueued it is ...
sc::result react(const EvBgpNotification &event)
void Shutdown(bool delete_entries=true)
sc::result react(const EvConnectTimerExpired &event)
EvIdleHoldTimerExpired(Timer *timer)
boost::shared_ptr< const BgpProto::Notification > msg
mpl::list< IdleCease< EvStop >::reaction, sc::custom_reaction< EvStart >, sc::custom_reaction< EvIdleHoldTimerExpired >, sc::custom_reaction< EvTcpPassiveOpen > > reactions
EvHoldTimerExpired(Timer *timer)
virtual void Connect(TcpSession *session, Endpoint remote)
static const char * Name()
const std::string & StateName() const
virtual void StartOpenTimer(int seconds)
void inc_rx_notification()
bool IdleHoldTimerExpired()
bool validate(StateMachine *state_machine) const
static const char * Name()
uint64_t last_state_change_at_
static const int kIdleHoldTime
const uint64_t last_state_change_usecs_at() const
sc::result react(const EvTcpClose &event)
#define SM_LOG(level, _Msg)
void set_passive_session(BgpSession *session)
std::ostream & operator<<(std::ostream &out, BFDState state)
EvValidate operator()(const Ev *event)
virtual std::string ToString() const
boost::shared_ptr< const BgpProto::OpenMessage > msg
void reset_idle_hold_time()
BgpSession * passive_session_
void Shutdown(int subcode)
sc::result react(const EvTcpPassiveOpen &event)
void PeerClose(int code, int subcode)
EvBgpOpenError(BgpSession *session, int subcode, const uint8_t *_data=NULL, size_t data_size=0)
bool ConnectTimerExpired()
bool ProcessNotificationEvent(BgpSession *session)
boost::shared_ptr< const BgpProto::Update > msg
void OnMessageError(BgpSession *session, const ParseErrorContext *context)
static const char * Name()
bool ConnectTimerRunning()
virtual uint32_t bgp_identifier() const
sc::result react(const EvBgpKeepalive &event)
std::string last_notification_in_error_
void CancelIdleHoldTimer()
boost::intrusive_ptr< const sc::event_base > event
#define BGP_UVE_SEND(type, object)
static const int kHoldTime
void TimerErrorHanlder(std::string name, std::string error)
void SetDataCollectionKey(BgpPeerInfo *peer_info) const
bool IsRouterTypeBGPaaS() const
bool validate(StateMachine *state_machine) const
uint16_t hold_time() const
static const char * Name()
EvTcpPassiveOpen(BgpSession *session)
void set_active_session(BgpSession *session)
virtual void SetDataCollectionKey(BgpPeerInfo *peer_info) const
void OnMessage(BgpSession *session, BgpProto::BgpMessage *msg, size_t msgsize=0)
EvBgpUpdateError(BgpSession *session, int subcode, std::string data)
void set_last_notification_in(int code, int subcode, const std::string &reason)
static const char * Name()
uint32_t hold_time() const
int GetConfiguredHoldTime() const
EvTcpConnected(BgpSession *session)
boost::asio::ip::tcp::endpoint endpoint
sc::result react(const EvBgpOpen &event)
boost::function< bool(StateMachine *)> EvValidate
void SendOpen(TcpSession *session)
sc::result react(const EvBgpOpen &event)
void set_observer(EventObserver observer)
virtual BgpServer * server()
bool IsCloseInProgress() const
void OnIdleCease(const Ev &event)
StateMachine * state_machine()
static const char * Name()
const BgpPeerKey & peer_key() const
StateMachine(BgpPeer *peer)
bool IdleHoldTimerRunning()
sc::result react(const EvBgpNotification &event)
bool validate(StateMachine *state_machine) const
const std::string last_state_change_at() const
static const char * Name()
void connect_attempts_clear()
bool IsCloseGraceful() const
void ProcessUpdate(const BgpProto::Update *msg, size_t msgsize=0)
virtual void StartIdleHoldTimer()
#define BGP_LOG_FLAG_SYSLOG
bool IsQueueEmpty() const
void SetExitCallback(TaskExitCallback on_exit)
sc::result react(const EvStart &event)
static const std::string integerToString(const NumberType &num)
void SendNotification(BgpSession *, int code, int subcode=0, const std::string &data=std::string())
virtual void StartHoldTimer()
void BGPPeerInfoSend(const BgpPeerInfoData &peer_info)
bool PassiveOpen(BgpSession *session)
void set_hold_time(int hold_time)
bool validate(StateMachine *state_machine) const
static const int kMaxIdleHoldTime
BgpSession * CreateSession()
virtual IPeerDebugStats * peer_stats()
mpl::list< IdleCease< EvStop >::reaction, IdleFsmError< EvOpenTimerExpired >::reaction, TransitToIdle< EvHoldTimerExpired, BgpProto::Notification::HoldTimerExp >::reaction, sc::custom_reaction< EvTcpPassiveOpen >, TransitToIdle< EvTcpClose >::reaction, IdleFsmError< EvBgpOpen >::reaction, sc::custom_reaction< EvBgpNotification >, sc::custom_reaction< EvBgpKeepalive >, IdleFsmError< EvBgpUpdate >::reaction, IdleError< EvBgpHeaderError, BgpProto::Notification::MsgHdrErr >::reaction, IdleError< EvBgpOpenError, BgpProto::Notification::OpenMsgErr >::reaction, IdleError< EvBgpUpdateError, BgpProto::Notification::UpdateMsgErr >::reaction > reactions
static const char * Name()
std::pair< int, int > last_notification_in_
bool Enqueue(const Ev &event)
uint64_t last_notification_out_at_
BgpSession * active_session()
sc::result react(const EvOpenTimerExpired &event)
static const char * Name()
void SendNotification(BgpSession *session, int code, int subcode=0, const std::string &data=std::string())
uint64_t last_notification_in_at_
#define CHECK_CONCURRENCY(...)
EvBgpNotification(BgpSession *session, const BgpProto::Notification *msg)
static boost::posix_time::ptime UTCUsecToPTime(uint64_t tusec)
static const char * Name()
void SetAdminState(bool down, int subcode)
sc::result react(const EvTcpPassiveOpen &event)
sc::result react(const EvBgpUpdate &event)
EvBgpUpdate(BgpSession *session, const BgpProto::Update *msg, size_t msgsize)
void DequeueEventDone(bool done)
void set_session(BgpSession *session)
BgpSessionManager * session_manager()
sc::result react(const EvTcpConnectFail &event)
sc::result react(const EvOpenTimerExpired &event)
virtual bool IsPeerCloseInProgress() const
virtual void OnSessionEvent(TcpSession *session, TcpSession::Event event)
virtual const int GetIdleHoldTimeMSecs() const
int GetConnectTime() const
static const int kOpenTime
void NotifyEstablished(bool established)
static const char * Name()
std::string last_notification_out_error_
sc::result react(const EvIdleHoldTimerExpired &event)
static const char * Name()
virtual const std::string & ToUVEKey() const
sc::transition< EvBgpNotification, Idle, StateMachine,&StateMachine::OnIdleNotification > reaction
static const char * Name()
sc::result react(const EvTcpPassiveOpen &event)
bool validate(StateMachine *state_machine) const
sc::result react(const EvOpenTimerExpired &event)
sc::result react(const EvTcpPassiveOpen &event)
EvOpenTimerExpired(Timer *timer)
void Close(bool graceful)
virtual void OnNotificationMessage(BgpSession *session, BgpProto::BgpMessage *msg)
sc::transition< Ev, Idle, StateMachine,&StateMachine::OnIdle< Ev, BgpProto::Notification::FSMErr > > reaction
sc::transition< Ev, Idle, StateMachine,&StateMachine::OnIdle< Ev, code > > reaction
static const char * Name()
static char Test(SFINAE< T,&T::validate > *)
BgpSession * passive_session()
EvBgpOpen(BgpSession *session, const BgpProto::OpenMessage *msg)
bool validate(StateMachine *state_machine) const
void OnIdleError(const Ev &event)
EvTcpClose(BgpSession *session)
int Validate(const BgpPeer *, std::string *data)
EvTcpConnectFail(BgpSession *session)
const std::string last_notification_out_error() const
static uint64_t UTCTimestampUsec()
std::pair< int, int > last_notification_out_
virtual bool IsCloseGraceful() const
void set_state(State state)
EvTcpDeleteSession(BgpSession *session)
void set_last_event(const std::string &event)
void inc_hold_timer_expired()
static const int kOpenSentHoldTime
bool Start(int time, Handler handler, ErrorHandler error_handler=NULL)
EvBgpKeepalive(BgpSession *session)
bool validate(StateMachine *state_machine) const
sc::transition< Ev, Idle, StateMachine,&StateMachine::OnIdleError< Ev, code > > reaction
void AssignSession(bool active)
void CancelConnectTimer()
Established(my_context ctx)
void LogNotification(int code, int subcode, const std::string &direction, const std::string &peer_key, const BgpProto::Notification &msg) const
sc::result react(const EvBgpKeepalive &event)
sc::result react(const EvTcpClose &event)
static const int kConnectInterval
BgpSession * active_session_
void OnIdle(const Ev &event)
void connect_attempts_inc()
bool AttemptGRHelperMode(int code, int subcode) const
OpenConfirm(my_context ctx)
static const char * Name()
void SendNotification(int code, int subcode, const std::string &data=std::string())
static const char * Name()
static const char * Name()
mpl::list< IdleCease< EvStop >::reaction, IdleFsmError< EvOpenTimerExpired >::reaction, TransitToIdle< EvHoldTimerExpired, BgpProto::Notification::HoldTimerExp >::reaction, sc::custom_reaction< EvTcpPassiveOpen >, TransitToIdle< EvTcpClose >::reaction, IdleFsmError< EvBgpOpen >::reaction, TransitToIdle< EvBgpNotification >::reaction, sc::custom_reaction< EvBgpKeepalive >, sc::custom_reaction< EvBgpUpdate >, IdleError< EvBgpHeaderError, BgpProto::Notification::MsgHdrErr >::reaction, IdleFsmError< EvBgpOpenError >::reaction, IdleError< EvBgpUpdateError, BgpProto::Notification::UpdateMsgErr >::reaction > reactions
static SandeshLevel::type LoggingUtLevel()
virtual void AsyncReadStart()
sc::result react(const EvTcpPassiveOpen &event)
void LogEvent(std::string event_name, std::string msg, SandeshLevel::type log_level=SandeshLevel::SYS_DEBUG)
virtual bool IsRouterTypeBGPaaS() const
bool Enqueue(QueueEntryT entry)
sc::result react(const EvConnectTimerExpired &event)
#define SM_LOG_NOTICE(_Msg)
virtual void DeleteSession(BgpSession *session)
sc::result react(const EvBgpOpen &event)
EvConnectTimerExpired(Timer *timer)
static const std::string state_names[]
sc::result react(const EvTcpConnected &event)
mpl::list< IdleCease< EvStop >::reaction, sc::custom_reaction< EvConnectTimerExpired >, sc::custom_reaction< EvOpenTimerExpired >, sc::custom_reaction< EvTcpConnected >, sc::custom_reaction< EvTcpConnectFail >, sc::custom_reaction< EvTcpPassiveOpen >, sc::custom_reaction< EvTcpClose >, sc::custom_reaction< EvBgpOpen >, TransitToIdle< EvBgpNotification >::reaction, IdleFsmError< EvBgpKeepalive >::reaction, IdleFsmError< EvBgpUpdate >::reaction, IdleError< EvBgpHeaderError, BgpProto::Notification::MsgHdrErr >::reaction, IdleError< EvBgpOpenError, BgpProto::Notification::OpenMsgErr >::reaction, IdleError< EvBgpUpdateError, BgpProto::Notification::UpdateMsgErr >::reaction > reactions
void set_idle_hold_time(int idle_hold_time)
sc::result react(const EvTcpClose &event)
bool DequeueEvent(EventContainer ec)
bool validate(StateMachine *state_machine) const
void increment_flap_count()
mpl::list< IdleCease< EvStop >::reaction, sc::custom_reaction< EvConnectTimerExpired >, sc::custom_reaction< EvOpenTimerExpired >, sc::custom_reaction< EvTcpPassiveOpen >, sc::custom_reaction< EvTcpClose >, sc::custom_reaction< EvBgpOpen >, TransitToIdle< EvBgpNotification >::reaction, IdleFsmError< EvBgpKeepalive >::reaction, IdleFsmError< EvBgpUpdate >::reaction, IdleError< EvBgpHeaderError, BgpProto::Notification::MsgHdrErr >::reaction, IdleError< EvBgpOpenError, BgpProto::Notification::OpenMsgErr >::reaction, IdleError< EvBgpUpdateError, BgpProto::Notification::UpdateMsgErr >::reaction > reactions
static bool DeleteTimer(Timer *Timer)
WorkQueue< EventContainer > work_queue_
static const std::string toString(Code code, int subcode)
#define BGP_LOG_PEER(type, peer, level, flags, dir, arg)
void SendKeepalive(bool from_timer)
bool validate(StateMachine *state_machine) const
bool IsEstablished() const
int idle_hold_time() const
bool validate(StateMachine *state_machine) const
mpl::list< IdleCease< EvStop >::reaction, sc::custom_reaction< EvOpenTimerExpired >, TransitToIdle< EvHoldTimerExpired, BgpProto::Notification::HoldTimerExp >::reaction, sc::custom_reaction< EvTcpPassiveOpen >, sc::custom_reaction< EvTcpClose >, sc::custom_reaction< EvBgpOpen >, sc::custom_reaction< EvBgpNotification >, IdleFsmError< EvBgpKeepalive >::reaction, IdleFsmError< EvBgpUpdate >::reaction, IdleError< EvBgpHeaderError, BgpProto::Notification::MsgHdrErr >::reaction, IdleError< EvBgpOpenError, BgpProto::Notification::OpenMsgErr >::reaction, IdleError< EvBgpUpdateError, BgpProto::Notification::UpdateMsgErr >::reaction > reactions