blob: befeb8a5a9e1ea103b8dfcaf83c36f1732502371 [file] [log] [blame]
//
// Copyright (C) 2014 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "shill/wifi/wake_on_wifi.h"
#include <linux/nl80211.h>
#include <memory>
#include <set>
#include <string>
#include <base/message_loop/message_loop.h>
#include <chromeos/dbus/service_constants.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "shill/error.h"
#include "shill/event_dispatcher.h"
#include "shill/ip_address_store.h"
#include "shill/logging.h"
#include "shill/mock_event_dispatcher.h"
#include "shill/mock_log.h"
#include "shill/mock_metrics.h"
#include "shill/net/byte_string.h"
#include "shill/net/ip_address.h"
#include "shill/net/mock_netlink_manager.h"
#include "shill/net/mock_time.h"
#include "shill/net/netlink_message_matchers.h"
#include "shill/net/netlink_packet.h"
#include "shill/net/nl80211_message.h"
#include "shill/net/shill_time.h"
#include "shill/nice_mock_control.h"
#include "shill/test_event_dispatcher.h"
#include "shill/testing.h"
using base::Bind;
using base::Closure;
using base::Unretained;
using std::list;
using std::set;
using std::string;
using std::vector;
using testing::_;
using ::testing::AnyNumber;
using ::testing::HasSubstr;
using ::testing::Return;
namespace shill {
namespace {
const uint16_t kNl80211FamilyId = 0x13;
const uint8_t kSSIDBytes1[] = {0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x47, 0x75, 0x65, 0x73, 0x74};
// Bytes representing a NL80211_CMD_SET_WOWLAN reporting that the system woke
// up because of an SSID match. The net detect results report a single SSID
// match represented by kSSIDBytes1, occurring in the frequencies in
// kSSID1FreqMatches.
const uint8_t kWakeReasonSSIDNlMsg[] = {
0x90, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4a, 0x01, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x99, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, 0x02, 0x00, 0x00, 0x00,
0x60, 0x00, 0x75, 0x00, 0x5c, 0x00, 0x13, 0x00, 0x58, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x34, 0x00, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x47, 0x75,
0x65, 0x73, 0x74, 0x00, 0x44, 0x00, 0x2c, 0x00, 0x08, 0x00, 0x00, 0x00,
0x6c, 0x09, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x85, 0x09, 0x00, 0x00,
0x08, 0x00, 0x02, 0x00, 0x9e, 0x09, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00,
0x3c, 0x14, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x78, 0x14, 0x00, 0x00,
0x08, 0x00, 0x05, 0x00, 0x71, 0x16, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00,
0xad, 0x16, 0x00, 0x00, 0x08, 0x00, 0x07, 0x00, 0xc1, 0x16, 0x00, 0x00};
const uint32_t kTimeToNextLeaseRenewalShort = 1;
const uint32_t kTimeToNextLeaseRenewalLong = 1000;
const uint32_t kNetDetectScanIntervalSeconds = 120;
// These blobs represent NL80211 messages from the kernel reporting the NIC's
// wake-on-packet settings, sent in response to NL80211_CMD_GET_WOWLAN requests.
const uint8_t kResponseNoIPAddresses[] = {
0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x00, 0x01, 0x00,
0x00, 0x00, 0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00};
const uint8_t kResponseIPV40[] = {
0x4C, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
0x00, 0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x38, 0x00,
0x75, 0x00, 0x34, 0x00, 0x04, 0x00, 0x30, 0x00, 0x01, 0x00, 0x08,
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xC0, 0xA8, 0x0A, 0x14, 0x00, 0x00};
const uint8_t kResponseIPV40WakeOnDisconnect[] = {
0x50, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x3C, 0x00, 0x75, 0x00,
0x04, 0x00, 0x02, 0x00, 0x34, 0x00, 0x04, 0x00, 0x30, 0x00, 0x01, 0x00,
0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC0, 0xA8, 0x0A, 0x14, 0x00, 0x00};
const uint8_t kResponseIPV401[] = {
0x7C, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x68, 0x00, 0x75, 0x00,
0x64, 0x00, 0x04, 0x00, 0x30, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
0x03, 0x04, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xA8,
0x0A, 0x14, 0x00, 0x00};
const uint8_t kResponseIPV401IPV60[] = {
0xB8, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0xA4, 0x00, 0x75, 0x00,
0xA0, 0x00, 0x04, 0x00, 0x30, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
0x03, 0x04, 0x00, 0x00, 0x30, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xA8,
0x0A, 0x14, 0x00, 0x00, 0x3C, 0x00, 0x03, 0x00, 0x09, 0x00, 0x01, 0x00,
0x00, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xDC,
0xBA, 0x98, 0x76, 0x54, 0x32, 0x10, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54,
0x32, 0x10, 0x00, 0x00};
const uint8_t kResponseIPV401IPV601[] = {
0xF4, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0xE0, 0x00, 0x75, 0x00,
0xDC, 0x00, 0x04, 0x00, 0x30, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02,
0x03, 0x04, 0x00, 0x00, 0x3C, 0x00, 0x02, 0x00, 0x09, 0x00, 0x01, 0x00,
0x00, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x20, 0x0C,
0x41, 0x7A, 0x00, 0x00, 0x30, 0x00, 0x03, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x22, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xA8,
0x0A, 0x14, 0x00, 0x00, 0x3C, 0x00, 0x04, 0x00, 0x09, 0x00, 0x01, 0x00,
0x00, 0x00, 0xC0, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xDC,
0xBA, 0x98, 0x76, 0x54, 0x32, 0x10, 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54,
0x32, 0x10, 0x00, 0x00};
// This blob represents an NL80211 messages from the kernel reporting that the
// NIC is programmed to wake on the SSIDs represented by kSSIDBytes1 and
// kSSIDBytes2, and scans for these SSIDs at interval
// kNetDetectScanIntervalSeconds.
const uint8_t kResponseWakeOnSSID[] = {
0x60, 0x01, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x9a, 0x01, 0x00, 0x00,
0xfa, 0x02, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00, 0x4c, 0x01, 0x75, 0x00,
0x48, 0x01, 0x12, 0x00, 0x08, 0x00, 0x77, 0x00, 0xc0, 0xd4, 0x01, 0x00,
0x0c, 0x01, 0x2c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x6c, 0x09, 0x00, 0x00,
0x08, 0x00, 0x01, 0x00, 0x71, 0x09, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00,
0x76, 0x09, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, 0x7b, 0x09, 0x00, 0x00,
0x08, 0x00, 0x04, 0x00, 0x80, 0x09, 0x00, 0x00, 0x08, 0x00, 0x05, 0x00,
0x85, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x8a, 0x09, 0x00, 0x00,
0x08, 0x00, 0x07, 0x00, 0x8f, 0x09, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00,
0x94, 0x09, 0x00, 0x00, 0x08, 0x00, 0x09, 0x00, 0x99, 0x09, 0x00, 0x00,
0x08, 0x00, 0x0a, 0x00, 0x9e, 0x09, 0x00, 0x00, 0x08, 0x00, 0x0b, 0x00,
0x3c, 0x14, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x50, 0x14, 0x00, 0x00,
0x08, 0x00, 0x0d, 0x00, 0x64, 0x14, 0x00, 0x00, 0x08, 0x00, 0x0e, 0x00,
0x78, 0x14, 0x00, 0x00, 0x08, 0x00, 0x0f, 0x00, 0x8c, 0x14, 0x00, 0x00,
0x08, 0x00, 0x10, 0x00, 0xa0, 0x14, 0x00, 0x00, 0x08, 0x00, 0x11, 0x00,
0xb4, 0x14, 0x00, 0x00, 0x08, 0x00, 0x12, 0x00, 0xc8, 0x14, 0x00, 0x00,
0x08, 0x00, 0x13, 0x00, 0x7c, 0x15, 0x00, 0x00, 0x08, 0x00, 0x14, 0x00,
0x90, 0x15, 0x00, 0x00, 0x08, 0x00, 0x15, 0x00, 0xa4, 0x15, 0x00, 0x00,
0x08, 0x00, 0x16, 0x00, 0xb8, 0x15, 0x00, 0x00, 0x08, 0x00, 0x17, 0x00,
0xcc, 0x15, 0x00, 0x00, 0x08, 0x00, 0x18, 0x00, 0x1c, 0x16, 0x00, 0x00,
0x08, 0x00, 0x19, 0x00, 0x30, 0x16, 0x00, 0x00, 0x08, 0x00, 0x1a, 0x00,
0x44, 0x16, 0x00, 0x00, 0x08, 0x00, 0x1b, 0x00, 0x58, 0x16, 0x00, 0x00,
0x08, 0x00, 0x1c, 0x00, 0x71, 0x16, 0x00, 0x00, 0x08, 0x00, 0x1d, 0x00,
0x85, 0x16, 0x00, 0x00, 0x08, 0x00, 0x1e, 0x00, 0x99, 0x16, 0x00, 0x00,
0x08, 0x00, 0x1f, 0x00, 0xad, 0x16, 0x00, 0x00, 0x08, 0x00, 0x20, 0x00,
0xc1, 0x16, 0x00, 0x00, 0x30, 0x00, 0x84, 0x00, 0x14, 0x00, 0x00, 0x00,
0x0f, 0x00, 0x01, 0x00, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x47, 0x75,
0x65, 0x73, 0x74, 0x00, 0x18, 0x00, 0x01, 0x00, 0x12, 0x00, 0x01, 0x00,
0x54, 0x50, 0x2d, 0x4c, 0x49, 0x4e, 0x4b, 0x5f, 0x38, 0x37, 0x36, 0x44,
0x33, 0x35, 0x00, 0x00};
const uint8_t kSSIDBytes2[] = {0x54, 0x50, 0x2d, 0x4c, 0x49, 0x4e, 0x4b,
0x5f, 0x38, 0x37, 0x36, 0x44, 0x33, 0x35};
// Bytes representing a NL80211_CMD_NEW_WIPHY message reporting the WiFi
// capabilities of a NIC. This message reports that the NIC supports wake on
// pattern (on up to |kNewWiphyNlMsg_MaxPatterns| registered patterns), supports
// wake on SSID (on up to |kNewWiphyNlMsg_MaxSSIDs| SSIDs), and supports wake on
// disconnect.
const uint8_t kNewWiphyNlMsg[] = {
0xb8, 0x0d, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0xd9, 0x53, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00,
0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x02, 0x00, 0x70, 0x68, 0x79, 0x30,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x2e, 0x00, 0x01, 0x00, 0x00, 0x00,
0x05, 0x00, 0x3d, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x3e, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x3f, 0x00, 0xff, 0xff, 0xff, 0xff,
0x08, 0x00, 0x40, 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x59, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x2b, 0x00, 0x14, 0x00, 0x00, 0x00,
0x05, 0x00, 0x7b, 0x00, 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x38, 0x00,
0xa9, 0x01, 0x00, 0x00, 0x06, 0x00, 0x7c, 0x00, 0xe6, 0x01, 0x00, 0x00,
0x05, 0x00, 0x85, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x04, 0x00, 0x68, 0x00,
0x04, 0x00, 0x82, 0x00, 0x1c, 0x00, 0x39, 0x00, 0x04, 0xac, 0x0f, 0x00,
0x02, 0xac, 0x0f, 0x00, 0x01, 0xac, 0x0f, 0x00, 0x05, 0xac, 0x0f, 0x00,
0x06, 0xac, 0x0f, 0x00, 0x01, 0x72, 0x14, 0x00, 0x05, 0x00, 0x56, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x66, 0x00, 0x08, 0x00, 0x71, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00,
0x24, 0x00, 0x20, 0x00, 0x04, 0x00, 0x01, 0x00, 0x04, 0x00, 0x02, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00,
0x04, 0x00, 0x08, 0x00, 0x04, 0x00, 0x09, 0x00, 0x04, 0x00, 0x0a, 0x00,
0x94, 0x05, 0x16, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x14, 0x00, 0x03, 0x00,
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01,
0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x04, 0x00, 0xe2, 0x11, 0x00, 0x00,
0x05, 0x00, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
0x05, 0x00, 0x00, 0x00, 0x18, 0x01, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00,
0x08, 0x00, 0x01, 0x00, 0x6c, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00,
0x71, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x14, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x76, 0x09, 0x00, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x03, 0x00,
0x08, 0x00, 0x01, 0x00, 0x7b, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00, 0x08, 0x00, 0x01, 0x00,
0x80, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x14, 0x00, 0x05, 0x00, 0x08, 0x00, 0x01, 0x00, 0x85, 0x09, 0x00, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x06, 0x00,
0x08, 0x00, 0x01, 0x00, 0x8a, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00,
0x8f, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x14, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x94, 0x09, 0x00, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x09, 0x00,
0x08, 0x00, 0x01, 0x00, 0x99, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x14, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x01, 0x00,
0x9e, 0x09, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x1c, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x01, 0x00, 0xa3, 0x09, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x01, 0x00,
0xa8, 0x09, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0xa0, 0x00, 0x02, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x10, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00,
0x04, 0x00, 0x02, 0x00, 0x10, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00,
0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x10, 0x00, 0x03, 0x00,
0x08, 0x00, 0x01, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00,
0x0c, 0x00, 0x04, 0x00, 0x08, 0x00, 0x01, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x05, 0x00, 0x08, 0x00, 0x01, 0x00, 0x5a, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x01, 0x00, 0x78, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00, 0xb4, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x09, 0x00, 0x08, 0x00, 0x01, 0x00, 0x68, 0x01, 0x00, 0x00,
0x0c, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x01, 0x00, 0xe0, 0x01, 0x00, 0x00,
0x0c, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x01, 0x00, 0x1c, 0x02, 0x00, 0x00,
0xa8, 0x03, 0x01, 0x00, 0x14, 0x00, 0x03, 0x00, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x01, 0x01, 0x00, 0x00, 0x00,
0x06, 0x00, 0x04, 0x00, 0xe2, 0x11, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00,
0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x05, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x07, 0x00, 0xfa, 0xff, 0x00, 0x00, 0xfa, 0xff, 0x00, 0x00,
0x08, 0x00, 0x08, 0x00, 0xa0, 0x71, 0x80, 0x03, 0x00, 0x03, 0x01, 0x00,
0x1c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x3c, 0x14, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00,
0x50, 0x14, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x02, 0x00,
0x08, 0x00, 0x01, 0x00, 0x64, 0x14, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x1c, 0x00, 0x03, 0x00, 0x08, 0x00, 0x01, 0x00, 0x78, 0x14, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x01, 0x00,
0x8c, 0x14, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x20, 0x00, 0x05, 0x00, 0x08, 0x00, 0x01, 0x00, 0xa0, 0x14, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x06, 0x00,
0x08, 0x00, 0x01, 0x00, 0xb4, 0x14, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00,
0xc8, 0x14, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x20, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x7c, 0x15, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x09, 0x00,
0x08, 0x00, 0x01, 0x00, 0x90, 0x15, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x01, 0x00,
0xa4, 0x15, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x20, 0x00, 0x0b, 0x00, 0x08, 0x00, 0x01, 0x00, 0xb8, 0x15, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x0c, 0x00,
0x08, 0x00, 0x01, 0x00, 0xcc, 0x15, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x0d, 0x00, 0x08, 0x00, 0x01, 0x00,
0xe0, 0x15, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x20, 0x00, 0x0e, 0x00, 0x08, 0x00, 0x01, 0x00, 0xf4, 0x15, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x00,
0x08, 0x00, 0x01, 0x00, 0x08, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x01, 0x00,
0x1c, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x20, 0x00, 0x11, 0x00, 0x08, 0x00, 0x01, 0x00, 0x30, 0x16, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x12, 0x00,
0x08, 0x00, 0x01, 0x00, 0x44, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x20, 0x00, 0x13, 0x00, 0x08, 0x00, 0x01, 0x00,
0x58, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x05, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x1c, 0x00, 0x14, 0x00, 0x08, 0x00, 0x01, 0x00, 0x71, 0x16, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x15, 0x00, 0x08, 0x00, 0x01, 0x00,
0x85, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x16, 0x00,
0x08, 0x00, 0x01, 0x00, 0x99, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00,
0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00,
0x1c, 0x00, 0x17, 0x00, 0x08, 0x00, 0x01, 0x00, 0xad, 0x16, 0x00, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00, 0x08, 0x00, 0x06, 0x00,
0x98, 0x08, 0x00, 0x00, 0x1c, 0x00, 0x18, 0x00, 0x08, 0x00, 0x01, 0x00,
0xc1, 0x16, 0x00, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x03, 0x00,
0x08, 0x00, 0x06, 0x00, 0x98, 0x08, 0x00, 0x00, 0x64, 0x00, 0x02, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x3c, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x5a, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x78, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x03, 0x00, 0x08, 0x00, 0x01, 0x00, 0xb4, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x04, 0x00, 0x08, 0x00, 0x01, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x05, 0x00, 0x08, 0x00, 0x01, 0x00, 0x68, 0x01, 0x00, 0x00,
0x0c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x01, 0x00, 0xe0, 0x01, 0x00, 0x00,
0x0c, 0x00, 0x07, 0x00, 0x08, 0x00, 0x01, 0x00, 0x1c, 0x02, 0x00, 0x00,
0xdc, 0x00, 0x32, 0x00, 0x08, 0x00, 0x01, 0x00, 0x07, 0x00, 0x00, 0x00,
0x08, 0x00, 0x02, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00,
0x08, 0x00, 0x05, 0x00, 0x13, 0x00, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00,
0x19, 0x00, 0x00, 0x00, 0x08, 0x00, 0x07, 0x00, 0x25, 0x00, 0x00, 0x00,
0x08, 0x00, 0x08, 0x00, 0x26, 0x00, 0x00, 0x00, 0x08, 0x00, 0x09, 0x00,
0x27, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x28, 0x00, 0x00, 0x00,
0x08, 0x00, 0x0b, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00,
0x37, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0d, 0x00, 0x39, 0x00, 0x00, 0x00,
0x08, 0x00, 0x0e, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0f, 0x00,
0x43, 0x00, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x31, 0x00, 0x00, 0x00,
0x08, 0x00, 0x11, 0x00, 0x41, 0x00, 0x00, 0x00, 0x08, 0x00, 0x12, 0x00,
0x42, 0x00, 0x00, 0x00, 0x08, 0x00, 0x13, 0x00, 0x4b, 0x00, 0x00, 0x00,
0x08, 0x00, 0x14, 0x00, 0x54, 0x00, 0x00, 0x00, 0x08, 0x00, 0x15, 0x00,
0x57, 0x00, 0x00, 0x00, 0x08, 0x00, 0x16, 0x00, 0x55, 0x00, 0x00, 0x00,
0x08, 0x00, 0x17, 0x00, 0x59, 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0x00,
0x5c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x19, 0x00, 0x2d, 0x00, 0x00, 0x00,
0x08, 0x00, 0x1a, 0x00, 0x2e, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1b, 0x00,
0x30, 0x00, 0x00, 0x00, 0x08, 0x00, 0x6f, 0x00, 0x10, 0x27, 0x00, 0x00,
0x04, 0x00, 0x6c, 0x00, 0x30, 0x04, 0x63, 0x00, 0x04, 0x00, 0x00, 0x00,
0x84, 0x00, 0x01, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x84, 0x00, 0x02, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x84, 0x00, 0x03, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x84, 0x00, 0x04, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x50, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x80, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x04, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x84, 0x00, 0x07, 0x00,
0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x20, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x50, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x80, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x84, 0x00, 0x08, 0x00,
0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x20, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x50, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x80, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x84, 0x00, 0x09, 0x00,
0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x20, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x50, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x80, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x84, 0x00, 0x0a, 0x00,
0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x10, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x20, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x50, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x70, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x80, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x90, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xe0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x40, 0x01, 0x64, 0x00,
0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x01, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x02, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00,
0x3c, 0x00, 0x03, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00,
0x3c, 0x00, 0x04, 0x00, 0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00,
0x04, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00, 0x1c, 0x00, 0x07, 0x00,
0x06, 0x00, 0x65, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xc0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00,
0x14, 0x00, 0x08, 0x00, 0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x09, 0x00,
0x06, 0x00, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xb0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00, 0xc0, 0x00, 0x00, 0x00,
0x06, 0x00, 0x65, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x0a, 0x00,
0x06, 0x00, 0x65, 0x00, 0x40, 0x00, 0x00, 0x00, 0x06, 0x00, 0x65, 0x00,
0xd0, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x76, 0x00, 0x04, 0x00, 0x02, 0x00,
0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x05, 0x00, 0x04, 0x00, 0x06, 0x00,
0x04, 0x00, 0x07, 0x00, 0x04, 0x00, 0x08, 0x00, 0x04, 0x00, 0x09, 0x00,
0x14, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x12, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x79, 0x00, 0x04, 0x00, 0x04, 0x00,
0x04, 0x00, 0x06, 0x00, 0x60, 0x00, 0x78, 0x00, 0x5c, 0x00, 0x01, 0x00,
0x48, 0x00, 0x01, 0x00, 0x14, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00,
0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x04, 0x00, 0x02, 0x00,
0x1c, 0x00, 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x10, 0x00, 0x02, 0x00, 0x04, 0x00, 0x03, 0x00, 0x04, 0x00, 0x08, 0x00,
0x04, 0x00, 0x09, 0x00, 0x14, 0x00, 0x03, 0x00, 0x08, 0x00, 0x01, 0x00,
0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x04, 0x00, 0x0a, 0x00,
0x08, 0x00, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00,
0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x8f, 0x00, 0xe3, 0x1a, 0x00, 0x07,
0x1e, 0x00, 0x94, 0x00, 0x63, 0x48, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xa9, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0c, 0x00, 0xaa, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40};
const char kIPV4Address0[] = "192.168.10.20";
const char kIPV4Address1[] = "1.2.3.4";
const char kIPV6Address0[] = "FEDC:BA98:7654:3210:FEDC:BA98:7654:3210";
const char kIPV6Address1[] = "1080:0:0:0:8:800:200C:417A";
const char kHardwareAddress[] = "00A0C914C829";
const int64_t kSuspendDurationSecs = 15;
const uint32_t kNewWiphyNlMsg_MinPatternLen = 16;
#if !defined(DISABLE_WAKE_ON_WIFI)
// Zero-byte pattern prefixes to match the offsetting bytes in the Ethernet
// frame that lie before the source IP address field.
const uint8_t kIPV4PatternPrefix[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00};
const uint8_t kIPV6PatternPrefix[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
// These masks have bits set to 1 to match bytes in an IP address pattern that
// represent the source IP address of the frame. They are padded with zero
// bits in front to ignore the frame offset and at the end to byte-align the
// mask itself.
const uint8_t kIPV4MaskBytes[] = {0x00, 0x00, 0x00, 0x3c};
const uint8_t kIPV6MaskBytes[] = {0x00, 0x00, 0xc0, 0xff, 0x3f};
const uint8_t KIPV4ProtocolTypeMaskBytes[] = {0x3f, 0x30, 0x80};
const uint8_t KIPV6ProtocolTypeMaskBytes[] = {0x3f, 0x30, 0x10};
const uint8_t kIPV4Address0Bytes[] = {0xc0, 0xa8, 0x0a, 0x14};
const uint8_t kIPV4Address1Bytes[] = {0x01, 0x02, 0x03, 0x04};
const uint8_t kIPV6Address0Bytes[] = {0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54,
0x32, 0x10, 0xfe, 0xdc, 0xba, 0x98,
0x76, 0x54, 0x32, 0x10};
const uint8_t kIPV6Address1Bytes[] = {0x10, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x08, 0x00,
0x20, 0x0c, 0x41, 0x7a};
const char kIPV6Address2[] = "1080::8:800:200C:417A";
const uint8_t kIPV6Address2Bytes[] = {0x10, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x08, 0x08, 0x00,
0x20, 0x0c, 0x41, 0x7a};
const char kIPV6Address3[] = "FF01::101";
const uint8_t kIPV6Address3Bytes[] = {0xff, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x01};
const char kIPV6Address4[] = "::1";
const uint8_t kIPV6Address4Bytes[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01};
const char kIPV6Address5[] = "::";
const uint8_t kIPV6Address5Bytes[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00};
const char kIPV6Address6[] = "0:0:0:0:0:FFFF:129.144.52.38";
const uint8_t kIPV6Address6Bytes[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0x81, 0x90, 0x34, 0x26};
const char kIPV6Address7[] = "::DEDE:190.144.52.38";
const uint8_t kIPV6Address7Bytes[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xde, 0xde,
0xbe, 0x90, 0x34, 0x26};
const uint32_t kNewWiphyNlMsg_MaxPatterns = 20;
const uint32_t kNewWiphyNlMsg_MaxSSIDs = 11;
const int kNewWiphyNlMsg_PattSupportOffset = 3300;
const int kNewWiphyNlMsg_WowlanTrigNetDetectAttributeOffset = 3316;
const int kNewWiphyNlMsg_WowlanTrigDisconnectAttributeOffset = 3268;
const uint32_t kSSID1FreqMatches[] = {2412, 2437, 2462, 5180,
5240, 5745, 5805, 5825};
const uint32_t kWakeReasonNlMsg_WiphyIndex = 0;
// NL80211_CMD_GET_WOWLAN message with nlmsg_type 0x16, which is different from
// kNl80211FamilyId (0x13).
const uint8_t kWrongMessageTypeNlMsg[] = {
0x14, 0x00, 0x00, 0x00, 0x16, 0x00, 0x01, 0x00, 0x01, 0x00,
0x00, 0x00, 0x57, 0x40, 0x00, 0x00, 0x49, 0x01, 0x00, 0x00};
// Bytes representing a NL80211_CMD_SET_WOWLAN reporting that the system woke
// up because of a reason other than wake on WiFi.
const uint8_t kWakeReasonUnsupportedNlMsg[] = {
0x30, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4a, 0x01, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x99, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00};
// Bytes representing a NL80211_CMD_SET_WOWLAN reporting that the system woke
// up because of a disconnect.
const uint8_t kWakeReasonDisconnectNlMsg[] = {
0x38, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4a, 0x01, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x99, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
0x08, 0x00, 0x75, 0x00, 0x04, 0x00, 0x02, 0x00};
// Bytes representing a NL80211_CMD_SET_WOWLAN reporting that the system woke
// up because of a a match with packet pattern index
// kWakeReasonPatternNlMsg_PattIndex.
const uint8_t kWakeReasonPatternNlMsg[] = {
0xac, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x4a, 0x01, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x99, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
0x7c, 0x00, 0x75, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0x0d, 0x00, 0x62, 0x00, 0x00, 0x00, 0x66, 0x00, 0x0c, 0x00,
0x6c, 0x29, 0x95, 0x16, 0x54, 0x68, 0x6c, 0x71, 0xd9, 0x8b, 0x3c, 0x6c,
0x08, 0x00, 0x45, 0x00, 0x00, 0x54, 0x00, 0x00, 0x40, 0x00, 0x40, 0x01,
0xb7, 0xdd, 0xc0, 0xa8, 0x00, 0xfe, 0xc0, 0xa8, 0x00, 0x7d, 0x08, 0x00,
0x3f, 0x51, 0x28, 0x64, 0x00, 0x01, 0xb1, 0x0b, 0xd0, 0x54, 0x00, 0x00,
0x00, 0x00, 0x4b, 0x16, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x11,
0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,
0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35,
0x36, 0x37, 0x00, 0x00};
const uint32_t kWakeReasonPatternNlMsg_PattIndex = 0;
const uint8_t kDstHWAddressPatternBytes[] = {0x00, 0xA0, 0xC9,
0x14, 0xc8, 0x29};
const uint8_t KIPV4ProtocolTypeSuffixBytesForTCP[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06};
const uint8_t KIPV4ProtocolTypeSuffixBytesForUDP[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11};
const uint8_t KIPV6ProtocolTypeSuffixBytesForTCP[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x06};
const uint8_t KIPV6ProtocolTypeSuffixBytesForUDP[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0xDD, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x11};
#endif // DISABLE_WAKE_ON_WIFI
} // namespace
class WakeOnWiFiTest : public ::testing::Test {
public:
WakeOnWiFiTest() : metrics_(nullptr) {}
virtual ~WakeOnWiFiTest() {}
void SetUp() override {
Nl80211Message::SetMessageType(kNl80211FamilyId);
// Assume our NIC has reported its wiphy index, and that it supports wake
// all wake triggers.
wake_on_wifi_->wiphy_index_received_ = true;
wake_on_wifi_->wake_on_wifi_triggers_supported_.insert(
WakeOnWiFi::kWakeTriggerPattern);
wake_on_wifi_->wake_on_wifi_triggers_supported_.insert(
WakeOnWiFi::kWakeTriggerDisconnect);
wake_on_wifi_->wake_on_wifi_triggers_supported_.insert(
WakeOnWiFi::kWakeTriggerSSID);
// By default our tests assume that the NIC supports more SSIDs than
// whitelisted SSIDs.
wake_on_wifi_->wake_on_wifi_max_ssids_ = 999;
wake_on_wifi_->dark_resume_history_.time_ = &time_;
ON_CALL(netlink_manager_, SendNl80211Message(_, _, _, _))
.WillByDefault(Return(true));
}
void SetWakeOnWiFiMaxSSIDs(uint32_t max_ssids) {
wake_on_wifi_->wake_on_wifi_max_ssids_ = max_ssids;
}
void EnableWakeOnWiFiFeaturesPacket() {
wake_on_wifi_->wake_on_wifi_features_enabled_ =
kWakeOnWiFiFeaturesEnabledPacket;
}
void EnableWakeOnWiFiFeaturesDarkConnect() {
wake_on_wifi_->wake_on_wifi_features_enabled_ =
kWakeOnWiFiFeaturesEnabledDarkConnect;
}
void EnableWakeOnWiFiFeaturesPacketDarkConnect() {
wake_on_wifi_->wake_on_wifi_features_enabled_ =
kWakeOnWiFiFeaturesEnabledPacketDarkConnect;
}
void SetWakeOnWiFiFeaturesNotSupported() {
wake_on_wifi_->wake_on_wifi_features_enabled_ =
kWakeOnWiFiFeaturesEnabledNotSupported;
}
void DisableWakeOnWiFiFeatures() {
wake_on_wifi_->wake_on_wifi_features_enabled_ =
kWakeOnWiFiFeaturesEnabledNone;
}
void AddWakeOnPacketConnection(const string& ip_endpoint, Error* error) {
wake_on_wifi_->AddWakeOnPacketConnection(ip_endpoint, error);
}
void RemoveWakeOnPacketConnection(const string& ip_endpoint, Error* error) {
wake_on_wifi_->RemoveWakeOnPacketConnection(ip_endpoint, error);
}
void RemoveAllWakeOnPacketConnections(Error* error) {
wake_on_wifi_->RemoveAllWakeOnPacketConnections(error);
}
void AddWakeOnPacketOfTypes(const std::vector<std::string>& packet_types,
Error* error) {
wake_on_wifi_->AddWakeOnPacketOfTypes(packet_types, error);
}
void RemoveWakeOnPacketOfTypes(
const std::vector<std::string>& packet_types, Error* error) {
wake_on_wifi_->RemoveWakeOnPacketOfTypes(packet_types, error);
}
bool CreateIPAddressPatternAndMask(const IPAddress& ip_addr,
ByteString* pattern, ByteString* mask,
uint32_t min_pattern_len) {
return WakeOnWiFi::CreateIPAddressPatternAndMask(
ip_addr, min_pattern_len, pattern, mask);
}
void CreatePacketTypePatternAndMaskforIPV6(
const std::basic_string<char>& hardware_address,
ByteString* pattern, ByteString* mask,
uint32_t min_pattern_len, uint8_t ip_protocol) {
WakeOnWiFi::CreatePacketTypePatternAndMaskforIPV6(
hardware_address, min_pattern_len, ip_protocol, pattern, mask);
}
void CreatePacketTypePatternAndMaskforIPV4(
const std::basic_string<char>& hardware_address,
ByteString* pattern, ByteString* mask,
uint32_t min_pattern_len, uint8_t ip_protocol) {
WakeOnWiFi::CreatePacketTypePatternAndMaskforIPV4(
hardware_address, min_pattern_len, ip_protocol, pattern, mask);
}
bool ConvertIPProtoStrtoEnum(const std::vector<std::string>& ip_proto_strs,
set<uint8_t>* ip_proto_enums,
Error* error) {
return WakeOnWiFi::ConvertIPProtoStrtoEnum(
ip_proto_strs, ip_proto_enums, error);
}
bool ConfigureWiphyIndex(Nl80211Message* msg, int32_t index) {
return WakeOnWiFi::ConfigureWiphyIndex(msg, index);
}
bool ConfigureDisableWakeOnWiFiMessage(SetWakeOnPacketConnMessage* msg,
uint32_t wiphy_index, Error* error) {
return WakeOnWiFi::ConfigureDisableWakeOnWiFiMessage(msg, wiphy_index,
error);
}
bool WakeOnWiFiSettingsMatch(const Nl80211Message& msg,
const set<WakeOnWiFi::WakeOnWiFiTrigger>& trigs,
const IPAddressStore& addrs,
uint32_t net_detect_scan_period_seconds,
set<uint8_t> wake_on_packet_types,
const std::string& hardware_address,
const vector<ByteString>& ssid_whitelist) {
return WakeOnWiFi::WakeOnWiFiSettingsMatch(
msg, trigs, addrs, net_detect_scan_period_seconds, wake_on_packet_types,
hardware_address, kNewWiphyNlMsg_MinPatternLen, ssid_whitelist);
}
bool ConfigureSetWakeOnWiFiSettingsMessage(
SetWakeOnPacketConnMessage* msg,
const set<WakeOnWiFi::WakeOnWiFiTrigger>& trigs,
const IPAddressStore& addrs, uint32_t wiphy_index,
const set<uint8_t> wake_on_packet_types,
const std::string& hardware_address,
uint32_t net_detect_scan_period_seconds,
const vector<ByteString>& ssid_whitelist, Error* error) {
return WakeOnWiFi::ConfigureSetWakeOnWiFiSettingsMessage(
msg, trigs, addrs, wiphy_index, wake_on_packet_types,
hardware_address, kNewWiphyNlMsg_MinPatternLen,
net_detect_scan_period_seconds, ssid_whitelist, error);
}
void RequestWakeOnPacketSettings() {
wake_on_wifi_->RequestWakeOnPacketSettings();
}
void VerifyWakeOnWiFiSettings(const Nl80211Message& nl80211_message) {
wake_on_wifi_->VerifyWakeOnWiFiSettings(nl80211_message);
}
size_t GetWakeOnWiFiMaxPatterns() {
return wake_on_wifi_->wake_on_wifi_max_patterns_;
}
uint32_t GetWakeOnWiFiMaxSSIDs() {
return wake_on_wifi_->wake_on_wifi_max_ssids_;
}
void SetWakeOnWiFiMaxPatterns(size_t max_patterns) {
wake_on_wifi_->wake_on_wifi_max_patterns_ = max_patterns;
}
void ApplyWakeOnWiFiSettings() { wake_on_wifi_->ApplyWakeOnWiFiSettings(); }
void DisableWakeOnWiFi() { wake_on_wifi_->DisableWakeOnWiFi(); }
set<WakeOnWiFi::WakeOnWiFiTrigger>* GetWakeOnWiFiTriggers() {
return &wake_on_wifi_->wake_on_wifi_triggers_;
}
set<WakeOnWiFi::WakeOnWiFiTrigger>* GetWakeOnWiFiTriggersSupported() {
return &wake_on_wifi_->wake_on_wifi_triggers_supported_;
}
void ClearWakeOnWiFiTriggersSupported() {
wake_on_wifi_->wake_on_wifi_triggers_supported_.clear();
}
IPAddressStore* GetWakeOnPacketConnections() {
return &wake_on_wifi_->wake_on_packet_connections_;
}
set<uint8_t> GetWakeOnPacketTypes() {
return wake_on_wifi_->wake_on_packet_types_;
}
void RetrySetWakeOnPacketConnections() {
wake_on_wifi_->RetrySetWakeOnPacketConnections();
}
void SetSuspendActionsDoneCallback() {
wake_on_wifi_->suspend_actions_done_callback_ =
Bind(&WakeOnWiFiTest::DoneCallback, Unretained(this));
}
void ResetSuspendActionsDoneCallback() {
wake_on_wifi_->suspend_actions_done_callback_.Reset();
}
bool SuspendActionsCallbackIsNull() {
return wake_on_wifi_->suspend_actions_done_callback_.is_null();
}
void RunSuspendActionsCallback(const Error& error) {
wake_on_wifi_->suspend_actions_done_callback_.Run(error);
}
int GetNumSetWakeOnPacketRetries() {
return wake_on_wifi_->num_set_wake_on_packet_retries_;
}
void SetConnectedBeforeSuspend(bool was_connected) {
wake_on_wifi_->connected_before_suspend_ = was_connected;
}
void SetNumSetWakeOnPacketRetries(int retries) {
wake_on_wifi_->num_set_wake_on_packet_retries_ = retries;
}
void OnBeforeSuspend(bool is_connected,
const vector<ByteString>& ssid_whitelist,
bool have_dhcp_lease,
uint32_t time_to_next_lease_renewal) {
ResultCallback done_callback(
Bind(&WakeOnWiFiTest::DoneCallback, Unretained(this)));
Closure renew_dhcp_lease_callback(
Bind(&WakeOnWiFiTest::RenewDHCPLeaseCallback, Unretained(this)));
Closure remove_supplicant_networks_callback(Bind(
&WakeOnWiFiTest::RemoveSupplicantNetworksCallback, Unretained(this)));
wake_on_wifi_->OnBeforeSuspend(is_connected, ssid_whitelist, done_callback,
renew_dhcp_lease_callback,
remove_supplicant_networks_callback,
have_dhcp_lease, time_to_next_lease_renewal);
}
void OnDarkResume(bool is_connected,
const vector<ByteString>& ssid_whitelist) {
ResultCallback done_callback(
Bind(&WakeOnWiFiTest::DoneCallback, Unretained(this)));
Closure renew_dhcp_lease_callback(
Bind(&WakeOnWiFiTest::RenewDHCPLeaseCallback, Unretained(this)));
WakeOnWiFi::InitiateScanCallback initiate_scan_callback(
Bind(&WakeOnWiFiTest::InitiateScanCallback, Unretained(this)));
Closure remove_supplicant_networks_callback(Bind(
&WakeOnWiFiTest::RemoveSupplicantNetworksCallback, Unretained(this)));
wake_on_wifi_->OnDarkResume(
is_connected, ssid_whitelist, done_callback, renew_dhcp_lease_callback,
initiate_scan_callback, remove_supplicant_networks_callback);
}
void OnAfterResume() { wake_on_wifi_->OnAfterResume(); }
void BeforeSuspendActions(bool is_connected, bool start_lease_renewal_timer,
uint32_t time_to_next_lease_renewal) {
SetDarkResumeActionsTimeOutCallback();
EXPECT_FALSE(DarkResumeActionsTimeOutCallbackIsCancelled());
EXPECT_CALL(metrics_,
NotifyBeforeSuspendActions(is_connected, GetInDarkResume()));
Closure remove_supplicant_networks_callback(Bind(
&WakeOnWiFiTest::RemoveSupplicantNetworksCallback, Unretained(this)));
wake_on_wifi_->BeforeSuspendActions(is_connected, start_lease_renewal_timer,
time_to_next_lease_renewal,
remove_supplicant_networks_callback);
EXPECT_TRUE(DarkResumeActionsTimeOutCallbackIsCancelled());
}
void OnConnectedAndReachable(bool start_lease_renewal_timer,
uint32_t time_to_next_lease_renewal) {
wake_on_wifi_->OnConnectedAndReachable(start_lease_renewal_timer,
time_to_next_lease_renewal);
}
void SetInDarkResume(bool val) { wake_on_wifi_->in_dark_resume_ = val; }
bool GetInDarkResume() { return wake_on_wifi_->in_dark_resume_; }
void SetWiphyIndexReceivedToFalse() {
wake_on_wifi_->wiphy_index_received_ = false;
}
void SetWiphyIndex(uint32_t wiphy_index) {
wake_on_wifi_->wiphy_index_ = wiphy_index;
}
void ParseWakeOnWiFiCapabilities(const Nl80211Message& nl80211_message) {
wake_on_wifi_->ParseWakeOnWiFiCapabilities(nl80211_message);
}
bool SetWakeOnWiFiFeaturesEnabled(const std::string& enabled, Error* error) {
return wake_on_wifi_->SetWakeOnWiFiFeaturesEnabled(enabled, error);
}
const string& GetWakeOnWiFiFeaturesEnabled() {
return wake_on_wifi_->wake_on_wifi_features_enabled_;
}
void SetDarkResumeActionsTimeOutCallback() {
wake_on_wifi_->dark_resume_actions_timeout_callback_.Reset(Bind(
&WakeOnWiFiTest::DarkResumeActionsTimeoutCallback, Unretained(this)));
}
bool DarkResumeActionsTimeOutCallbackIsCancelled() {
return wake_on_wifi_->dark_resume_actions_timeout_callback_.IsCancelled();
}
void StartDHCPLeaseRenewalTimer() {
wake_on_wifi_->dhcp_lease_renewal_timer_.Start(
FROM_HERE, base::TimeDelta::FromSeconds(kTimeToNextLeaseRenewalLong),
Bind(&WakeOnWiFiTest::OnTimerWakeDoNothing, Unretained(this)));
}
void StartWakeToScanTimer() {
wake_on_wifi_->wake_to_scan_timer_.Start(
FROM_HERE, base::TimeDelta::FromSeconds(kTimeToNextLeaseRenewalLong),
Bind(&WakeOnWiFiTest::OnTimerWakeDoNothing, Unretained(this)));
}
void StopDHCPLeaseRenewalTimer() {
wake_on_wifi_->dhcp_lease_renewal_timer_.Stop();
}
void StopWakeToScanTimer() { wake_on_wifi_->wake_to_scan_timer_.Stop(); }
bool DHCPLeaseRenewalTimerIsRunning() {
return wake_on_wifi_->dhcp_lease_renewal_timer_.IsRunning();
}
bool WakeToScanTimerIsRunning() {
return wake_on_wifi_->wake_to_scan_timer_.IsRunning();
}
void SetDarkResumeActionsTimeoutMilliseconds(int64_t timeout) {
wake_on_wifi_->DarkResumeActionsTimeoutMilliseconds = timeout;
}
void InitStateForDarkResume() {
SetInDarkResume(true);
GetWakeOnPacketConnections()->AddUnique(IPAddress("1.1.1.1"));
EnableWakeOnWiFiFeaturesPacketDarkConnect();
SetDarkResumeActionsTimeoutMilliseconds(0);
}
void SetExpectationsDisconnectedBeforeSuspend() {
EXPECT_TRUE(GetWakeOnWiFiTriggers()->empty());
EXPECT_CALL(*this, DoneCallback(_)).Times(0);
EXPECT_CALL(*this, RemoveSupplicantNetworksCallback()).Times(1);
EXPECT_CALL(netlink_manager_,
SendNl80211Message(
IsNl80211Command(kNl80211FamilyId,
SetWakeOnPacketConnMessage::kCommand),
_, _, _));
}
void SetExpectationsConnectedBeforeSuspend() {
EXPECT_TRUE(GetWakeOnWiFiTriggers()->empty());
EXPECT_CALL(*this, DoneCallback(_)).Times(0);
EXPECT_CALL(netlink_manager_,
SendNl80211Message(
IsNl80211Command(kNl80211FamilyId,
SetWakeOnPacketConnMessage::kCommand),
_, _, _));
}
void VerifyStateConnectedBeforeSuspend() {
EXPECT_TRUE(DarkResumeActionsTimeOutCallbackIsCancelled());
EXPECT_FALSE(GetInDarkResume());
EXPECT_EQ(GetWakeOnWiFiTriggers()->size(), 2);
EXPECT_TRUE(
GetWakeOnWiFiTriggers()->find(WakeOnWiFi::kWakeTriggerPattern) !=
GetWakeOnWiFiTriggers()->end());
EXPECT_TRUE(
GetWakeOnWiFiTriggers()->find(WakeOnWiFi::kWakeTriggerDisconnect) !=
GetWakeOnWiFiTriggers()->end());
}
void VerifyStateDisconnectedBeforeSuspend() {
EXPECT_TRUE(DarkResumeActionsTimeOutCallbackIsCancelled());
EXPECT_FALSE(GetInDarkResume());
EXPECT_EQ(GetWakeOnWiFiTriggers()->size(), 1);
EXPECT_FALSE(
GetWakeOnWiFiTriggers()->find(WakeOnWiFi::kWakeTriggerPattern) !=
GetWakeOnWiFiTriggers()->end());
EXPECT_TRUE(GetWakeOnWiFiTriggers()->find(WakeOnWiFi::kWakeTriggerSSID) !=
GetWakeOnWiFiTriggers()->end());
}
void ReportConnectedToServiceAfterWake(bool is_connected,
int seconds_in_suspend) {
wake_on_wifi_->ReportConnectedToServiceAfterWake(is_connected,
seconds_in_suspend);
}
void OnNoAutoConnectableServicesAfterScan(
const vector<ByteString>& ssid_whitelist) {
Closure remove_supplicant_networks_callback(Bind(
&WakeOnWiFiTest::RemoveSupplicantNetworksCallback, Unretained(this)));
WakeOnWiFi::InitiateScanCallback initiate_scan_callback(
Bind(&WakeOnWiFiTest::InitiateScanCallback, Unretained(this)));
wake_on_wifi_->OnNoAutoConnectableServicesAfterScan(
ssid_whitelist, remove_supplicant_networks_callback,
initiate_scan_callback);
}
EventHistory* GetDarkResumeHistory() {
return &wake_on_wifi_->dark_resume_history_;
}
void SetNetDetectScanPeriodSeconds(uint32_t period) {
wake_on_wifi_->net_detect_scan_period_seconds_ = period;
}
void AddSSIDToWhitelist(const uint8_t* ssid, int num_bytes,
vector<ByteString>* whitelist) {
vector<uint8_t> ssid_vector(ssid, ssid + num_bytes);
whitelist->push_back(ByteString(ssid_vector));
}
vector<ByteString>* GetWakeOnSSIDWhitelist() {
return &wake_on_wifi_->wake_on_ssid_whitelist_;
}
void OnWakeupReasonReceived(const NetlinkMessage& netlink_message) {
wake_on_wifi_->OnWakeupReasonReceived(netlink_message);
}
WiFi::FreqSet ParseWakeOnSSIDResults(AttributeListConstRefPtr results_list) {
return wake_on_wifi_->ParseWakeOnSSIDResults(results_list);
}
NetlinkMessage::MessageContext GetWakeupReportMsgContext() {
NetlinkMessage::MessageContext context;
context.nl80211_cmd = NL80211_CMD_SET_WOWLAN;
context.is_broadcast = true;
return context;
}
void SetLastWakeReason(WakeOnWiFi::WakeOnWiFiTrigger reason) {
wake_on_wifi_->last_wake_reason_ = reason;
}
WakeOnWiFi::WakeOnWiFiTrigger GetLastWakeReason() {
return wake_on_wifi_->last_wake_reason_;
}
void OnScanStarted(bool is_active_scan) {
wake_on_wifi_->OnScanStarted(is_active_scan);
}
const WiFi::FreqSet& GetLastSSIDMatchFreqs() {
return wake_on_wifi_->last_ssid_match_freqs_;
}
void AddResultToLastSSIDResults() {
wake_on_wifi_->last_ssid_match_freqs_.insert(1);
}
void InitiateScanInDarkResume(const WiFi::FreqSet& freqs) {
wake_on_wifi_->InitiateScanInDarkResume(
Bind(&WakeOnWiFiTest::InitiateScanCallback, Unretained(this)), freqs);
}
int GetDarkResumeScanRetriesLeft() {
return wake_on_wifi_->dark_resume_scan_retries_left_;
}
void SetDarkResumeScanRetriesLeft(int retries) {
wake_on_wifi_->dark_resume_scan_retries_left_ = retries;
}
Timestamp GetTimestampBootTime(int boottime_seconds) {
struct timeval monotonic = {.tv_sec = 0, .tv_usec = 0};
struct timeval boottime = {.tv_sec = boottime_seconds, .tv_usec = 0};
return Timestamp(monotonic, boottime, "");
}
MOCK_METHOD1(DoneCallback, void(const Error &));
MOCK_METHOD0(RenewDHCPLeaseCallback, void());
MOCK_METHOD1(InitiateScanCallback, void(const WiFi::FreqSet&));
MOCK_METHOD0(RemoveSupplicantNetworksCallback, void());
MOCK_METHOD0(DarkResumeActionsTimeoutCallback, void());
MOCK_METHOD0(OnTimerWakeDoNothing, void());
MOCK_METHOD1(RecordDarkResumeWakeReasonCallback,
void(const string& wake_reason));
protected:
NiceMockControl control_interface_;
MockMetrics metrics_;
MockNetlinkManager netlink_manager_;
MockTime time_;
std::unique_ptr<WakeOnWiFi> wake_on_wifi_;
};
class WakeOnWiFiTestWithDispatcher : public WakeOnWiFiTest {
public:
WakeOnWiFiTestWithDispatcher() : WakeOnWiFiTest() {
wake_on_wifi_.reset(
new WakeOnWiFi(&netlink_manager_, &dispatcher_,
&metrics_, kHardwareAddress,
Bind(&WakeOnWiFiTest::RecordDarkResumeWakeReasonCallback,
Unretained(this))));
}
virtual ~WakeOnWiFiTestWithDispatcher() {}
protected:
EventDispatcherForTest dispatcher_;
};
class WakeOnWiFiTestWithMockDispatcher : public WakeOnWiFiTest {
public:
WakeOnWiFiTestWithMockDispatcher() : WakeOnWiFiTest() {
wake_on_wifi_.reset(
new WakeOnWiFi(&netlink_manager_, &mock_dispatcher_,
&metrics_, kHardwareAddress,
Bind(&WakeOnWiFiTest::RecordDarkResumeWakeReasonCallback,
Unretained(this))));
}
virtual ~WakeOnWiFiTestWithMockDispatcher() {}
protected:
// TODO(zqiu): message loop is needed by AlarmTimer, should restructure the
// code so that it can be mocked out.
base::MessageLoopForIO message_loop_;
MockEventDispatcher mock_dispatcher_;
};
ByteString CreatePattern(const unsigned char* prefix, size_t prefix_len,
const unsigned char* addr, size_t addr_len) {
ByteString result(prefix, prefix_len);
result.Append(ByteString(addr, addr_len));
return result;
}
ByteString CreateDstHWPattern(const unsigned char* addr, size_t addr_len,
const unsigned char* addr_suffix,
size_t suffix_len) {
ByteString result(addr, addr_len);
result.Append(ByteString(addr_suffix, suffix_len));
return result;
}
#if !defined(DISABLE_WAKE_ON_WIFI)
TEST_F(WakeOnWiFiTestWithMockDispatcher, CreateIPAddressPatternAndMask) {
ByteString pattern;
ByteString mask;
ByteString expected_pattern;
CreateIPAddressPatternAndMask(IPAddress(kIPV4Address0), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV4PatternPrefix, sizeof(kIPV4PatternPrefix),
kIPV4Address0Bytes, sizeof(kIPV4Address0Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV4MaskBytes, sizeof(kIPV4MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV4Address1), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV4PatternPrefix, sizeof(kIPV4PatternPrefix),
kIPV4Address1Bytes, sizeof(kIPV4Address1Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV4MaskBytes, sizeof(kIPV4MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address0), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address0Bytes, sizeof(kIPV6Address0Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address1), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address1Bytes, sizeof(kIPV6Address1Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address2), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address2Bytes, sizeof(kIPV6Address2Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address3), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address3Bytes, sizeof(kIPV6Address3Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address4), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address4Bytes, sizeof(kIPV6Address4Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address5), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address5Bytes, sizeof(kIPV6Address5Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address6), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address6Bytes, sizeof(kIPV6Address6Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreateIPAddressPatternAndMask(IPAddress(kIPV6Address7), &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen);
expected_pattern =
CreatePattern(kIPV6PatternPrefix, sizeof(kIPV6PatternPrefix),
kIPV6Address7Bytes, sizeof(kIPV6Address7Bytes));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(kIPV6MaskBytes, sizeof(kIPV6MaskBytes))));
}
TEST_F(WakeOnWiFiTestWithMockDispatcher,
CreatePatternAndMaskForProtocolType) {
ByteString pattern;
ByteString mask;
ByteString expected_pattern;
CreatePacketTypePatternAndMaskforIPV4(
kHardwareAddress, &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen, IPPROTO_TCP);
expected_pattern =
CreatePattern(kDstHWAddressPatternBytes,
sizeof(kDstHWAddressPatternBytes),
KIPV4ProtocolTypeSuffixBytesForTCP,
sizeof(KIPV4ProtocolTypeSuffixBytesForTCP));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(KIPV4ProtocolTypeMaskBytes,
sizeof(KIPV4ProtocolTypeMaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreatePacketTypePatternAndMaskforIPV4(
kHardwareAddress, &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen, IPPROTO_UDP);
expected_pattern =
CreatePattern(kDstHWAddressPatternBytes,
sizeof(kDstHWAddressPatternBytes),
KIPV4ProtocolTypeSuffixBytesForUDP,
sizeof(KIPV4ProtocolTypeSuffixBytesForUDP));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(KIPV4ProtocolTypeMaskBytes,
sizeof(KIPV4ProtocolTypeMaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreatePacketTypePatternAndMaskforIPV6(
kHardwareAddress, &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen, IPPROTO_TCP);
expected_pattern =
CreatePattern(kDstHWAddressPatternBytes,
sizeof(kDstHWAddressPatternBytes),
KIPV6ProtocolTypeSuffixBytesForTCP,
sizeof(KIPV6ProtocolTypeSuffixBytesForTCP));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(KIPV6ProtocolTypeMaskBytes,
sizeof(KIPV6ProtocolTypeMaskBytes))));
pattern.Clear();
expected_pattern.Clear();
mask.Clear();
CreatePacketTypePatternAndMaskforIPV6(
kHardwareAddress, &pattern, &mask,
kNewWiphyNlMsg_MinPatternLen, IPPROTO_UDP);
expected_pattern =
CreatePattern(kDstHWAddressPatternBytes,
sizeof(kDstHWAddressPatternBytes),
KIPV6ProtocolTypeSuffixBytesForUDP,
sizeof(KIPV6ProtocolTypeSuffixBytesForUDP));
EXPECT_TRUE(pattern.Equals(expected_pattern));
EXPECT_TRUE(mask.Equals(ByteString(KIPV6ProtocolTypeMaskBytes,
sizeof(KIPV6ProtocolTypeMaskBytes))));
}
TEST_F(WakeOnWiFiTestWithMockDispatcher, ConvertIPProtoStrtoEnum) {
std::vector<std::string> ip_proto_strs = {
"IP", "ICMP", "IGMP", "IPIP", "TCP", "UDP", "IDP"};
set<uint8_t> ip_proto_enums;
Error e;
bool return_val = ConvertIPProtoStrtoEnum(ip_proto_strs, &ip_proto_enums, &e);
EXPECT_TRUE(return_val);
EXPECT_EQ(ip_proto_strs.size(), ip_proto_enums.size());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_TCP) == ip_proto_enums.end());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_UDP) == ip_proto_enums.end());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_ICMP) == ip_proto_enums.end());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_IGMP) == ip_proto_enums.end());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_IPIP) == ip_proto_enums.end());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_IP) == ip_proto_enums.end());
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_IDP) == ip_proto_enums.end());
ip_proto_strs = {" IP", "ICMP", "IGMP", "IPIP", "TCP", "UDP", "IDP"};
ip_proto_enums.clear();
return_val = ConvertIPProtoStrtoEnum(ip_proto_strs, &ip_proto_enums, &e);
EXPECT_FALSE(return_val);
EXPECT_TRUE(ip_proto_enums.empty());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_TCP), ip_proto_enums.end());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_UDP), ip_proto_enums.end());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_ICMP), ip_proto_enums.end());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_IGMP), ip_proto_enums.end());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_IPIP), ip_proto_enums.end());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_IP), ip_proto_enums.end());
EXPECT_EQ(ip_proto_enums.find(IPPROTO_IDP), ip_proto_enums.end());
ip_proto_strs = {"IP", "IP", "IP", "IP", "IP", "IP"};
ip_proto_enums.clear();
return_val = ConvertIPProtoStrtoEnum(ip_proto_strs, &ip_proto_enums, &e);
EXPECT_TRUE(return_val);
EXPECT_EQ(ip_proto_enums.size(), 1);
EXPECT_FALSE(ip_proto_enums.find(IPPROTO_IP) == ip_proto_enums.end());
}
TEST_F(WakeOnWiFiTestWithMockDispatcher, ConfigureWiphyIndex) {
SetWakeOnPacketConnMessage msg;
uint32_t value;
EXPECT_FALSE(
msg.attributes()->GetU32AttributeValue(NL80211_ATTR_WIPHY, &value));
ConfigureWiphyIndex(&msg, 137);
EXPECT_TRUE(
msg.attributes()->GetU32AttributeValue(NL80211_ATTR_WIPHY, &value));
EXPECT_EQ(value, 137);
}
TEST_F(WakeOnWiFiTestWithMockDispatcher, ConfigureDisableWakeOnWiFiMessage) {
SetWakeOnPacketConnMessage msg;
Error e;
uint32_t value;
EXPECT_FALSE(
msg.attributes()->GetU32AttributeValue(NL80211_ATTR_WIPHY, &value));
ConfigureDisableWakeOnWiFiMessage(&msg, 57, &e);
EXPECT_EQ(e.type(), Error::Type::kSuccess);
EXPECT_TRUE(
msg.attributes()->GetU32AttributeValue(NL80211_ATTR_WIPHY, &value));
EXPECT_EQ(value, 57);
}
TEST_F(WakeOnWiFiTestWithMockDispatcher, WakeOnWiFiSettingsMatch) {
IPAddressStore all_addresses;
set<WakeOnWiFi::WakeOnWiFiTrigger> trigs;
vector<ByteString> whitelist;
const uint32_t interval = kNetDetectScanIntervalSeconds;
GetWakeOnPacketConnMessage msg0;
NetlinkPacket packet0(kResponseNoIPAddresses, sizeof(kResponseNoIPAddresses));
msg0.InitFromPacket(&packet0, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
trigs.insert(WakeOnWiFi::kWakeTriggerPattern);
all_addresses.AddUnique(
IPAddress(string(kIPV4Address0, sizeof(kIPV4Address0))));
GetWakeOnPacketConnMessage msg1;
NetlinkPacket packet1(kResponseIPV40, sizeof(kResponseIPV40));
msg1.InitFromPacket(&packet1, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
// Test matching of wake on disconnect trigger.
trigs.insert(WakeOnWiFi::kWakeTriggerDisconnect);
GetWakeOnPacketConnMessage msg2;
NetlinkPacket packet2(
kResponseIPV40WakeOnDisconnect, sizeof(kResponseIPV40WakeOnDisconnect));
msg2.InitFromPacket(&packet2, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
trigs.erase(WakeOnWiFi::kWakeTriggerDisconnect);
all_addresses.AddUnique(
IPAddress(string(kIPV4Address1, sizeof(kIPV4Address1))));
GetWakeOnPacketConnMessage msg3;
NetlinkPacket packet3(kResponseIPV401, sizeof(kResponseIPV401));
msg3.InitFromPacket(&packet3, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg3, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
all_addresses.AddUnique(
IPAddress(string(kIPV6Address0, sizeof(kIPV6Address0))));
GetWakeOnPacketConnMessage msg4;
NetlinkPacket packet4(kResponseIPV401IPV60, sizeof(kResponseIPV401IPV60));
msg4.InitFromPacket(&packet4, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg4, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg3, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
all_addresses.AddUnique(
IPAddress(string(kIPV6Address1, sizeof(kIPV6Address1))));
GetWakeOnPacketConnMessage msg5;
NetlinkPacket packet5(kResponseIPV401IPV601, sizeof(kResponseIPV401IPV601));
msg5.InitFromPacket(&packet5, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg5, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg4, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg3, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
// Test matching of wake on SSID trigger.
all_addresses.Clear();
trigs.clear();
trigs.insert(WakeOnWiFi::kWakeTriggerSSID);
AddSSIDToWhitelist(kSSIDBytes1, sizeof(kSSIDBytes1), &whitelist);
AddSSIDToWhitelist(kSSIDBytes2, sizeof(kSSIDBytes2), &whitelist);
GetWakeOnPacketConnMessage msg6;
NetlinkPacket packet6(kResponseWakeOnSSID, sizeof(kResponseWakeOnSSID));
msg6.InitFromPacket(&packet6, NetlinkMessage::MessageContext());
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg6, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg5, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg4, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg3, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
// Test that we get a mismatch if triggers are present in the message that we
// don't expect.
trigs.clear();
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg6, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg5, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg4, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg3, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
EXPECT_FALSE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
}
TEST_F(WakeOnWiFiTestWithMockDispatcher,
ConfigureSetWakeOnWiFiSettingsMessage) {
IPAddressStore all_addresses;
set<WakeOnWiFi::WakeOnWiFiTrigger> trigs;
const int index = 1; // wiphy device number
vector<ByteString> whitelist;
const uint32_t interval = kNetDetectScanIntervalSeconds;
SetWakeOnPacketConnMessage msg0;
Error e;
trigs.insert(WakeOnWiFi::kWakeTriggerPattern);
all_addresses.AddUnique(
IPAddress(string(kIPV4Address0, sizeof(kIPV4Address0))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg0, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg0, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg1;
all_addresses.AddUnique(
IPAddress(string(kIPV4Address1, sizeof(kIPV4Address1))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg1, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg1, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg2;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address0, sizeof(kIPV6Address0))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg2, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg2, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg3;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address1, sizeof(kIPV6Address1))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg3, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg3, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg4;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address2, sizeof(kIPV6Address2))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg4, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg4, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg5;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address3, sizeof(kIPV6Address3))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg5, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg5, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg6;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address4, sizeof(kIPV6Address4))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg6, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg6, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg7;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address5, sizeof(kIPV6Address5))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg7, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg7, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg8;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address6, sizeof(kIPV6Address6))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg8, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg8, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg9;
all_addresses.AddUnique(
IPAddress(string(kIPV6Address7, sizeof(kIPV6Address7))));
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg9, trigs, all_addresses, index, {}, kHardwareAddress, interval,
whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg9, trigs, all_addresses, interval, {},
kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg10;
uint8_t proto_tcp = static_cast<uint8_t>(IPPROTO_TCP);
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg10, trigs, all_addresses, index, {proto_tcp }, kHardwareAddress,
interval, whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg10, trigs, all_addresses, interval,
{proto_tcp}, kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg11;
all_addresses.Clear();
uint8_t proto_udp = static_cast<uint8_t>(IPPROTO_UDP);
EXPECT_TRUE(ConfigureSetWakeOnWiFiSettingsMessage(
&msg11, trigs, all_addresses, index, {proto_udp}, kHardwareAddress,
interval, whitelist, &e));
EXPECT_TRUE(
WakeOnWiFiSettingsMatch(msg11, trigs, all_addresses, interval,
{proto_udp}, kHardwareAddress, whitelist));
SetWakeOnPacketConnMessage msg12;
all_addresses.Clear();