OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
global_qos_config.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #include <cmn/agent.h>
6 #include <bind/bind_resolver.h>
7 #include <vnc_cfg_types.h>
8 #include <oper_db.h>
9 #include <forwarding_class.h>
10 #include <global_qos_config.h>
11 #include <config_manager.h>
12 
14 }
15 
17 }
18 
20  if (control_dscp_ != kInvalidDscp) {
21  if (control_dscp_ != 0) {
22  agent()->SetXmppDscp(0);
23  }
25  }
26  if (dns_dscp_ != kInvalidDscp) {
27  if (dns_dscp_ != 0) {
28  SetDnsDscp(0);
29  }
31  }
33  if (analytics_dscp_ != 0) {
35  }
37  }
38 }
39 
40 void GlobalQosConfig::SetDnsDscp(uint8_t value) {
42  if (resolver) {
43  resolver->SetDscpValue(value);
44  }
45 }
46 
48  if (node->IsDeleted()) {
49  ResetDscp();
50  }
51 }
52 
54  autogen::GlobalQosConfig *cfg =
55  static_cast<autogen::GlobalQosConfig *>(node->GetObject());
56  if (cfg &&
57  cfg->IsPropertySet(autogen::GlobalQosConfig::CONTROL_TRAFFIC_DSCP)) {
58  const autogen::ControlTrafficDscpType &dscp =
59  cfg->control_traffic_dscp();
60  if (control_dscp_ != dscp.control) {
61  control_dscp_ = dscp.control;
63  }
64  if (dns_dscp_ != dscp.dns) {
65  dns_dscp_ = dscp.dns;
67  }
68  if (analytics_dscp_ != dscp.analytics) {
69  analytics_dscp_ = dscp.analytics;
71  }
72  } else {
73  ResetDscp();
74  }
75 }
76 
79 }
static const uint8_t kInvalidDscp
Agent * agent() const
Definition: oper_db.h:245
void ConfigManagerEnqueue(IFMapNode *node)
GlobalQosConfig(IFMapNode *node)
Definition: dns_oper.cc:716
bool IsDeleted() const
Definition: db_entry.h:49
ConfigManager * config_manager() const
Definition: agent.cc:889
uint8_t control_dscp_
Definition: dns_oper.h:239
void AddGlobalQosConfigNode(IFMapNode *node)
static void SetDscpValue(uint8_t value)
Definition: sandesh.cc:334
void SetDscpValue(uint8_t val)
uint8_t analytics_dscp_
Definition: dns_oper.h:240
void ConfigDelete(IFMapNode *node)
Definition: agent.h:358
void SetDnsDscp(uint8_t value)
static BindResolver * Resolver()
Definition: bind_resolver.h:43
void SetXmppDscp(uint8_t val)
Definition: agent.cc:1144
void ConfigAddChange(IFMapNode *node)
IFMapObject * GetObject()
Definition: ifmap_node.cc:63