MCPcopy Create free account
hub / github.com/USBGuard/usbguard / knownSysfsPath

Method knownSysfsPath

src/Library/DeviceManagerBase.cpp:368–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366 }
367
368 bool DeviceManagerBase::knownSysfsPath(const std::string& sysfs_path, uint32_t* id_ptr) const
369 {
370 USBGUARD_LOG(Trace) << "Known? sysfs_path=" << sysfs_path << " size=" << sysfs_path.size() << " id_ptr=" << (void*)id_ptr;
371 auto it = _sysfs_path_to_id_map.find(sysfs_path);
372 uint32_t known_id = 0;
373 bool known = false;
374
375 if (it != _sysfs_path_to_id_map.end()) {
376 known = true;
377 known_id = it->second;
378 }
379
380 if (id_ptr != nullptr) {
381 *id_ptr = known_id;
382 }
383
384 USBGUARD_LOG(Trace) << "Known? sysfs_path=" << sysfs_path << " id_ptr=" << (void*)id_ptr << " known=" << known << " known_id="
385 << known_id;
386 return known;
387 }
388
389 void DeviceManagerBase::learnSysfsPath(const std::string& sysfs_path, uint32_t id)
390 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected