Commit Graph

504 Commits

Author SHA1 Message Date
cyqsimon
0a89c5aba5 Fix PR submitter detection (#342) 2023-12-08 15:49:41 +08:00
dependabot[bot]
da5fc0b6f6 chore(deps): bump sysinfo from 0.29.10 to 0.29.11 (#336)
Bumps [sysinfo](https://github.com/GuillaumeGomez/sysinfo) from 0.29.10 to 0.29.11.
- [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GuillaumeGomez/sysinfo/commits)

---
updated-dependencies:
- dependency-name: sysinfo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 10:41:46 +08:00
dependabot[bot]
fdfbdb860b chore(deps): bump tokio from 1.33.0 to 1.34.0 (#335)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.33.0 to 1.34.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.33.0...tokio-1.34.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 10:41:35 +08:00
dependabot[bot]
8919229ae8 chore(deps): bump itertools from 0.11.0 to 0.12.0 (#334)
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.11.0 to 0.12.0.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.11.0...v0.12.0)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 10:41:15 +08:00
dependabot[bot]
b310bb6f02 chore(deps): bump clap from 4.4.7 to 4.4.10 (#333)
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.7 to 4.4.10.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.7...v4.4.10)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-01 10:40:58 +08:00
dependabot[bot]
42e379a458 chore(deps): bump openssl from 0.10.57 to 0.10.60 (#332)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.57 to 0.10.60.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.57...openssl-v0.10.60)

---
updated-dependencies:
- dependency-name: openssl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 09:03:40 +08:00
cyqsimon
23827065c2 CI: ensure a changelog entry exists for each PR (#331)
* CI: ensure a changelog entry exists for each PR

* Write CHANGELOG

* Fix grep by adding `-P`
2023-11-12 14:32:46 +08:00
cyqsimon
16a6f9eec6 Display bandwidth in different unit families (#328)
* Allow selecting unit families

- Supported units are {binary,SI}-{bytes,bits}

* Fix typo

* Better error msg in the unreachable case

* - I can't believe I did this. Frankly, terrible.

* Add unit test

* Add peta&pebi units to be absolutely future-proof

* Minor code style improvement
2023-11-02 14:00:58 +08:00
cyqsimon
cf9b9f0634 Reorganise & cleanup (#329)
* Get rid of outdated, unused packaging files

* Create `/res`
2023-11-02 00:59:56 +08:00
cyqsimon
022eade156 Bump ratatui to 0.24.0 (#327) 2023-11-01 12:00:58 +08:00
dependabot[bot]
75a7b38e2c chore(deps): bump procfs from 0.15.1 to 0.16.0 (#321)
Bumps [procfs](https://github.com/eminence/procfs) from 0.15.1 to 0.16.0.
- [Release notes](https://github.com/eminence/procfs/releases)
- [Commits](https://github.com/eminence/procfs/compare/v0.15.1...v0.16.0)

---
updated-dependencies:
- dependency-name: procfs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 11:05:06 +08:00
dependabot[bot]
a8b051710a chore(deps): bump trust-dns-resolver from 0.23.1 to 0.23.2 (#319)
Bumps [trust-dns-resolver](https://github.com/bluejekyll/trust-dns) from 0.23.1 to 0.23.2.
- [Release notes](https://github.com/bluejekyll/trust-dns/releases)
- [Changelog](https://github.com/hickory-dns/hickory-dns/blob/v0.23.2/CHANGELOG.md)
- [Commits](https://github.com/bluejekyll/trust-dns/compare/v0.23.1...v0.23.2)

---
updated-dependencies:
- dependency-name: trust-dns-resolver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 10:25:54 +08:00
dependabot[bot]
a46c9337dc chore(deps): bump clap from 4.4.6 to 4.4.7 (#320)
Bumps [clap](https://github.com/clap-rs/clap) from 4.4.6 to 4.4.7.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.4.6...v4.4.7)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 10:25:43 +08:00
dependabot[bot]
d7850e609d chore(deps): bump regex from 1.10.1 to 1.10.2 (#325)
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.1...1.10.2)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 10:25:09 +08:00
dependabot[bot]
14a469b550 chore(deps): bump thiserror from 1.0.49 to 1.0.50 (#323)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.49 to 1.0.50.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.49...1.0.50)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 10:24:37 +08:00
dependabot[bot]
624ce926a9 chore(deps): bump http_req from 0.10.0 to 0.10.1 (#324)
Bumps [http_req](https://github.com/jayjamesjay/http_req) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/jayjamesjay/http_req/releases)
- [Commits](https://github.com/jayjamesjay/http_req/compare/v0.10.0...v0.10.1)

---
updated-dependencies:
- dependency-name: http_req
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 10:24:28 +08:00
dependabot[bot]
c15d6c3eab chore(deps): bump clap-verbosity-flag from 2.0.1 to 2.1.0 (#326)
Bumps [clap-verbosity-flag](https://github.com/clap-rs/clap-verbosity-flag) from 2.0.1 to 2.1.0.
- [Changelog](https://github.com/clap-rs/clap-verbosity-flag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap-verbosity-flag/compare/v2.0.1...v2.1.0)

---
updated-dependencies:
- dependency-name: clap-verbosity-flag
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-01 10:24:17 +08:00
cyqsimon
aef30c9bee Log unresolved processes in more detail + general refactor (#318)
* Refactor & reorganisation of `get_proc_name`

* Log both src & dst when we fail to resolve connection to process

- Per recommendation in https://github.com/imsnif/bandwhich/issues/196#issuecomment-1763278674
2023-11-01 01:44:27 +08:00
cyqsimon
62c0fbf128 Fix vague CLI option documentation; closes #314 (#316) 2023-10-29 21:25:49 +08:00
cyqsimon
2c49b0fc12 Use once_cell::sync::Lazy to make regex usage more ergonomic (#313) 2023-10-26 14:59:42 +08:00
cyqsimon
34713f699b Minor code style improvements (#312)
- Build regex only once using `once_cell::sync::Lazy`
- Reduce code duplication
2023-10-26 11:52:35 +08:00
cyqsimon
879e5676df Cargo.toml manifest cleanup (#311)
* Sort Cargo.toml according to style guide

- See https://doc.rust-lang.org/stable/style-guide/cargo.html

* Format `cfg` strings in Cargo.toml

* Narrow down `regex` dependency to more specific targets
2023-10-26 11:44:35 +08:00
cyqsimon
de791a1f62 Reset clippy levels
- Also denies `enum_glob_use`
2023-10-21 22:35:04 +08:00
cyqsimon
6fa77d2991 Refactor OsInputOutput (combine interfaces & frames into single Vec) (#310)
* Refactor `OsInputOutput` (combine interfaces & frames into single Vec)

* Add note on handling a separate failure case

* Reduce code duplication
2023-10-21 22:14:46 +08:00
cyqsimon
89e1140bea Make logging race-free using a global lock & macro (#309)
* Make logging race-free using a global lock & macro

* Fix clippy complaint

* Fix import for MacOS

* Make `mt_log` expand to an expression
2023-10-20 19:25:27 +08:00
cyqsimon
0c4987aa86 Table formatting logic overhaul (#305)
* Table formatting logic overhaul

- Columns now auto-expand and auto-shrink proportionally
- Data column selection logic is now set per-table
- Necessary boilerplate added to allow tables with more (or fewer) columns in the future

* Better naming: `TableLayout` -> `DisplayLayout`

* Fix clippy complaints

* Optimise layout cutoff widths

- These values are pretty much arbitrary. I'm open to further optimising them in the future.

* Updated test snapshots to match new layout settings

* Remove unnecessary logging

* Correct `debug_fn` impl for `column_selector`

* Further optimise bandwidth column display

* Update test snapshots

* Layout width preset minor adjustment
2023-10-19 16:55:04 +08:00
cyqsimon
d9cc84b373 Partially fix flaky tests (#308)
* Minor code style changes

* Disable rendering of timestamps in tests

* Update test snapshots

* Test everything with insta macros (no more `assert(_eq)?`)

- This has the benefit of creating snapshots for everything, allowing for later diffing

* Don't use `assert_debug_snapshot` for large string outputs

- This makes snapshots more human-inspectable

* Code style improvement on two tests

- `pause_by_space`
- `rearranged_by_tab`

* Minor code style improvements
2023-10-17 16:29:47 +08:00
cyqsimon
5d2ee96900 CI: amend #306
- I only installed npcap, but forgot to run the actual tests 🤦
2023-10-16 17:06:00 +08:00
cyqsimon
df171725cc CI: allow Windows tests to run if PR source is own repo (#306) 2023-10-16 16:37:44 +08:00
cyqsimon
f987636f78 Bump version to 0.21.1 v0.21.1 2023-10-16 09:27:28 +08:00
cyqsimon
6e923a785a Bump all dependencies (#304) 2023-10-16 09:24:36 +08:00
cyqsimon
bd007dc08d ... and I forgot to keep changelog again 2023-10-16 09:18:10 +08:00
cyqsimon
bc10c0789c Bump rustix dependencies
- Fixes #284
- See https://github.com/bytecodealliance/rustix/security/advisories/GHSA-c827-hfw6-qwvm
2023-10-16 08:13:32 +08:00
cyqsimon
b82383dc58 Set known orphan connections max size 2023-10-12 20:43:14 +08:00
cyqsimon
76956cfade Handle IPv4-mapped IPv6 addresses when resolving connection owner 2023-10-12 19:40:23 +08:00
cyqsimon
ea3e0d675f Reduce logging noise by omitting known orphan connections 2023-10-12 19:03:52 +08:00
cyqsimon
b1726fc1cc Forgot to allow write access to log file 2023-10-12 17:46:19 +08:00
cyqsimon
a9c199f812 Add logging when the process name fails to resolve 2023-10-12 17:35:43 +08:00
cyqsimon
1c996c38f4 Ignore connections that fail parsing instead of panicking on BSD (#288)
* Ignore connections that fail parsing instead of panicking on BSD

- Tentative fix for #217

* Log when a connection fails parsing

- I actually love unreadable code

* Fix clippy complaint
2023-10-11 19:45:48 +08:00
cyqsimon
3703c676f2 Fix clippy complaints 2023-10-11 19:12:37 +08:00
cyqsimon
94ada5db8a Add logging infrastructure (#302)
* Add logging dependencies

* Initialise logging
2023-10-11 18:16:56 +08:00
cyqsimon
5cb09cca19 Reduce repitition using default Opts 2023-10-11 17:42:06 +08:00
cyqsimon
5884c7322f Never use &Option in function signature 2023-10-11 17:20:14 +08:00
cyqsimon
b353c51ae8 Minor refactor of main.rs (#301)
* Move CLI structs to their own file

* `main` returns `Result` directly

* Slightly reduced nesting
2023-10-11 17:02:41 +08:00
cyqsimon
4a27da5d56 CI: upload binaries as long as build step succeeds 2023-10-09 01:47:01 +08:00
cyqsimon
6989ce222a CI: allow manual triggering 2023-10-09 01:26:19 +08:00
cyqsimon
8c6be282a5 CI: make insta generate new snapshots in CI
See https://github.com/mitsuhiko/insta/issues/411
2023-10-08 10:25:54 +08:00
cyqsimon
18721fcef6 CI: set --color=never for cargo-insta 2023-10-08 02:30:04 +08:00
cyqsimon
138af25943 CI: test using cargo-insta 2023-10-08 01:19:16 +08:00
cyqsimon
96cbe63a97 Explicitly name layout-* tests as so 2023-10-08 01:02:28 +08:00