forked from domcyrus/rustnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
197 lines (176 loc) · 5.54 KB
/
Cargo.toml
File metadata and controls
197 lines (176 loc) · 5.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
[package]
name = "rustnet-monitor"
version = "1.1.0"
authors = ["domcyrus"]
edition = "2024"
rust-version = "1.88.0" # Let-chains require Rust 1.88.0+
description = "A cross-platform network monitoring terminal UI tool built with Rust"
repository = "https://github.com/domcyrus/rustnet"
homepage = "https://github.com/domcyrus/rustnet"
documentation = "https://docs.rs/rustnet-monitor"
readme = "README.md"
license = "Apache-2.0"
keywords = ["network", "monitoring", "tui", "terminal", "packet-capture"]
categories = ["command-line-utilities", "network-programming", "visualization"]
exclude = [".github/", "scripts/", "tests/", "*.log", "target/", ".gitignore"]
[lib]
name = "rustnet_monitor"
path = "src/lib.rs"
[[bin]]
name = "rustnet"
path = "src/main.rs"
[dependencies]
anyhow = "1.0"
libc = "0.2"
arboard = { version = "3.6", features = ["wayland-data-control"] }
crossterm = "0.29"
crossbeam = "0.8"
dashmap = "6.1"
dns-lookup = "3.0"
log = "0.4"
pcap = "2.4.0"
pnet_datalink = "0.35"
clap = { version = "4.6", features = ["derive"] }
simplelog = "0.12"
chrono = "0.4"
ratatui = { version = "0.30", features = ["all-widgets"] }
ring = "0.17"
aes = "0.8"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
flate2 = "1"
maxminddb = "0.27"
regex-lite = "0.1"
[target.'cfg(target_os = "linux")'.dependencies]
procfs = "0.18"
libbpf-rs = { version = "0.26", optional = true }
landlock = { version = "0.4", optional = true }
caps = { version = "0.5", optional = true }
[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", features = [
"Win32_Foundation",
"Win32_NetworkManagement_IpHelper",
"Win32_NetworkManagement_Ndis",
"Win32_Networking_WinSock",
"Win32_Security",
"Win32_System_LibraryLoader",
"Win32_System_Threading",
] }
# FreeBSD support uses the system's sockstat command for process lookup
# and native libpcap (via pcap crate) for packet capture.
# No additional FreeBSD-specific dependencies required at this time.
[build-dependencies]
anyhow = "1.0"
clap = { version = "4.6", features = ["derive"] }
clap_complete = "4.6"
clap_mangen = "0.2"
[target.'cfg(windows)'.build-dependencies]
http_req = "0.14"
zip = "8.2"
windows = { version = "0.62", features = [
"Win32_Foundation",
"Win32_NetworkManagement_IpHelper",
"Win32_NetworkManagement_Ndis",
"Win32_Networking_WinSock",
"Win32_Security",
"Win32_System_LibraryLoader",
"Win32_System_Threading",
] }
[target.'cfg(target_os = "linux")'.build-dependencies]
libbpf-cargo = { version = "0.26", optional = true }
[features]
# eBPF is enabled by default for enhanced performance on Linux.
# On non-Linux platforms, this feature has no effect as all eBPF code
# and dependencies are Linux-specific (guarded by target_os checks).
# Landlock provides security sandboxing on Linux 5.13+.
default = ["ebpf", "landlock"]
linux-default = ["ebpf"] # Deprecated: kept for backwards compatibility
ebpf = ["libbpf-rs", "dep:libbpf-cargo"]
landlock = ["dep:landlock", "dep:caps"]
# Minimal cross configuration to override dependency conflicts
[workspace.metadata.cross.build.env]
passthrough = [
"CARGO_INCREMENTAL",
"CARGO_NET_RETRY",
"CARGO_NET_TIMEOUT",
]
[package.metadata.deb]
maintainer = "domcyrus <domcyrus@example.com>"
copyright = "2024, domcyrus <domcyrus@example.com>"
license-file = ["LICENSE", "4"]
extended-description = """\
A real-time network monitoring terminal UI tool built with Rust.
Features:
- Real-time network monitoring with detailed state information
- Deep packet inspection for HTTP/HTTPS, DNS, SSH, and QUIC
- Connection lifecycle management with configurable timeouts
- Process identification and service name resolution
- Advanced filtering with vim/fzf-style search
- Multi-threaded processing for optimal performance
- eBPF-enhanced process detection on Linux (with automatic fallback)
"""
depends = "libpcap0.8, libelf1"
section = "net"
priority = "optional"
assets = [
[
"target/release/rustnet",
"usr/bin/",
"755",
],
[
"README.md",
"usr/share/doc/rustnet-monitor/",
"644",
],
[
"assets/services",
"usr/share/rustnet-monitor/",
"644",
],
[
"resources/packaging/linux/graphics/rustnet.png",
"usr/share/icons/hicolor/256x256/apps/",
"644",
],
[
"resources/packaging/linux/rustnet.desktop",
"usr/share/applications/",
"644",
],
]
conf-files = []
[package.metadata.generate-rpm]
assets = [
{ source = "target/release/rustnet", dest = "/usr/bin/rustnet", mode = "755" },
{ source = "README.md", dest = "/usr/share/doc/rustnet-monitor/README.md", mode = "644" },
{ source = "assets/services", dest = "/usr/share/rustnet-monitor/services", mode = "644" },
{ source = "resources/packaging/linux/graphics/rustnet.png", dest = "/usr/share/icons/hicolor/256x256/apps/rustnet.png", mode = "644" },
{ source = "resources/packaging/linux/rustnet.desktop", dest = "/usr/share/applications/rustnet.desktop", mode = "644" },
]
[package.metadata.generate-rpm.requires]
libpcap = "*"
elfutils-libelf = "*"
[package.metadata.wix]
upgrade-guid = "455c823b-9665-43e0-baa4-bd0fcb762463"
path-guid = "d3a2452e-f04f-4d4f-becf-c3580f49f8fc"
license = false
eula = false
[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
[[bench]]
name = "packet_parsing"
harness = false
[[bench]]
name = "connection_merge"
harness = false
[[bench]]
name = "snapshot"
harness = false
[profile.release]
lto = "thin"
codegen-units = 1
[profile.profiling]
inherits = "release"
debug = 2
strip = false