OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ksync_vxlan_bridge.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 #include <cmn/agent_cmn.h>
5 
6 #include <ksync/ksync_index.h>
7 #include <ksync/ksync_entry.h>
8 #include <ksync/ksync_object.h>
9 
10 #include <vnc_cfg_types.h>
11 #include <bgp_schema_types.h>
12 #include <agent_types.h>
13 
14 #include <oper/peer.h>
15 #include <oper/vrf.h>
16 #include <oper/interface_common.h>
17 #include <oper/nexthop.h>
18 #include <oper/multicast.h>
19 #include <oper/vn.h>
20 #include <oper/mirror_table.h>
21 #include <oper/vxlan.h>
22 #include <oper/mpls.h>
23 #include <oper/route_common.h>
24 #include <oper/bridge_route.h>
25 
26 #include "ksync_vxlan.h"
27 #include "ksync_vxlan_bridge.h"
28 #include "ksync_vxlan_port.h"
29 #include "ksync_vxlan_route.h"
30 
32  const KSyncVxlanBridgeEntry *entry):
33  KSyncDBEntry(), vxlan_id_(entry->vxlan_id_), ksync_obj_(obj) {
34 }
35 
37  const VxLanId *vxlan) :
38  KSyncDBEntry(), vxlan_id_(vxlan->vxlan_id()), ksync_obj_(obj) {
39 }
40 
42 }
43 
45  return ksync_obj_;
46 }
47 
48 bool KSyncVxlanBridgeEntry::IsLess(const KSyncEntry &rhs) const {
49  const KSyncVxlanBridgeEntry &entry = static_cast
50  <const KSyncVxlanBridgeEntry &>(rhs);
51  return vxlan_id_ < entry.vxlan_id_;
52 }
53 
54 std::string KSyncVxlanBridgeEntry::ToString() const {
55  std::stringstream s;
56  s << "Vxlan-ID : " << vxlan_id_;
57  return s.str();
58 }
59 
61  return false;
62 }
63 
65  return nullptr;
66 }
67 
69  KSyncDBObject("KSyncVxlanBridgeObject"), ksync_(ksync) {
70 }
71 
73 }
74 
77 }
78 
80  VxLanId vxlan(0);
81  KSyncEntry *key = DBToKSyncEntry(&vxlan);
83  return;
84 }
85 
87 }
void RegisterDb(DBTableBase *table)
KSyncDBObject * GetObject() const
Definition: vxlan.h:14
virtual KSyncEntry * DBToKSyncEntry(const DBEntry *e)=0
KSyncVxlanBridgeObject * ksync_obj_
virtual bool Sync(DBEntry *e)
virtual std::string ToString() const
KSyncEntry * GetReference(const KSyncEntry *key)
KSyncVxlanBridgeObject(KSyncVxlan *ksync)
Agent * agent() const
Definition: ksync_vxlan.h:48
VxLanTable * vxlan_table() const
Definition: agent.h:535
static void set_defer_entry(KSyncEntry *entry)
Definition: ksync_vxlan.cc:68
KSyncVxlanBridgeEntry(KSyncVxlanBridgeObject *obj, const KSyncVxlanBridgeEntry *entry)
virtual KSyncEntry * UnresolvedReference()
virtual bool IsLess(const KSyncEntry &rhs) const