blob: 0cb1921f1dea429fc2935fd369627d6c068d533a [file] [log] [blame]
// Copyright (c) 2012 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 "permission_broker/usb_subsystem_udev_rule.h"
#include <libudev.h>
#include <string>
using std::string;
namespace permission_broker {
UsbSubsystemUdevRule::UsbSubsystemUdevRule(const string& name)
: UdevRule(name) {}
Rule::Result UsbSubsystemUdevRule::ProcessDevice(struct udev_device* device) {
const char* const subsystem = udev_device_get_subsystem(device);
if (!subsystem || strcmp(subsystem, "usb"))
return IGNORE;
return ProcessUsbDevice(device);
}
} // namespace permission_broker