OpenSDN source code
vxlan_ksync.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3
* Copyright Contributors to the OpenSDN project
4
*/
5
6
#ifndef vnsw_agent_vxlan_ksync_h
7
#define vnsw_agent_vxlan_ksync_h
8
9
#include <boost/asio.hpp>
10
#include <boost/bind/bind.hpp>
11
12
#include <
db/db_entry.h
>
13
#include <
db/db_table.h
>
14
#include <
db/db_table_partition.h
>
15
#include <
ksync/ksync_entry.h
>
16
#include <
ksync/ksync_object.h
>
17
#include <
ksync/ksync_netlink.h
>
18
#include "
oper/nexthop.h
"
19
#include "
oper/vxlan.h
"
20
#include "vrouter/ksync/agent_ksync_types.h"
21
22
using namespace
boost::placeholders;
23
24
class
VxLanKSyncObject
;
25
26
class
VxLanIdKSyncEntry
:
public
KSyncNetlinkDBEntry
{
27
public
:
28
VxLanIdKSyncEntry
(
VxLanKSyncObject
*obj,
const
VxLanIdKSyncEntry
*entry,
29
uint32_t index);
30
VxLanIdKSyncEntry
(
VxLanKSyncObject
*obj,
const
VxLanId
*label);
31
virtual
~
VxLanIdKSyncEntry
();
32
33
NHKSyncEntry
*
nh
()
const
{
34
return
static_cast<
NHKSyncEntry
*
>
(nh_.get());
35
}
36
KSyncDBObject
*GetObject()
const
;
37
38
virtual
bool
IsLess
(
const
KSyncEntry
&rhs)
const
;
39
virtual
std::string
ToString
()
const
;
40
virtual
KSyncEntry
*UnresolvedReference();
41
virtual
bool
Sync(
DBEntry
*e);
42
virtual
int
AddMsg(
char
*buf,
int
buf_len);
43
virtual
int
ChangeMsg(
char
*buf,
int
buf_len);
44
virtual
int
DeleteMsg(
char
*buf,
int
buf_len);
45
void
FillObjectLog(
sandesh_op::type
op, KSyncVxLanInfo &info)
const
;
46
private
:
47
int
Encode(
sandesh_op::type
op,
char
*buf,
int
buf_len);
48
VxLanKSyncObject
*
ksync_obj_
;
49
uint32_t
label_
;
50
KSyncEntryPtr
nh_
;
51
DISALLOW_COPY_AND_ASSIGN
(
VxLanIdKSyncEntry
);
52
};
53
54
class
VxLanKSyncObject
:
public
KSyncDBObject
{
55
public
:
56
static
const
int
kVxLanIndexCount = 10000;
57
VxLanKSyncObject
(
KSync
*ksync);
58
virtual
~
VxLanKSyncObject
();
59
KSync
*
ksync
()
const
{
return
ksync_; }
60
virtual
KSyncEntry
*Alloc(
const
KSyncEntry
*entry, uint32_t index);
61
virtual
KSyncEntry
*DBToKSyncEntry(
const
DBEntry
*e);
62
void
RegisterDBClients();
63
private
:
64
KSync
*
ksync_
;
65
DISALLOW_COPY_AND_ASSIGN
(
VxLanKSyncObject
);
66
};
67
68
#endif
// vnsw_agent_vxlan_ksync_h
IsLess
static bool IsLess(const ShowRoute &lhs, const ShowRoute &rhs, const BgpSandeshContext *bsc, const string &table_name)
Definition:
bgp_show_route.cc:24
DBEntry
Definition:
db_entry.h:97
KSyncDBObject
Definition:
ksync_object.h:209
KSyncEntry
Definition:
ksync_entry.h:34
KSyncEntry::KSyncEntryPtr
boost::intrusive_ptr< KSyncEntry > KSyncEntryPtr
Definition:
ksync_entry.h:69
KSyncNetlinkDBEntry
Definition:
ksync_netlink.h:51
KSync
Definition:
ksync_init.h:28
NHKSyncEntry
Definition:
nexthop_ksync.h:28
VxLanIdKSyncEntry
Definition:
vxlan_ksync.h:26
VxLanIdKSyncEntry::ksync_obj_
VxLanKSyncObject * ksync_obj_
Definition:
vxlan_ksync.h:48
VxLanIdKSyncEntry::DISALLOW_COPY_AND_ASSIGN
DISALLOW_COPY_AND_ASSIGN(VxLanIdKSyncEntry)
VxLanIdKSyncEntry::nh_
KSyncEntryPtr nh_
Definition:
vxlan_ksync.h:50
VxLanIdKSyncEntry::label_
uint32_t label_
Definition:
vxlan_ksync.h:49
VxLanIdKSyncEntry::nh
NHKSyncEntry * nh() const
Definition:
vxlan_ksync.h:33
VxLanId
Definition:
vxlan.h:14
VxLanKSyncObject
Definition:
vxlan_ksync.h:54
VxLanKSyncObject::ksync_
KSync * ksync_
Definition:
vxlan_ksync.h:64
VxLanKSyncObject::DISALLOW_COPY_AND_ASSIGN
DISALLOW_COPY_AND_ASSIGN(VxLanKSyncObject)
VxLanKSyncObject::ksync
KSync * ksync() const
Definition:
vxlan_ksync.h:59
db_entry.h
db_table.h
db_table_partition.h
ksync_entry.h
ksync_netlink.h
ksync_object.h
type
uint8_t type
Definition:
load_balance.h:2
nexthop.h
ToString
static string ToString(PhysicalDevice::ManagementProtocol proto)
Definition:
physical_device.cc:34
vxlan.h
contrail
controller
src
vnsw
agent
vrouter
ksync
vxlan_ksync.h
Generated by
1.9.1