OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bfd_client_session.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 CodiLime, Inc. All rights reserved.
3  */
4 
5 #ifndef SRC_BFD_REST_API_BFD_CLIENT_SESSION_H_
6 #define SRC_BFD_REST_API_BFD_CLIENT_SESSION_H_
7 
8 #include "bfd/bfd_common.h"
9 #include "bfd/bfd_server.h"
10 
11 #include <set>
12 #include <string>
13 #include <boost/intrusive_ptr.hpp>
14 
15 #include "bfd/bfd_common.h"
16 #include "io/tcp_session.h"
17 
18 class HttpSession;
19 
20 namespace BFD {
21 
22 // RESTClientSession instances are used solely by RESTServer.
23 // Access is guarded by RESTServer::mutex_.
25  public:
26  RESTClientSession(Server* server, ClientId client_id);
28 
29  Session *GetSession(const boost::asio::ip::address& ip,
30  const SessionIndex &index = SessionIndex()) const;
31  Session *GetSession(const SessionKey &key) const;
32  void Notify();
34 
36  const SessionConfig &config);
38 
39  private:
40  typedef std::set<SessionKey> Sessions;
41  typedef std::set<boost::intrusive_ptr<HttpSession> > HttpSessionSet;
42 
43  void OnHttpSessionEvent(HttpSession* session, enum TcpSession::Event event);
44 
49  bool changed_;
50 };
51 
52 } // namespace BFD
53 
54 #endif // SRC_BFD_REST_API_BFD_CLIENT_SESSION_H_
ResultCode AddBFDConnection(const SessionKey &key, const SessionConfig &config)
void OnHttpSessionEvent(HttpSession *session, enum TcpSession::Event event)
uint32_t ClientId
Definition: bfd_common.h:19
RESTClientSession(Server *server, ClientId client_id)
std::set< SessionKey > Sessions
ResultCode
Definition: bfd_common.h:41
std::set< boost::intrusive_ptr< HttpSession > > HttpSessionSet
void AddMonitoringHttpSession(HttpSession *session)
HttpSessionSet http_sessions_
Session * GetSession(const boost::asio::ip::address &ip, const SessionIndex &index=SessionIndex()) const
ResultCode DeleteBFDConnection(const SessionKey &key)