Wade Guthrie | f162f8b | 2013-02-27 14:13:55 -0800 | [diff] [blame] | 1 | // 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 Guthrie | f162f8b | 2013-02-27 14:13:55 -0800 | [diff] [blame] | 10 | |
| 11 | namespace shill { |
| 12 | |
| 13 | const int ControlAttributeFamilyId::kName = CTRL_ATTR_FAMILY_ID; |
| 14 | const char ControlAttributeFamilyId::kNameString[] = "CTRL_ATTR_FAMILY_ID"; |
| 15 | |
| 16 | const int ControlAttributeFamilyName::kName = CTRL_ATTR_FAMILY_NAME; |
| 17 | const char ControlAttributeFamilyName::kNameString[] = "CTRL_ATTR_FAMILY_NAME"; |
| 18 | |
| 19 | const int ControlAttributeVersion::kName = CTRL_ATTR_VERSION; |
| 20 | const char ControlAttributeVersion::kNameString[] = "CTRL_ATTR_VERSION"; |
| 21 | |
| 22 | const int ControlAttributeHdrSize::kName = CTRL_ATTR_HDRSIZE; |
| 23 | const char ControlAttributeHdrSize::kNameString[] = "CTRL_ATTR_HDRSIZE"; |
| 24 | |
| 25 | const int ControlAttributeMaxAttr::kName = CTRL_ATTR_MAXATTR; |
| 26 | const char ControlAttributeMaxAttr::kNameString[] = "CTRL_ATTR_MAXATTR"; |
| 27 | |
| 28 | const int ControlAttributeAttrOps::kName = CTRL_ATTR_OPS; |
| 29 | const char ControlAttributeAttrOps::kNameString[] = "CTRL_ATTR_OPS"; |
| 30 | |
| 31 | ControlAttributeAttrOps::ControlAttributeAttrOps() |
Wade Guthrie | f1b3641 | 2013-04-11 14:51:31 -0700 | [diff] [blame] | 32 | : 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 Guthrie | f162f8b | 2013-02-27 14:13:55 -0800 | [diff] [blame] | 40 | |
Wade Guthrie | f1b3641 | 2013-04-11 14:51:31 -0700 | [diff] [blame] | 41 | nested_template_.push_back(array); |
Wade Guthrie | f162f8b | 2013-02-27 14:13:55 -0800 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | const int ControlAttributeMcastGroups::kName = CTRL_ATTR_MCAST_GROUPS; |
| 45 | const char ControlAttributeMcastGroups::kNameString[] = |
| 46 | "CTRL_ATTR_MCAST_GROUPS"; |
| 47 | |
| 48 | ControlAttributeMcastGroups::ControlAttributeMcastGroups() |
Wade Guthrie | f1b3641 | 2013-04-11 14:51:31 -0700 | [diff] [blame] | 49 | : 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 Guthrie | f162f8b | 2013-02-27 14:13:55 -0800 | [diff] [blame] | 57 | |
Wade Guthrie | f1b3641 | 2013-04-11 14:51:31 -0700 | [diff] [blame] | 58 | nested_template_.push_back(array); |
Wade Guthrie | f162f8b | 2013-02-27 14:13:55 -0800 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | } // namespace shill |