Line data Source code
1 : /* 2 : * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : #ifndef SRC_BFD_CLIENT_H_ 5 : #define SRC_BFD_CLIENT_H_ 6 : 7 : #include "bfd/bfd_common.h" 8 : 9 : namespace BFD { 10 : 11 : class Connection; 12 : class Session; 13 : struct SessionConfig; 14 : 15 : class Client { 16 : public: 17 : Client(Connection *cm, ClientId client_id = 0); 18 : virtual ~Client(); 19 : void AddSession(const SessionKey &key, const SessionConfig &config); 20 : void DeleteSession(const SessionKey &key); 21 : void DeleteClientSessions(); 22 : bool Up(const SessionKey &key) const; 23 : Session *GetSession(const SessionKey &key) const; 24 9 : Connection *GetConnection() { return cm_; } 25 : 26 : private: 27 : void Notify(const SessionKey &key, const BFD::BFDState &new_state); 28 : 29 : ClientId id_; 30 : Connection *cm_; 31 : }; 32 : 33 : } // namespace BFD 34 : 35 : #endif // SRC_BFD_CLIENT_H_