blob: 51dd91fc6819459b7fca4757322a4f24c73d203b [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 "base/basictypes.h"
#include "permission_broker/rule.h"
struct udev;
namespace permission_broker {
// DenyClaimedUsbDeviceRule encapsulates the policy that any USB device that is
// claimed by a driver is |DENY|'d, while all other requests are |IGNORE|d. It
// does this by walking the udev device tree (the entire tree, not just the USB
// subsystem) and attempts, for each device entry, to find a parent device
// within the USB subsystem whose device node property is the same as the |path|
// parameter. If such a matching device exists, the path is rejected as it has
// been demonstrated to be claimed by another udev entry.
class DenyClaimedUsbDeviceRule : public Rule {
virtual ~DenyClaimedUsbDeviceRule();
virtual Result Process(const std::string &path,
const int interface_id);
struct udev *const udev_;
} // namespace permission_broker