OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
qos_config_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_QOS_CONFIG_KSYNC_H__
6 #define __VNSW_AGENT_QOS_CONFIG_KSYNC_H__
7 
8 #include <db/db_entry.h>
9 #include <db/db_table.h>
10 #include <db/db_table_partition.h>
11 #include <ksync/ksync_entry.h>
12 #include <ksync/ksync_object.h>
13 #include <ksync/ksync_netlink.h>
14 #include "oper/qos_queue.h"
15 #include "oper/forwarding_class.h"
16 #include "oper/qos_config.h"
17 class KSync;
19 
21 public:
22  static const uint32_t kDefaultQosMsgSize = 4096;
23  typedef std::pair<uint32_t, KSyncEntryPtr> KSyncQosFcPair;
24  typedef std::map<uint32_t, KSyncEntryPtr> KSyncQosFcMap;
25 
27  const QosConfigKSyncEntry *entry);
29  const AgentQosConfig *qc);
30  virtual ~QosConfigKSyncEntry();
31 
32  KSyncDBObject *GetObject() const;
33  virtual bool IsLess(const KSyncEntry &rhs) const;
34  virtual std::string ToString() const;
36  virtual bool Sync(DBEntry *e);
37  virtual int AddMsg(char *buf, int buf_len);
38  virtual int ChangeMsg(char *buf, int buf_len);
39  virtual int DeleteMsg(char *buf, int buf_len);
40  boost::uuids::uuid uuid() const { return uuid_;}
41  uint32_t id() const { return id_;}
42  int MsgLen() { return kDefaultQosMsgSize; }
43 private:
44  bool CopyQosMap(KSyncQosFcMap &ksync_map,
46 
49  uint32_t id_;
54  int Encode(sandesh_op::type op, char *buf, int buf_len);
56 };
57 
59 public:
61  virtual ~QosConfigKSyncObject();
62  KSync *ksync() const { return ksync_; }
63  virtual KSyncEntry *Alloc(const KSyncEntry *entry, uint32_t index);
64  virtual KSyncEntry *DBToKSyncEntry(const DBEntry *e);
65  void RegisterDBClients();
66 private:
69 };
70 #endif
virtual bool Sync(DBEntry *e)
KSyncQosFcMap vlan_priority_map_
QosConfigKSyncEntry(QosConfigKSyncObject *obj, const QosConfigKSyncEntry *entry)
virtual KSyncEntry * DBToKSyncEntry(const DBEntry *e)
bool CopyQosMap(KSyncQosFcMap &ksync_map, const AgentQosConfig::QosIdForwardingClassMap *map)
KSync * ksync() const
KSyncQosFcMap dscp_map_
uint32_t default_forwarding_class_
static const uint32_t kDefaultQosMsgSize
boost::uuids::uuid uuid
virtual int ChangeMsg(char *buf, int buf_len)
DISALLOW_COPY_AND_ASSIGN(QosConfigKSyncObject)
boost::uuids::uuid uuid_
QosConfigKSyncObject(KSync *ksync)
uint8_t type
Definition: load_balance.h:109
boost::uuids::uuid uuid() const
int Encode(sandesh_op::type op, char *buf, int buf_len)
DISALLOW_COPY_AND_ASSIGN(QosConfigKSyncEntry)
virtual KSyncEntry * Alloc(const KSyncEntry *entry, uint32_t index)
virtual ~QosConfigKSyncEntry()
virtual bool IsLess(const KSyncEntry &rhs) const
std::pair< uint32_t, KSyncEntryPtr > KSyncQosFcPair
KSyncDBObject * GetObject() const
KSyncQosFcMap mpls_exp_map_
virtual int AddMsg(char *buf, int buf_len)
virtual int DeleteMsg(char *buf, int buf_len)
KSyncDBObject * ksync_obj_
uint32_t id() const
virtual std::string ToString() const
std::map< uint32_t, KSyncEntryPtr > KSyncQosFcMap
virtual KSyncEntry * UnresolvedReference()
std::map< uint32_t, uint32_t > QosIdForwardingClassMap
Definition: qos_config.h:44