/*
- * $Id$
- *
- * DEBUG: section 49 SNMP Interface
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
*
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
*/
-#include "config.h"
+/* DEBUG: section 49 SNMP Interface */
+
+#include "squid.h"
#include "base/TextException.h"
+#include "Debug.h"
#include "ipc/TypedMsgHdr.h"
-#include "protos.h"
#include "snmp/Var.h"
+#include "tools.h"
+#include <algorithm>
Snmp::Var::Var()
{
void
Snmp::Var::init()
{
- xmemset(this, 0, sizeof(*this));
+ memset(this, 0, sizeof(*this));
}
Snmp::Var&
Snmp::Var::operator += (const Var& var)
{
- switch(type)
- {
+ switch (type) {
case SMI_INTEGER:
setInt(asInt() + var.asInt());
break;
Snmp::Var::operator /= (int num)
{
Must(num != 0);
- switch(type)
- {
+ switch (type) {
case SMI_INTEGER:
setInt(asInt() / num);
break;
bool
Snmp::Var::operator < (const Var& var) const
{
- switch(type)
- {
+ switch (type) {
case SMI_INTEGER:
return asInt() < var.asInt();
case SMI_GAUGE32:
bool
Snmp::Var::operator > (const Var& var) const
{
- switch(type)
- {
+ switch (type) {
case SMI_INTEGER:
return asInt() > var.asInt();
case SMI_GAUGE32:
msg.getFixed(val.string, val_len);
}
}
+