OpenSDN source code
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
nexthop_client.h
Go to the documentation of this file.
1
/*
2
* NexthopDBClient class: represents a client connecting to the nexthop-server
3
* interface for nexthop notifications.
4
*/
5
#ifndef _AGENT_NHS_NEXTHOP_CLIENT_H_
6
#define _AGENT_NHS_NEXTHOP_CLIENT_H_
7
8
#include <boost/array.hpp>
9
#include <boost/asio.hpp>
10
#include <boost/asio/signal_set.hpp>
11
#include <boost/bind.hpp>
12
#include <boost/enable_shared_from_this.hpp>
13
#include <boost/shared_ptr.hpp>
14
#include <cstdio>
15
#include <iostream>
16
#include "
io/usock_server.h
"
17
#include "
nexthop_entry.h
"
18
#include <tbb/mutex.h>
19
20
class
NexthopDBServer
;
21
22
/*
23
* Class to represent each client that connects to nexthop-server to
24
* receive nexthop notifications.
25
*/
26
class
NexthopDBClient
27
{
28
public
:
29
30
typedef
boost::shared_ptr <NexthopDBClient>
ClientPtr
;
31
typedef
std::vector <NexthopDBEntry::NexthopPtr>
NexthopList
;
32
typedef
std::vector <NexthopDBEntry::NexthopPtr>::iterator
33
NexthopListIterator
;
34
35
NexthopDBClient
(UnixDomainSocketSession *session,
NexthopDBServer
*server);
36
~NexthopDBClient
();
37
38
void
AddNexthop
(
NexthopDBEntry::NexthopPtr
nh);
39
void
RemoveNexthop
(
NexthopDBEntry::NexthopPtr
nh);
40
bool
FindNexthop
(
NexthopDBEntry::NexthopPtr
nh);
41
42
/*
43
* Handle events from the underlying (unix socket) session to this client
44
*/
45
void
EventHandler
(UnixDomainSocketSession *,
46
UnixDomainSocketSession::Event
);
47
48
protected
:
49
friend
class
NexthopDBServer
;
50
51
private
:
52
UnixDomainSocketSession *
session_
;
53
NexthopDBServer
*
server_
;
54
55
/*
56
* Each client object maintains its own vector of nexthops that need to be
57
* dispatched. The nexthop pointer is removed from the vector after the
58
* dispatch.
59
*/
60
NexthopList
nexthop_list_
;
61
62
void
WriteMessage
();
63
uint8_t *
NextMessage
(
int
*length);
64
};
65
66
#endif
NexthopDBClient::~NexthopDBClient
~NexthopDBClient()
Definition:
nexthop_client.cc:28
NexthopDBClient::NexthopListIterator
std::vector< NexthopDBEntry::NexthopPtr >::iterator NexthopListIterator
Definition:
nexthop_client.h:33
NexthopDBEntry::NexthopPtr
boost::shared_ptr< NexthopDBEntry > NexthopPtr
Definition:
nexthop_entry.h:25
NexthopDBClient::NextMessage
uint8_t * NextMessage(int *length)
Definition:
nexthop_client.cc:81
NexthopDBClient::WriteMessage
void WriteMessage()
Definition:
nexthop_client.cc:132
NexthopDBClient::NexthopList
std::vector< NexthopDBEntry::NexthopPtr > NexthopList
Definition:
nexthop_client.h:31
NexthopDBClient::ClientPtr
boost::shared_ptr< NexthopDBClient > ClientPtr
Definition:
nexthop_client.h:30
NexthopDBClient::RemoveNexthop
void RemoveNexthop(NexthopDBEntry::NexthopPtr nh)
Definition:
nexthop_client.cc:56
NexthopDBClient::server_
NexthopDBServer * server_
Definition:
nexthop_client.h:53
Event
Event
Definition:
http_client.h:27
NexthopDBClient::EventHandler
void EventHandler(UnixDomainSocketSession *, UnixDomainSocketSession::Event)
Definition:
nexthop_client.cc:37
NexthopDBClient::AddNexthop
void AddNexthop(NexthopDBEntry::NexthopPtr nh)
Definition:
nexthop_client.cc:50
NexthopDBServer
Definition:
nexthop_server.h:25
NexthopDBClient::FindNexthop
bool FindNexthop(NexthopDBEntry::NexthopPtr nh)
Definition:
nexthop_client.cc:68
nexthop_entry.h
NexthopDBClient::nexthop_list_
NexthopList nexthop_list_
Definition:
nexthop_client.h:60
NexthopDBClient::NexthopDBClient
NexthopDBClient(UnixDomainSocketSession *session, NexthopDBServer *server)
Definition:
nexthop_client.cc:18
NexthopDBClient
Definition:
nexthop_client.h:26
NexthopDBClient::session_
UnixDomainSocketSession * session_
Definition:
nexthop_client.h:52
usock_server.h
contrail
controller
src
vnsw
agent
nexthop_server
nexthop_client.h
Generated by
1.8.5