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