blob: 60f92524b566ee5495c34fdf5af23c997b0b1142 [file] [log] [blame]
Wade Guthrief162f8b2013-02-27 14:13:55 -08001// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "shill/control_netlink_attribute.h"
6
7#include <netlink/attr.h>
8
9#include "shill/logging.h"
Wade Guthrief162f8b2013-02-27 14:13:55 -080010
11namespace shill {
12
13const int ControlAttributeFamilyId::kName = CTRL_ATTR_FAMILY_ID;
14const char ControlAttributeFamilyId::kNameString[] = "CTRL_ATTR_FAMILY_ID";
15
16const int ControlAttributeFamilyName::kName = CTRL_ATTR_FAMILY_NAME;
17const char ControlAttributeFamilyName::kNameString[] = "CTRL_ATTR_FAMILY_NAME";
18
19const int ControlAttributeVersion::kName = CTRL_ATTR_VERSION;
20const char ControlAttributeVersion::kNameString[] = "CTRL_ATTR_VERSION";
21
22const int ControlAttributeHdrSize::kName = CTRL_ATTR_HDRSIZE;
23const char ControlAttributeHdrSize::kNameString[] = "CTRL_ATTR_HDRSIZE";
24
25const int ControlAttributeMaxAttr::kName = CTRL_ATTR_MAXATTR;
26const char ControlAttributeMaxAttr::kNameString[] = "CTRL_ATTR_MAXATTR";
27
28const int ControlAttributeAttrOps::kName = CTRL_ATTR_OPS;
29const char ControlAttributeAttrOps::kNameString[] = "CTRL_ATTR_OPS";
30
31ControlAttributeAttrOps::ControlAttributeAttrOps()
Wade Guthrief1b36412013-04-11 14:51:31 -070032 : NetlinkNestedAttribute(kName, kNameString) {
33 NestedData array(NLA_NESTED, "FIRST", true);
34 array.deeper_nesting.push_back(
35 NestedData(NLA_U32, "CTRL_ATTR_OP_UNSPEC", false));
36 array.deeper_nesting.push_back(
37 NestedData(NLA_U32, "CTRL_ATTR_OP_ID", false));
38 array.deeper_nesting.push_back(
39 NestedData(NLA_U32, "CTRL_ATTR_OP_FLAGS", false));
Wade Guthrief162f8b2013-02-27 14:13:55 -080040
Wade Guthrief1b36412013-04-11 14:51:31 -070041 nested_template_.push_back(array);
Wade Guthrief162f8b2013-02-27 14:13:55 -080042}
43
44const int ControlAttributeMcastGroups::kName = CTRL_ATTR_MCAST_GROUPS;
45const char ControlAttributeMcastGroups::kNameString[] =
46 "CTRL_ATTR_MCAST_GROUPS";
47
48ControlAttributeMcastGroups::ControlAttributeMcastGroups()
Wade Guthrief1b36412013-04-11 14:51:31 -070049 : NetlinkNestedAttribute(kName, kNameString) {
50 NestedData array(NLA_NESTED, "FIRST", true);
51 array.deeper_nesting.push_back(
52 NestedData(NLA_U32, "CTRL_ATTR_MCAST_GRP_UNSPEC", false));
53 array.deeper_nesting.push_back(
54 NestedData(NLA_STRING, "CTRL_ATTR_MCAST_GRP_NAME", false));
55 array.deeper_nesting.push_back(
56 NestedData(NLA_U32, "CTRL_ATTR_MCAST_GRP_ID", false));
Wade Guthrief162f8b2013-02-27 14:13:55 -080057
Wade Guthrief1b36412013-04-11 14:51:31 -070058 nested_template_.push_back(array);
Wade Guthrief162f8b2013-02-27 14:13:55 -080059}
60
61} // namespace shill