OpenSDN source code
bfd_client.h
Go to the documentation of this file.
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  Connection *GetConnection() { return cm_; }
26 
27 private:
28  void Notify(const SessionKey &key, const BFD::BFDState &new_state);
29 
32 };
33 
34 } // namespace BFD
35 
36 #endif // SRC_BFD_CLIENT_H_
void Notify(const SessionKey &key, const BFD::BFDState &new_state)
Definition: bfd_client.cc:54
void DeleteClientSessions()
Definition: bfd_client.cc:32
Session * GetSession(const SessionKey &key) const
Definition: bfd_client.cc:36
Connection * cm_
Definition: bfd_client.h:31
void AddSession(const SessionKey &key, const SessionConfig &config)
Definition: bfd_client.cc:45
bool Up(const SessionKey &key) const
Definition: bfd_client.cc:40
virtual ~Client()
Definition: bfd_client.cc:28
void DeleteSession(const SessionKey &key)
Definition: bfd_client.cc:50
ClientId id_
Definition: bfd_client.h:30
Client(Connection *cm, ClientId client_id=0)
Definition: bfd_client.cc:25
Connection * GetConnection()
Definition: bfd_client.h:25
Definition: bfd_client.h:10
uint32_t ClientId
Definition: bfd_common.h:19
BFDState
Definition: bfd_common.h:21