Skip to content

Commit

Permalink
Remove build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
LVala committed Jan 24, 2024
1 parent a371000 commit 5c0599b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 93 deletions.
41 changes: 15 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,26 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --check --manifest-path ${{ matrix.dir }}/Cargo.toml
- name: Check formatting
run: cargo fmt --check --manifest-path ${{ matrix.dir }}/Cargo.toml

linting:
name: Build and linting
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
dir: [., ./client, ./common]
target: [x86_64-unknown-linux-gnu, wasm32-unknown-unknown]
exclude:
- dir: .
target: wasm32-unknown-unknown
- dir: ./client
target: x86_64-unknown-linux-gnu
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy
- run: cargo clippy --manifest-path ${{ matrix.dir }}/Cargo.toml --target ${{ matrix.target }} -- -Dwarnings
- uses: cargo-bins/cargo-binstall@main
- name: Install libpcap
run: sudo apt-get install libpcap-dev
- name: Install trunk
run: cargo binstall --no-confirm --version ~0.18 trunk
- name: Compile the client
working-directory: ./client
run: trunk build --release
- name: Install rtpeeker
run: cargo install --locked --path .

test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
# all tests are run on host target
dir: [., ./client, ./common]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get install libpcap-dev
- run: cargo test --manifest-path ${{ matrix.dir }}/Cargo.toml
# TODO: add clippy check and tests
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
target/
dist/
.idea
.idea
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "rtpeeker"
version = "0.1.0"
edition = "2021"
include = ["/client"]

[dependencies]
rtpeeker_common = { path = "./common" }
Expand Down
49 changes: 1 addition & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,4 @@ _Work in progress_

## Installation

1. [Install Rust and cargo](https://www.rust-lang.org/tools/install)

2. Add WASM32 target
```console
rustup target add wasm32-unknown-unknown
```

3. Install native dependencies, for Ubuntu/Debian:
```console
sudo apt install build-essential pkg-config libssl-dev libpcap-dev
```

4. Install Trunk, WASM bundling tool
```console
cargo install --locked trunk
```

5. Install RTPeeker
```console
cargo install --locked --git https://github.com/LVala/rtpeeker --branch easier-install rtpeeker
```

6. Run the app
```console
rtpeeker --help
```

## Usage

List local network interfaces
```console
rtpeeker list
```

Capture from interface "en0" and file `./rtp.pcap`
```console
rtpeeker run -i en0 -f ./rtp.pcap
```

Apply capture filter (the same as in Wireshark or tcpdump)
```console
rtpeeker run -i en0 -c "src 192.0.0.5"
```

Show help explaining these options
```console
rtpeeker --help
```
_TODO_
17 changes: 0 additions & 17 deletions build.rs

This file was deleted.

2 changes: 1 addition & 1 deletion client/src/app/rtp_packets_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl RtpPacketsTable {
ssrc_to_display_name.insert(*key, stream.alias.to_string());
});

let first_ts = rtp_packets.get(0).unwrap().timestamp;
let first_ts = rtp_packets.first().unwrap().timestamp;
body.rows(25.0, rtp_packets.len(), |row_ix, mut row| {
let packet = rtp_packets.get(row_ix).unwrap();

Expand Down

0 comments on commit 5c0599b

Please sign in to comment.