blob: 5bf77ab6e0e4b289fe79a58125a98f76672f96a3 [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 <string>
#include "permission_broker/usb_subsystem_udev_rule.h"
#include <libudev.h>
using std::string;
namespace permission_broker {
UsbSubsystemUdevRule::UsbSubsystemUdevRule(const string &name)
: UdevRule(name) {}
UsbSubsystemUdevRule::~UsbSubsystemUdevRule() {}
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