blob: 60f92524b566ee5495c34fdf5af23c997b0b1142 [file] [log] [blame]
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "shill/control_netlink_attribute.h"
#include <netlink/attr.h>
#include "shill/logging.h"
namespace shill {
const int ControlAttributeFamilyId::kName = CTRL_ATTR_FAMILY_ID;
const char ControlAttributeFamilyId::kNameString[] = "CTRL_ATTR_FAMILY_ID";
const int ControlAttributeFamilyName::kName = CTRL_ATTR_FAMILY_NAME;
const char ControlAttributeFamilyName::kNameString[] = "CTRL_ATTR_FAMILY_NAME";
const int ControlAttributeVersion::kName = CTRL_ATTR_VERSION;
const char ControlAttributeVersion::kNameString[] = "CTRL_ATTR_VERSION";
const int ControlAttributeHdrSize::kName = CTRL_ATTR_HDRSIZE;
const char ControlAttributeHdrSize::kNameString[] = "CTRL_ATTR_HDRSIZE";
const int ControlAttributeMaxAttr::kName = CTRL_ATTR_MAXATTR;
const char ControlAttributeMaxAttr::kNameString[] = "CTRL_ATTR_MAXATTR";
const int ControlAttributeAttrOps::kName = CTRL_ATTR_OPS;
const char ControlAttributeAttrOps::kNameString[] = "CTRL_ATTR_OPS";
ControlAttributeAttrOps::ControlAttributeAttrOps()
: NetlinkNestedAttribute(kName, kNameString) {
NestedData array(NLA_NESTED, "FIRST", true);
array.deeper_nesting.push_back(
NestedData(NLA_U32, "CTRL_ATTR_OP_UNSPEC", false));
array.deeper_nesting.push_back(
NestedData(NLA_U32, "CTRL_ATTR_OP_ID", false));
array.deeper_nesting.push_back(
NestedData(NLA_U32, "CTRL_ATTR_OP_FLAGS", false));
nested_template_.push_back(array);
}
const int ControlAttributeMcastGroups::kName = CTRL_ATTR_MCAST_GROUPS;
const char ControlAttributeMcastGroups::kNameString[] =
"CTRL_ATTR_MCAST_GROUPS";
ControlAttributeMcastGroups::ControlAttributeMcastGroups()
: NetlinkNestedAttribute(kName, kNameString) {
NestedData array(NLA_NESTED, "FIRST", true);
array.deeper_nesting.push_back(
NestedData(NLA_U32, "CTRL_ATTR_MCAST_GRP_UNSPEC", false));
array.deeper_nesting.push_back(
NestedData(NLA_STRING, "CTRL_ATTR_MCAST_GRP_NAME", false));
array.deeper_nesting.push_back(
NestedData(NLA_U32, "CTRL_ATTR_MCAST_GRP_ID", false));
nested_template_.push_back(array);
}
} // namespace shill