OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bfd_client.h
Go to the documentation of this file.
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  Connection *GetConnection() { return cm_; }
25 
26 private:
27  void Notify(const SessionKey &key, const BFD::BFDState &new_state);
28 
31 };
32 
33 } // namespace BFD
34 
35 #endif // SRC_BFD_CLIENT_H_
Client(Connection *cm, ClientId client_id=0)
Definition: bfd_client.cc:23
Connection * cm_
Definition: bfd_client.h:30
virtual ~Client()
Definition: bfd_client.cc:26
ClientId id_
Definition: bfd_client.h:29
uint32_t ClientId
Definition: bfd_common.h:19
bool Up(const SessionKey &key) const
Definition: bfd_client.cc:38
Connection * GetConnection()
Definition: bfd_client.h:24
Session * GetSession(const SessionKey &key) const
Definition: bfd_client.cc:34
void DeleteClientSessions()
Definition: bfd_client.cc:30
BFDState
Definition: bfd_common.h:21
void DeleteSession(const SessionKey &key)
Definition: bfd_client.cc:48
void AddSession(const SessionKey &key, const SessionConfig &config)
Definition: bfd_client.cc:43
void Notify(const SessionKey &key, const BFD::BFDState &new_state)
Definition: bfd_client.cc:52