-
Notifications
You must be signed in to change notification settings - Fork 390
/
vn_ovsdb.h
59 lines (47 loc) · 1.67 KB
/
vn_ovsdb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/
#ifndef SRC_VNSW_AGENT_OVS_TOR_AGENT_OVSDB_CLIENT_VN_OVSDB_H_
#define SRC_VNSW_AGENT_OVS_TOR_AGENT_OVSDB_CLIENT_VN_OVSDB_H_
#include <ovsdb_entry.h>
#include <ovsdb_object.h>
class VnEntry;
namespace OVSDB {
class VnOvsdbObject : public OvsdbDBObject {
public:
VnOvsdbObject(OvsdbClientIdl *idl, DBTable *table);
virtual ~VnOvsdbObject();
void OvsdbNotify(OvsdbClientIdl::Op, struct ovsdb_idl_row*);
KSyncEntry *Alloc(const KSyncEntry *key, uint32_t index);
KSyncEntry *DBToKSyncEntry(const DBEntry*);
OvsdbDBEntry* AllocOvsEntry(struct ovsdb_idl_row*);
DBFilterResp OvsdbDBEntryFilter(const DBEntry *entry);
private:
DISALLOW_COPY_AND_ASSIGN(VnOvsdbObject);
};
class VnOvsdbEntry : public OvsdbDBEntry {
public:
VnOvsdbEntry(VnOvsdbObject *table, const boost::uuids::uuid &uuid);
// ovs_entry ref is not valid for VN, override IsDataResolved
// to return always true
bool IsDataResolved() {return true;}
void AddMsg(struct ovsdb_idl_txn *);
void ChangeMsg(struct ovsdb_idl_txn *);
void DeleteMsg(struct ovsdb_idl_txn *);
bool Sync(DBEntry*);
bool IsLess(const KSyncEntry&) const;
std::string ToString() const {return "Virtual Network Ksync";}
KSyncEntry* UnresolvedReference();
VrfEntry *vrf();
uint32_t vxlan_id() { return vxlan_id_; }
const std::string &name() { return name_; }
private:
friend class VnOvsdbObject;
boost::uuids::uuid uuid_;
VrfEntryRef vrf_;
uint32_t vxlan_id_;
std::string name_;
DISALLOW_COPY_AND_ASSIGN(VnOvsdbEntry);
};
};
#endif //SRC_VNSW_AGENT_OVS_TOR_AGENT_OVSDB_CLIENT_VN_OVSDB_H_