-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zleyyij
committed
Feb 11, 2024
1 parent
6a8cc62
commit e93f90c
Showing
4 changed files
with
37,874 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod cpu; | ||
mod usb; | ||
mod pcie; | ||
|
||
use axum::extract::Query; | ||
use axum::http::HeaderValue; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use nom::bytes::complete::{tag, take, take_until}; | ||
use nom::character::complete::char; | ||
use nom::sequence::{delimited, preceded}; | ||
use nom::IResult; | ||
|
||
// the input file was obtained from https://pci-ids.ucw.cz/ | ||
const FILE_INPUT: &str = include_str!("./pci.ids.txt"); | ||
|
||
/// Vendors are at the root of the file | ||
pub struct Vendor { | ||
pub id: String, | ||
pub name: String, | ||
pub devices: Vec<Device> | ||
} | ||
|
||
/// Devices are placed directly under the relevant [Vendor] in the tree, | ||
/// and are marked with one tab before, the device ID, then two spaces and the device name | ||
pub struct Device { | ||
pub id: String, | ||
pub name: String, | ||
pub subsystems: Vec<Subsystem> | ||
} | ||
|
||
/// Subsystems are placed directly under the relevant [Device] in the tree, | ||
/// and are marked with two tabs before, the [Vendor] ID, a space, then the subsystem ID, | ||
/// then two spaces, then the name of the subsystem | ||
pub struct Subsystem { | ||
pub id: String, | ||
pub name: String, | ||
} |
Oops, something went wrong.