OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vxlan_ksync.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef vnsw_agent_vxlan_ksync_h
6 #define vnsw_agent_vxlan_ksync_h
7 
8 #include <boost/asio.hpp>
9 #include <boost/bind.hpp>
10 
11 #include <db/db_entry.h>
12 #include <db/db_table.h>
13 #include <db/db_table_partition.h>
14 #include <ksync/ksync_entry.h>
15 #include <ksync/ksync_object.h>
16 #include <ksync/ksync_netlink.h>
17 #include "oper/nexthop.h"
18 #include "oper/vxlan.h"
19 #include "vrouter/ksync/agent_ksync_types.h"
20 
21 class VxLanKSyncObject;
22 
24 public:
26  uint32_t index);
27  VxLanIdKSyncEntry(VxLanKSyncObject *obj, const VxLanId *label);
28  virtual ~VxLanIdKSyncEntry();
29 
30  NHKSyncEntry *nh() const {
31  return static_cast<NHKSyncEntry *>(nh_.get());
32  }
33  KSyncDBObject *GetObject() const;
34 
35  virtual bool IsLess(const KSyncEntry &rhs) const;
36  virtual std::string ToString() const;
38  virtual bool Sync(DBEntry *e);
39  virtual int AddMsg(char *buf, int buf_len);
40  virtual int ChangeMsg(char *buf, int buf_len);
41  virtual int DeleteMsg(char *buf, int buf_len);
42  void FillObjectLog(sandesh_op::type op, KSyncVxLanInfo &info) const;
43 private:
44  int Encode(sandesh_op::type op, char *buf, int buf_len);
46  uint32_t label_;
49 };
50 
52 public:
53  static const int kVxLanIndexCount = 10000;
55  virtual ~VxLanKSyncObject();
56  KSync *ksync() const { return ksync_; }
57  virtual KSyncEntry *Alloc(const KSyncEntry *entry, uint32_t index);
58  virtual KSyncEntry *DBToKSyncEntry(const DBEntry *e);
59  void RegisterDBClients();
60 private:
63 };
64 
65 #endif // vnsw_agent_vxlan_ksync_h
virtual int DeleteMsg(char *buf, int buf_len)
Definition: vxlan_ksync.cc:134
VxLanIdKSyncEntry(VxLanKSyncObject *obj, const VxLanIdKSyncEntry *entry, uint32_t index)
Definition: vxlan_ksync.cc:29
DISALLOW_COPY_AND_ASSIGN(VxLanIdKSyncEntry)
virtual int ChangeMsg(char *buf, int buf_len)
Definition: vxlan_ksync.cc:126
static const int kVxLanIndexCount
Definition: vxlan_ksync.h:53
virtual KSyncEntry * UnresolvedReference()
Definition: vxlan_ksync.cc:142
virtual bool IsLess(const KSyncEntry &rhs) const
Definition: vxlan_ksync.cc:49
virtual ~VxLanKSyncObject()
Definition: vxlan_ksync.cc:154
void FillObjectLog(sandesh_op::type op, KSyncVxLanInfo &info) const
Definition: vxlan_ksync.cc:106
Definition: vxlan.h:14
int Encode(sandesh_op::type op, char *buf, int buf_len)
Definition: vxlan_ksync.cc:90
DISALLOW_COPY_AND_ASSIGN(VxLanKSyncObject)
KSyncEntryPtr nh_
Definition: vxlan_ksync.h:47
uint8_t type
Definition: load_balance.h:109
virtual bool Sync(DBEntry *e)
Definition: vxlan_ksync.cc:70
VxLanKSyncObject * ksync_obj_
Definition: vxlan_ksync.h:45
boost::intrusive_ptr< KSyncEntry > KSyncEntryPtr
Definition: ksync_entry.h:68
virtual std::string ToString() const
Definition: vxlan_ksync.cc:56
KSyncDBObject * GetObject() const
Definition: vxlan_ksync.cc:45
KSync * ksync() const
Definition: vxlan_ksync.h:56
virtual ~VxLanIdKSyncEntry()
Definition: vxlan_ksync.cc:42
NHKSyncEntry * nh() const
Definition: vxlan_ksync.h:30
virtual KSyncEntry * DBToKSyncEntry(const DBEntry *e)
Definition: vxlan_ksync.cc:168
VxLanKSyncObject(KSync *ksync)
Definition: vxlan_ksync.cc:150
virtual KSyncEntry * Alloc(const KSyncEntry *entry, uint32_t index)
Definition: vxlan_ksync.cc:161
virtual int AddMsg(char *buf, int buf_len)
Definition: vxlan_ksync.cc:118
void RegisterDBClients()
Definition: vxlan_ksync.cc:157