5 #ifndef vnsw_agent_bfd_proto_h_
6 #define vnsw_agent_bfd_proto_h_
18 #include "base/test/task_test_util.h"
20 #define BFD_TX_BUFF_LEN 128
22 #define BFD_TRACE(obj, ...) \
24 Bfd##obj::TraceMsg(BfdTraceBuf, __FILE__, __LINE__, ##__VA_ARGS__); \
79 const boost::asio::ip::udp::endpoint &local_endpoint,
80 const boost::asio::ip::udp::endpoint &remote_endpoint,
82 const boost::asio::mutable_buffer &packet,
int pktSize);
95 boost::asio::io_context &io);
109 bool Enqueue(boost::shared_ptr<PktInfo> msg);
113 const boost::asio::ip::udp::endpoint &local_endpoint,
114 const boost::asio::ip::udp::endpoint &remote_endpoint,
117 boost::system::error_code ec);
136 typedef std::map<BfdSessionsKey, HealthCheckInstanceService *, BfdSessionsKeyCmp>
Sessions;
137 typedef std::pair<BfdSessionsKey, HealthCheckInstanceService *>
SessionsPair;
141 boost::shared_ptr<PktInfo>
msg_;
152 #endif // vnsw_agent_bfd_proto_h_
bool Enqueue(boost::shared_ptr< PktInfo > msg)
const BfdStats & GetStats() const
void NotifyHealthCheckInstanceService(uint32_t interface, IpAddress address, std::string &data)
std::map< BfdSessionsKey, HealthCheckInstanceService *, BfdSessionsKeyCmp > Sessions
virtual void NotifyStateChange(const BFD::SessionKey &key, const bool &up)
void IncrementKaEnqueueCount()
BfdCommunicator(BfdProto *bfd_proto)
bool ProcessBfdKeepAlive(boost::shared_ptr< PktInfo > msg)
void ProcessStats(PktStatsType::Type type)
boost::asio::ip::address IpAddress
bool IsEqual(const BfdSessionsKey &rhs) const
boost::shared_ptr< PktInfo > msg_
static const uint32_t kMultiplier
BfdCommunicator communicator_
bool BfdHealthCheckSessionControl(HealthCheckTable::HealthCheckServiceAction action, HealthCheckInstanceService *service)
WorkQueue< Event * > * event_queue()
bool operator<(const BfdSessionsKey &right) const
bool operator()(const BfdSessionsKey &lhs, const BfdSessionsKey &rhs) const
virtual void SetServer(BFD::Server *server)
void IncrementReceiveDropCount()
void HandleReceiveSafe(boost::asio::const_buffer pkt, const boost::asio::ip::udp::endpoint &local_endpoint, const boost::asio::ip::udp::endpoint &remote_endpoint, const BFD::SessionIndex &session_index, uint8_t pkt_len, boost::system::error_code ec)
BfdSessionsKey(uint32_t id, IpAddress ip)
uint32_t ActiveSessions() const
virtual BFD::Server * GetServer() const
virtual ~BfdCommunicator()
BfdCommunicator & bfd_communicator()
DISALLOW_COPY_AND_ASSIGN(BfdProto)
static const uint32_t kMinTxInterval
uint64_t bfd_rx_ka_enqueue_count
static const uint32_t kMinRxInterval
bool IsLess(const BfdSessionsKey &rhs) const
uint32_t bfd_rx_drop_count
BfdProto(Agent *agent, boost::asio::io_context &io)
std::pair< BfdSessionsKey, HealthCheckInstanceService * > SessionsPair
ProtoHandler * AllocProtoHandler(boost::shared_ptr< PktInfo > info, boost::asio::io_context &io)
virtual void SendPacket(const boost::asio::ip::udp::endpoint &local_endpoint, const boost::asio::ip::udp::endpoint &remote_endpoint, const BFD::SessionIndex &session_index, const boost::asio::mutable_buffer &packet, int pktSize)