OpenSDN source code
global_qos_config.cc
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 #include <cmn/agent.h>
7 #include <bind/bind_resolver.h>
8 #include <vnc_cfg_types.h>
9 #include <oper_db.h>
10 #include <forwarding_class.h>
11 #include <global_qos_config.h>
12 #include <config_manager.h>
13 
15 }
16 
18 }
19 
21  if (control_dscp_ != kInvalidDscp) {
22  if (control_dscp_ != 0) {
23  agent()->SetXmppDscp(0);
24  }
26  }
27  if (dns_dscp_ != kInvalidDscp) {
28  if (dns_dscp_ != 0) {
29  SetDnsDscp(0);
30  }
32  }
34  if (analytics_dscp_ != 0) {
36  }
38  }
39 }
40 
41 void GlobalQosConfig::SetDnsDscp(uint8_t value) {
43  if (resolver) {
44  resolver->SetDscpValue(value);
45  }
46 }
47 
49  if (node->IsDeleted()) {
50  ResetDscp();
51  }
52 }
53 
55  autogen::GlobalQosConfig *cfg =
56  static_cast<autogen::GlobalQosConfig *>(node->GetObject());
57  if (cfg &&
58  cfg->IsPropertySet(autogen::GlobalQosConfig::CONTROL_TRAFFIC_DSCP)) {
59  const autogen::ControlTrafficDscpType &dscp =
60  cfg->control_traffic_dscp();
61  if (control_dscp_ != dscp.control) {
62  control_dscp_ = dscp.control;
64  }
65  if (dns_dscp_ != dscp.dns) {
66  dns_dscp_ = dscp.dns;
68  }
69  if (analytics_dscp_ != dscp.analytics) {
70  analytics_dscp_ = dscp.analytics;
72  }
73  } else {
74  ResetDscp();
75  }
76 }
77 
80 }
Definition: agent.h:361
ConfigManager * config_manager() const
Definition: agent.cc:893
void SetXmppDscp(uint8_t val)
Definition: agent.cc:1157
static BindResolver * Resolver()
Definition: bind_resolver.h:44
void SetDscpValue(uint8_t val)
void AddGlobalQosConfigNode(IFMapNode *node)
bool IsDeleted() const
Definition: db_entry.h:49
IFMapObject * GetObject()
Definition: ifmap_node.cc:64
Agent * agent() const
Definition: oper_db.h:246
static void SetDscpValue(uint8_t value)
Definition: sandesh.cc:336
static const uint8_t kInvalidDscp
void SetDnsDscp(uint8_t value)
uint8_t analytics_dscp_
Definition: dns_oper.h:241
GlobalQosConfig(IFMapNode *node)
Definition: dns_oper.cc:719
void ConfigAddChange(IFMapNode *node)
void ConfigManagerEnqueue(IFMapNode *node)
uint8_t control_dscp_
Definition: dns_oper.h:240
void ConfigDelete(IFMapNode *node)