Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4766b6a
remove: cpp old files
frapank Jun 13, 2026
90b9561
refactor: change .gitignore for Rust
frapank Jun 13, 2026
041981c
add: setup base rust project
frapank Jun 13, 2026
59cba28
add: list_interfaces() utils function
frapank Jun 13, 2026
ad345f8
add: base ratatui gui and basic interf struct
frapank Jun 14, 2026
92e558e
add: functional gui
frapank Jun 15, 2026
21c631e
change: move gui definition from main.rs to gui.rs
frapank Jun 15, 2026
2859822
move: ProgramContext logic to main.c
frapank Jun 15, 2026
9acb9f2
move: ProgramContext struct from main.rs to app.rs
frapank Jun 15, 2026
93e4946
rename: gui.rs to tui.rs
frapank Jun 15, 2026
3e14456
add: clippy check
frapank Jun 15, 2026
a0c1f1b
add: constant for TITLE_HEIGHT, ControlFlow insted of bool and safe c…
frapank Jun 15, 2026
ed2ddb5
remove: Result from gui::new()
frapank Jun 15, 2026
a83e379
fix: redundant closure
frapank Jun 15, 2026
e61fb61
add: new impl for PorgramContext, and new delay field
frapank Jun 16, 2026
d71a1fb
add: delay print to ListItem
frapank Jun 16, 2026
3b0fd19
change: use of ProgramContext::new() insted of manual definition
frapank Jun 16, 2026
4f17083
add: thiserror and key functions
frapank Jun 16, 2026
82eeef3
refactor: fmt
frapank Jun 16, 2026
16ac500
add: github action
frapank Jun 16, 2026
cd613a8
add: popup to insert ms
frapank Jun 17, 2026
279751a
remove: unused function
frapank Jun 17, 2026
c443bc4
add: check if the program is runned with root privilege
frapank Jun 17, 2026
6f83818
change: project info
frapank Jun 17, 2026
6fc7430
fix: minor definition
frapank Jun 17, 2026
f9261c2
refactor: cargo fmt
frapank Jun 17, 2026
899018a
remove: temporarily remove ci.yml
frapank Jun 17, 2026
63d1aa8
add: new github action
frapank Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Fmt · Clippy · Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Formato
run: cargo fmt --all -- --check

- name: Test
run: cargo test --verbose
39 changes: 37 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
.cache/
/build/
/target/
**/target/

Cargo.lock

*.rlib
*.rmeta
*.rmeta.d
*.d

.vscode/
.idea/
*.iml

.idea/

.DS_Store
Thumbs.db

*~

*.prof
*.perf
flamegraph.svg

*.log

.env
.env.*

coverage/
tarpaulin-report.html

*.wasm

*.pid
*.tmp
21 changes: 0 additions & 21 deletions CMakeLists.txt

This file was deleted.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "NetLatencyInjector"
version = "1.0.0"
edition = "2024"

[dependencies]
crossterm = "0.29.0"
ratatui = "0.30.1"
env_logger = "0.11.10"
log = "0.4.32"
thiserror = "2.0.18"
28 changes: 0 additions & 28 deletions include/lagger/gui.hpp

This file was deleted.

12 changes: 0 additions & 12 deletions include/lagger/utils.hpp

This file was deleted.

29 changes: 29 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use crate::utils::get_delay;
use crate::utils::list_interfaces;

pub struct Interface {
pub name: String,
pub delay: u32,
}

pub struct ProgramContext {
pub interf_vec: Vec<Interface>,
pub interf_sel: usize,
}

impl ProgramContext {
pub fn new() -> Result<Self, crate::utils::NetemError> {
let mut interfaces = Vec::new();

for name in list_interfaces()? {
let delay = get_delay(&name)?.unwrap_or(0);

interfaces.push(Interface { name, delay });
}

Ok(Self {
interf_vec: interfaces,
interf_sel: 0,
})
}
}
148 changes: 0 additions & 148 deletions src/gui.cpp

This file was deleted.

1 change: 1 addition & 0 deletions src/gui/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod tui;
Loading
Loading