OpenSDN source code
qos_config_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_QOS_CONFIG_KSYNC_H__
7 #define __VNSW_AGENT_QOS_CONFIG_KSYNC_H__
8 
9 #include <db/db_entry.h>
10 #include <db/db_table.h>
11 #include <db/db_table_partition.h>
12 #include <ksync/ksync_entry.h>
13 #include <ksync/ksync_object.h>
14 #include <ksync/ksync_netlink.h>
15 #include "oper/qos_queue.h"
16 #include "oper/forwarding_class.h"
17 #include "oper/qos_config.h"
18 class KSync;
20 
22 public:
23  static const uint32_t kDefaultQosMsgSize = 4096;
24  typedef std::pair<uint32_t, KSyncEntryPtr> KSyncQosFcPair;
25  typedef std::map<uint32_t, KSyncEntryPtr> KSyncQosFcMap;
26 
28  const QosConfigKSyncEntry *entry);
30  const AgentQosConfig *qc);
31  virtual ~QosConfigKSyncEntry();
32 
33  KSyncDBObject *GetObject() const;
34  virtual bool IsLess(const KSyncEntry &rhs) const;
35  virtual std::string ToString() const;
37  virtual bool Sync(DBEntry *e);
38  virtual int AddMsg(char *buf, int buf_len);
39  virtual int ChangeMsg(char *buf, int buf_len);
40  virtual int DeleteMsg(char *buf, int buf_len);
41  boost::uuids::uuid uuid() const { return uuid_;}
42  uint32_t id() const { return id_;}
43  int MsgLen() { return kDefaultQosMsgSize; }
44 private:
45  bool CopyQosMap(KSyncQosFcMap &ksync_map,
47 
50  uint32_t id_;
55  int Encode(sandesh_op::type op, char *buf, int buf_len);
57 };
58 
60 public:
62  virtual ~QosConfigKSyncObject();
63  KSync *ksync() const { return ksync_; }
64  virtual KSyncEntry *Alloc(const KSyncEntry *entry, uint32_t index);
65  virtual KSyncEntry *DBToKSyncEntry(const DBEntry *e);
66  void RegisterDBClients();
67 private:
70 };
71 #endif
std::map< uint32_t, uint32_t > QosIdForwardingClassMap
Definition: qos_config.h:45
uint32_t default_forwarding_class_
bool CopyQosMap(KSyncQosFcMap &ksync_map, const AgentQosConfig::QosIdForwardingClassMap *map)
KSyncQosFcMap mpls_exp_map_
static const uint32_t kDefaultQosMsgSize
std::map< uint32_t, KSyncEntryPtr > KSyncQosFcMap
KSyncQosFcMap vlan_priority_map_
KSyncDBObject * GetObject() const
virtual bool Sync(DBEntry *e)
KSyncQosFcMap dscp_map_
int Encode(sandesh_op::type op, char *buf, int buf_len)
virtual int ChangeMsg(char *buf, int buf_len)
virtual bool IsLess(const KSyncEntry &rhs) const
virtual KSyncEntry * UnresolvedReference()
std::pair< uint32_t, KSyncEntryPtr > KSyncQosFcPair
virtual std::string ToString() const
QosConfigKSyncEntry(QosConfigKSyncObject *obj, const QosConfigKSyncEntry *entry)
uint32_t id() const
virtual ~QosConfigKSyncEntry()
boost::uuids::uuid uuid() const
boost::uuids::uuid uuid_
virtual int AddMsg(char *buf, int buf_len)
KSyncDBObject * ksync_obj_
virtual int DeleteMsg(char *buf, int buf_len)
DISALLOW_COPY_AND_ASSIGN(QosConfigKSyncEntry)
DISALLOW_COPY_AND_ASSIGN(QosConfigKSyncObject)
virtual KSyncEntry * Alloc(const KSyncEntry *entry, uint32_t index)
KSync * ksync() const
virtual KSyncEntry * DBToKSyncEntry(const DBEntry *e)
QosConfigKSyncObject(KSync *ksync)
uint8_t type
Definition: load_balance.h:2
boost::uuids::uuid uuid