Compare commits
160 Commits
Author | SHA1 | Date | |
---|---|---|---|
208823e0cc | |||
65c3026e89 | |||
2cc7c129fe | |||
487f230d59 | |||
f433df23fa | |||
055e127475 | |||
22c918b782 | |||
685b2a7fb9 | |||
b2519a7b2a | |||
37012d037a | |||
774fbaee5c | |||
89a12509ed | |||
f23f931cdd | |||
0255e1cfef | |||
f25b1695be | |||
ccbc0b3217 | |||
1fb7915b17 | |||
1f5315b79d | |||
7ce832a0ee | |||
f06ece3054 | |||
ad9383777f | |||
1c118b2318 | |||
91c9f363ff | |||
6bad4f9921 | |||
25c66d1a78 | |||
7a52f988e9 | |||
cb883df4f2 | |||
8e601254bf | |||
e566e42e46 | |||
ffac3c9bf0 | |||
bca4b7e5f7 | |||
65c1eb6ec6 | |||
fa5753ed3e | |||
0f5a1bb72a | |||
eb2507dd8d | |||
e4ba404259 | |||
f249b29561 | |||
96ec04cd41 | |||
b8e5a96e60 | |||
88aafc15d9 | |||
73c8a6eb44 | |||
4b6215a6dc | |||
6aa2926746 | |||
b87703d285 | |||
2818a34862 | |||
e2559ce7a6 | |||
a6d07e18dc | |||
587fad64f7 | |||
595c2f908b | |||
a67b227d8c | |||
2107e04155 | |||
4e611782df | |||
c22ab20177 | |||
2d0d2f113f | |||
47652dcb9d | |||
0df1ec2133 | |||
512f6c8b8f | |||
f143112ea7 | |||
85affe6fda | |||
ce7fbc5de5 | |||
946af19d5b | |||
92fbc69b7e | |||
865c5deda2 | |||
7731d17bac | |||
d9b131378b | |||
ccce48e3dd | |||
89747b349d | |||
defb019000 | |||
3b48e75392 | |||
3c7b1398ce | |||
caeed57eab | |||
c060374e05 | |||
5a48a7f34c | |||
9b417a1686 | |||
5514074861 | |||
e481f4c2cf | |||
96c02d824b | |||
65f823ede6 | |||
e8406e9271 | |||
65a51cdbd2 | |||
d533094ac3 | |||
1f729e3506 | |||
275d284705 | |||
94c216aff3 | |||
f68e7f2eb2 | |||
163dca53f2 | |||
4a0e9f9535 | |||
f66b97641e | |||
b91758b70b | |||
8901d3b5e5 | |||
3f5c1940b7 | |||
f669613b0e | |||
66028e684d | |||
cc559ad894 | |||
efa814c70a | |||
db47c17b52 | |||
7a65617ca9 | |||
ceaaa5b501 | |||
3ff3acb952 | |||
2ac82592a0 | |||
9950bae9b1 | |||
7b8f06ce0c | |||
9d96bfdc71 | |||
dc65630dc5 | |||
f09541c080 | |||
3ee149553f | |||
a9d823a8e2 | |||
f8a1d5011f | |||
289b1fa50a | |||
c12d13c16b | |||
131a31eeca | |||
02212266a4 | |||
d73fbe6189 | |||
da9741e215 | |||
be7193a2f2 | |||
d23578373d | |||
6507ddf718 | |||
0f7206e51a | |||
ef5339f595 | |||
e5a2949172 | |||
7b6d6da5fd | |||
b321f36e9b | |||
91ef43edef | |||
7c517d31f7 | |||
ab114e051c | |||
a7da23a81b | |||
3da51a43be | |||
bbe9be5ba1 | |||
bdfc29dcb1 | |||
d17fd336bc | |||
118c550c2b | |||
5b5f621cac | |||
686e82a3ec | |||
02495f1d44 | |||
aad0dda63b | |||
a809fb2f62 | |||
bed2d4d3a0 | |||
d26fadb5d7 | |||
bb07f66f5b | |||
476b55dc3e | |||
53a3cb2f02 | |||
483612e013 | |||
3dc354e7e3 | |||
c958b82b8f | |||
c3bd49874b | |||
2a62090b53 | |||
576df1661d | |||
13942a5050 | |||
a2ce3afddb | |||
cba765f1d9 | |||
b97bd1e575 | |||
eeabbb7c31 | |||
ef01b75037 | |||
a0d3301acc | |||
1117244b11 | |||
88cc838969 | |||
31b06d226e | |||
79dc354b12 | |||
db2a8bd330 | |||
f125c2665e |
350
Cargo.lock
generated
350
Cargo.lock
generated
@ -2,6 +2,16 @@
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "Inflector"
|
||||
version = "0.11.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"regex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.24.1"
|
||||
@ -92,10 +102,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6"
|
||||
|
||||
[[package]]
|
||||
name = "ascii"
|
||||
version = "0.7.1"
|
||||
name = "arc-swap"
|
||||
version = "1.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ae7d751998c189c1d4468cf0a39bb2eae052a9c58d50ebb3b9591ee3813ad50"
|
||||
checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457"
|
||||
|
||||
[[package]]
|
||||
name = "async-channel"
|
||||
@ -393,7 +403,7 @@ dependencies = [
|
||||
"ansi_term",
|
||||
"atty",
|
||||
"bitflags 1.3.2",
|
||||
"strsim",
|
||||
"strsim 0.8.0",
|
||||
"textwrap",
|
||||
"unicode-width",
|
||||
"vec_map",
|
||||
@ -401,12 +411,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "combine"
|
||||
version = "2.5.2"
|
||||
version = "4.6.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1645a65a99c7c8d345761f4b75a6ffe5be3b3b27a93ee731fccc5050ba6be97c"
|
||||
checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd"
|
||||
dependencies = [
|
||||
"ascii",
|
||||
"byteorder",
|
||||
"bytes",
|
||||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -542,37 +552,70 @@ dependencies = [
|
||||
"syn 2.0.77",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling"
|
||||
version = "0.14.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"darling_macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_core"
|
||||
version = "0.14.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
|
||||
dependencies = [
|
||||
"fnv",
|
||||
"ident_case",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"strsim 0.10.0",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "darling_macro"
|
||||
version = "0.14.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
|
||||
dependencies = [
|
||||
"darling_core",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "derivative"
|
||||
version = "2.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "destructure_traitobject"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c877555693c14d2f84191cfd3ad8582790fc52b5e2274b40b59cf5f5cea25c7"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.9.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"humantime",
|
||||
"log 0.4.22",
|
||||
"regex",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "equivalent"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
||||
|
||||
[[package]]
|
||||
name = "error-chain"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8"
|
||||
|
||||
[[package]]
|
||||
name = "event-listener"
|
||||
version = "5.3.1"
|
||||
@ -594,12 +637,6 @@ dependencies = [
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fast32"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27ea9bdb2356e5a92403cf23ac493f9b43bd71e4ffd0f800862b841dd723994c"
|
||||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.1.1"
|
||||
@ -640,21 +677,23 @@ dependencies = [
|
||||
"clap",
|
||||
"console-subscriber",
|
||||
"crossbeam-channel",
|
||||
"env_logger",
|
||||
"fast32",
|
||||
"futures",
|
||||
"generic-array",
|
||||
"hex",
|
||||
"jni",
|
||||
"log 0.4.22",
|
||||
"jni 0.20.0",
|
||||
"log",
|
||||
"log4rs",
|
||||
"network-interface",
|
||||
"nonblock",
|
||||
"packet",
|
||||
"rand",
|
||||
"robusta_jni",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_yaml",
|
||||
"socket2 0.4.10",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tun2",
|
||||
"x25519-dalek",
|
||||
]
|
||||
@ -998,6 +1037,12 @@ dependencies = [
|
||||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ident_case"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
||||
|
||||
[[package]]
|
||||
name = "indexmap"
|
||||
version = "1.9.3"
|
||||
@ -1050,22 +1095,37 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
|
||||
|
||||
[[package]]
|
||||
name = "jni"
|
||||
version = "0.5.3"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cffc930ce6a38a4013e30567b559bdc79f601013ba4a81e65dbda9207263efd4"
|
||||
checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec"
|
||||
dependencies = [
|
||||
"cesu8",
|
||||
"combine",
|
||||
"error-chain",
|
||||
"jni-sys",
|
||||
"log 0.3.9",
|
||||
"log",
|
||||
"thiserror",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c"
|
||||
dependencies = [
|
||||
"cesu8",
|
||||
"combine",
|
||||
"jni-sys",
|
||||
"log",
|
||||
"thiserror",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "jni-sys"
|
||||
version = "0.2.5"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "de0aaaba8809ab8d83a53fe2b313b996b79e8632b855eae9f70ad4323dca91b8"
|
||||
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
|
||||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
@ -1108,20 +1168,48 @@ dependencies = [
|
||||
"scopeguard",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.3.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
|
||||
dependencies = [
|
||||
"log 0.4.22",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "log-mdc"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a94d21414c1f4a51209ad204c1776a3d0765002c76c6abcb602a6f09f1e881c7"
|
||||
|
||||
[[package]]
|
||||
name = "log4rs"
|
||||
version = "1.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0816135ae15bd0391cf284eab37e6e3ee0a6ee63d2ceeb659862bd8d0a984ca6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"arc-swap",
|
||||
"chrono",
|
||||
"derivative",
|
||||
"fnv",
|
||||
"humantime",
|
||||
"libc",
|
||||
"log",
|
||||
"log-mdc",
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
"rand",
|
||||
"serde",
|
||||
"serde-value",
|
||||
"serde_json",
|
||||
"serde_yaml",
|
||||
"thiserror",
|
||||
"thread-id",
|
||||
"typemap-ors",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "matchers"
|
||||
@ -1211,6 +1299,15 @@ dependencies = [
|
||||
"minimal-lexical",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nonblock"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "51c7a4f22e5f2e2bd805d6ab56f1ae87eb1815673e1b452048896fb687a8a3d4"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.19"
|
||||
@ -1241,6 +1338,15 @@ version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
|
||||
|
||||
[[package]]
|
||||
name = "ordered-float"
|
||||
version = "2.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "packet"
|
||||
version = "0.1.4"
|
||||
@ -1282,6 +1388,12 @@ dependencies = [
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||
|
||||
[[package]]
|
||||
name = "percent-encoding"
|
||||
version = "2.3.1"
|
||||
@ -1370,6 +1482,29 @@ dependencies = [
|
||||
"zerocopy",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
|
||||
dependencies = [
|
||||
"proc-macro-error-attr",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-error-attr"
|
||||
version = "1.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.86"
|
||||
@ -1503,6 +1638,33 @@ version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
|
||||
|
||||
[[package]]
|
||||
name = "robusta-codegen"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ffb512b451472948a204452dfad582bdc48d69caacdd3b1b4571d5e3f11707f3"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"darling",
|
||||
"proc-macro-error",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"rand",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "robusta_jni"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c080146e0cc733697fe500413871142af91bd879641205c2febbe5f982f304e3"
|
||||
dependencies = [
|
||||
"jni 0.19.0",
|
||||
"paste",
|
||||
"robusta-codegen",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.24"
|
||||
@ -1530,6 +1692,15 @@ version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
@ -1551,6 +1722,16 @@ dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde-value"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c"
|
||||
dependencies = [
|
||||
"ordered-float",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.210"
|
||||
@ -1652,12 +1833,24 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
||||
|
||||
[[package]]
|
||||
name = "strsim"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.6.1"
|
||||
@ -1698,15 +1891,6 @@ version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
|
||||
|
||||
[[package]]
|
||||
name = "termcolor"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
||||
dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.11.0"
|
||||
@ -1736,6 +1920,16 @@ dependencies = [
|
||||
"syn 2.0.77",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread-id"
|
||||
version = "4.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfe8f25bbdd100db7e1d34acf7fd2dc59c4bf8f7483f505eaa7d4f12f76cc0ea"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "1.1.8"
|
||||
@ -1927,7 +2121,7 @@ dependencies = [
|
||||
"futures-core",
|
||||
"ipnet",
|
||||
"libc",
|
||||
"log 0.4.22",
|
||||
"log",
|
||||
"nix",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
@ -1936,6 +2130,15 @@ dependencies = [
|
||||
"wintun-bindings",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typemap-ors"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a68c24b707f02dd18f1e4ccceb9d49f2058c2fb86384ef9972592904d7a28867"
|
||||
dependencies = [
|
||||
"unsafe-any-ors",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.17.0"
|
||||
@ -1964,6 +2167,15 @@ dependencies = [
|
||||
"subtle",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unsafe-any-ors"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e0a303d30665362d9680d7d91d78b23f5f899504d4f08b3c4cf08d055d87c0ad"
|
||||
dependencies = [
|
||||
"destructure_traitobject",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unsafe-libyaml"
|
||||
version = "0.2.11"
|
||||
@ -1988,6 +2200,16 @@ version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
|
||||
dependencies = [
|
||||
"same-file",
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "want"
|
||||
version = "0.3.1"
|
||||
@ -2021,7 +2243,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log 0.4.22",
|
||||
"log",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@ -2190,7 +2412,7 @@ dependencies = [
|
||||
"c2rust-bitfields",
|
||||
"futures",
|
||||
"libloading",
|
||||
"log 0.4.22",
|
||||
"log",
|
||||
"thiserror",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
12
Cargo.toml
12
Cargo.toml
@ -8,10 +8,15 @@ keywords = ["tun", "network", "tunnel", "vpn"]
|
||||
categories = ["network-programming", "asynchronous"]
|
||||
readme = "README.md"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
clap = "2.33"
|
||||
aes-gcm = "0.10.3"
|
||||
tokio = { version = "1", features = ["full", "signal", "tracing"] }
|
||||
tokio-util = "0.7.12"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0.190"
|
||||
rand = { version = "0.8.5", features = ["small_rng", "getrandom", "std_rng"] }
|
||||
@ -19,7 +24,6 @@ block-modes = "0.8"
|
||||
block-padding = "0.2"
|
||||
generic-array = "0.14"
|
||||
socket2 = "0.4"
|
||||
env_logger = "0.9"
|
||||
log = "0.4.20"
|
||||
futures = "0.3.30"
|
||||
tun2 = { version = "3.1.4", features = ["async"] }
|
||||
@ -32,7 +36,9 @@ base64 = "0.22.1"
|
||||
chrono = "0.4.38"
|
||||
console-subscriber = "0.4.0"
|
||||
network-interface = "2.0.0"
|
||||
fast32 = "1.0.2"
|
||||
log4rs = "1.3.0"
|
||||
|
||||
[target.'cfg(target_os="android")'.dependencies]
|
||||
jni = { version = "0.5", default-features = false }
|
||||
jni = "^0.20"
|
||||
robusta_jni = "0.2.2"
|
||||
nonblock = "0.2.0"
|
10
Jenkinsfile
vendored
Normal file
10
Jenkinsfile
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage('Build Project') {
|
||||
steps {
|
||||
build "Frida-android-binaries"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
119
src/client.rs
119
src/client.rs
@ -1,13 +1,18 @@
|
||||
use crossbeam_channel::unbounded;
|
||||
//use crossbeam_channel::unbounded;
|
||||
use socket2::SockAddr;
|
||||
use tokio::{net::UdpSocket, sync::Mutex};
|
||||
use std::{io::{Read, Write}, net::SocketAddr};
|
||||
use tokio::{net::UdpSocket, sync::{Mutex, mpsc}, io::{BufReader, BufWriter, AsyncWriteExt, AsyncReadExt}, fs::File};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use base64::prelude::*;
|
||||
use log::{error, info, warn};
|
||||
use std::sync::Arc;
|
||||
use std::net::Ipv4Addr;
|
||||
use x25519_dalek::{PublicKey, StaticSecret};
|
||||
use std::process::Command;
|
||||
use std::{
|
||||
io::{self, Read, Write},
|
||||
net::SocketAddr,
|
||||
process::Command,
|
||||
os::unix::io::FromRawFd,
|
||||
};
|
||||
use aes_gcm::{
|
||||
aead::{Aead, AeadCore, KeyInit, OsRng},
|
||||
Aes256Gcm, Nonce};
|
||||
@ -16,51 +21,67 @@ use crate::config::ClientConfiguration;
|
||||
use crate::udp::{UDPVpnPacket, UDPVpnHandshake, UDPSerializable};
|
||||
use network_interface::NetworkInterface;
|
||||
use network_interface::NetworkInterfaceConfig;
|
||||
use robusta_jni::jni::JNIEnv;
|
||||
use crate::jni::FridaLib;
|
||||
|
||||
pub async fn client_mode(client_config: ClientConfiguration, fd: i32) {
|
||||
pub async fn client_mode(client_config: ClientConfiguration, fd: i32, close_token: CancellationToken) {
|
||||
info!("Starting client...");
|
||||
|
||||
let dr_cancel: CancellationToken = CancellationToken::new();
|
||||
let sr_cancel: CancellationToken = CancellationToken::new();
|
||||
|
||||
let sock = UdpSocket::bind("0.0.0.0:25565").await.unwrap();
|
||||
sock.connect(&client_config.server.endpoint).await.unwrap();
|
||||
|
||||
let mut config = tun2::Configuration::default();
|
||||
info!("address: {:?}", &client_config.client.address);
|
||||
config.raw_fd(fd).up();
|
||||
|
||||
let dev = tun2::create(&config).unwrap();
|
||||
let (mut dev_reader, mut dev_writer) = dev.split();
|
||||
info!("FD: {:?}", &fd);
|
||||
let mut dev = unsafe { File::from_raw_fd(fd) };
|
||||
let mut dev1 = unsafe { File::from_raw_fd(fd) };
|
||||
let mut dev_reader = BufReader::new(dev);
|
||||
let mut dev_writer = BufWriter::new(dev1);
|
||||
|
||||
let sock_rec = Arc::new(sock);
|
||||
let sock_snd = sock_rec.clone();
|
||||
|
||||
let (tx, rx) = unbounded::<Vec<u8>>();
|
||||
let (dx, mx) = unbounded::<Vec<u8>>();
|
||||
let (tx, mut rx) = mpsc::unbounded_channel::<Vec<u8>>();
|
||||
let (dx, mut mx) = mpsc::unbounded_channel::<Vec<u8>>();
|
||||
|
||||
let cipher_shared = Arc::new(Mutex::new(None));
|
||||
let cipher_shared: Arc<Mutex<Option<x25519_dalek::SharedSecret>>> = Arc::new(Mutex::new(None));
|
||||
|
||||
let tun_writer_task = tokio::spawn(async move {
|
||||
while let Ok(bytes) = rx.recv() {
|
||||
info!("Write to tun");
|
||||
dev_writer.write_all(&bytes).unwrap();
|
||||
let dr_cc = dr_cancel.clone();
|
||||
let dev_read_task = tokio::spawn(async move {
|
||||
let mut buf = vec![0; 1400]; // mtu
|
||||
loop {
|
||||
tokio::select! {
|
||||
_ = dr_cc.cancelled() => {
|
||||
info!("Cancellation token has been thrown dev_read_task");
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
let tun_reader_task = tokio::spawn(async move {
|
||||
let mut buf = vec![0; 8192];
|
||||
while let Ok(n) = dev_reader.read(&mut buf) {
|
||||
info!("Read from tun");
|
||||
rr = dev_reader.read(&mut buf) => {
|
||||
if let Ok(n) = rr {
|
||||
info!("Read from tun."); // hex::encode(&buf[..n])
|
||||
dx.send(buf[..n].to_vec()).unwrap();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
let priv_key = BASE64_STANDARD.decode(client_config.client.private_key).unwrap();
|
||||
|
||||
let cipher_shared_clone = cipher_shared.clone();
|
||||
let socket_reader_task = tokio::spawn(async move {
|
||||
let sr_cc = sr_cancel.clone();
|
||||
let sock_read_task = tokio::spawn(async move {
|
||||
let mut buf = vec![0; 4096];
|
||||
|
||||
loop {
|
||||
if let Ok(l) = sock_rec.recv(&mut buf).await {
|
||||
tokio::select! {
|
||||
_ = sr_cc.cancelled() => {
|
||||
info!("Cancellation token has been thrown sock_read_task");
|
||||
return;
|
||||
}
|
||||
rr = sock_rec.recv(&mut buf) => {
|
||||
if let Ok(l) = rr {
|
||||
info!("Read from socket");
|
||||
let mut s_cipher = cipher_shared_clone.lock().await;
|
||||
match buf.first() {
|
||||
Some(h) => {
|
||||
@ -85,28 +106,27 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32) {
|
||||
let nonce = Nonce::clone_from_slice(&wrapped_packet.nonce);
|
||||
match aes.decrypt(&nonce, &wrapped_packet.data[..]) {
|
||||
Ok(decrypted) => { let _ = tx.send(decrypted); },
|
||||
Err(error) => error!("Decryption error! {:?}", error)
|
||||
Err(error) => { error!("Decryption error! {:?}", error); }
|
||||
}
|
||||
} else {
|
||||
warn!("There is no static_secret");
|
||||
}
|
||||
}, // payload
|
||||
2 => info!("Got keepalive packet"),
|
||||
_ => error!("Unexpected header value.")
|
||||
2 => { info!("Got keepalive packet"); },
|
||||
_ => { error!("Unexpected header value."); }
|
||||
}
|
||||
},
|
||||
None => error!("There is no header.")
|
||||
None => { error!("There is no header."); }
|
||||
}
|
||||
drop(s_cipher);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
let s_cipher = cipher_shared.clone();
|
||||
let pkey = BASE64_STANDARD.decode(client_config.client.public_key).unwrap();
|
||||
let handshake = UDPVpnHandshake{ public_key: pkey, request_ip: client_config.client.address.parse::<Ipv4Addr>().unwrap() };
|
||||
|
||||
let socket_writer_task = tokio::spawn(async move {
|
||||
let mut nz = 0;
|
||||
while nz < 25 {
|
||||
sock_snd.send(&handshake.serialize()).await.unwrap();
|
||||
@ -114,8 +134,30 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32) {
|
||||
}
|
||||
//sock_snd.send(&handshake.serialize()).await.unwrap();
|
||||
|
||||
let s_cipher = cipher_shared.clone();
|
||||
loop {
|
||||
if let Ok(bytes) = mx.recv() {
|
||||
tokio::select! {
|
||||
_ = close_token.cancelled() => {
|
||||
info!("Cancellation token has been thrown");
|
||||
sr_cancel.cancel();
|
||||
dr_cancel.cancel();
|
||||
//dev_read_task.await;
|
||||
//sock_read_task.await;
|
||||
return;
|
||||
}
|
||||
rr = rx.recv() => {
|
||||
if let Some(bytes) = rr {
|
||||
info!("Write to tun.");
|
||||
if let Err(e) = dev_writer.write_all(&bytes).await {
|
||||
error!("Writing error: {:?}", e);
|
||||
}
|
||||
if let Err(e) = dev_writer.flush().await {
|
||||
error!("Flushing error: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
rr2 = mx.recv() => {
|
||||
if let Some(bytes) = rr2 {
|
||||
let s_c = s_cipher.lock().await;
|
||||
|
||||
if s_c.is_some() {
|
||||
@ -126,17 +168,16 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32) {
|
||||
if let Ok(ciphered_d) = ciphered_data {
|
||||
let vpn_packet = UDPVpnPacket{ data: ciphered_d, nonce: nonce.to_vec()};
|
||||
let serialized_data = vpn_packet.serialize();
|
||||
info!("Sent to socket");
|
||||
info!("Write to socket");
|
||||
sock_snd.send(&serialized_data).await.unwrap();
|
||||
} else {
|
||||
error!("Socket encryption failed.");
|
||||
}
|
||||
} else {
|
||||
warn!("There is no shared_secret in main loop");
|
||||
error!("There is no shared_secret in main loop");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
tokio::join!(tun_writer_task, tun_reader_task, socket_writer_task, socket_reader_task);
|
||||
};
|
||||
}
|
||||
}
|
127
src/main.rs
127
src/main.rs
@ -1,42 +1,101 @@
|
||||
use std::{fs, net::{Ipv4Addr}, str};
|
||||
use clap::{App, Arg, ArgMatches};
|
||||
use env_logger::Builder;
|
||||
use log::{error, LevelFilter};
|
||||
use crate::config::{ ServerConfiguration, ClientConfiguration, ObfsProtocol, ServerPeer };
|
||||
use fast32::base32::RFC4648;
|
||||
#![cfg(target_os = "android")]
|
||||
|
||||
use ::jni::objects::GlobalRef;
|
||||
use ::jni::JavaVM;
|
||||
use robusta_jni::bridge;
|
||||
use std::sync::OnceLock;
|
||||
use robusta_jni::jni::JNIEnv;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
mod config;
|
||||
mod client;
|
||||
mod udp;
|
||||
mod mobile;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// Initialize the logger with 'info' as the default level
|
||||
Builder::new()
|
||||
.filter(None, LevelFilter::Info)
|
||||
.init();
|
||||
static TUN_QUIT: std::sync::Mutex<Option<tokio_util::sync::CancellationToken>> = std::sync::Mutex::new(None);
|
||||
|
||||
let matches = App::new("Frida")
|
||||
.version("0.1.2")
|
||||
.author("alterwain")
|
||||
.about("VPN software (android port)")
|
||||
.arg(Arg::with_name("config")
|
||||
.long("config")
|
||||
.required(true)
|
||||
.value_name("B32_RAW")
|
||||
.help("Configuration file data (base32 encoded)")
|
||||
.takes_value(true))
|
||||
.arg(Arg::with_name("fd")
|
||||
.long("fd")
|
||||
.required(true)
|
||||
.value_name("INT")
|
||||
.help("File descriptor int")
|
||||
.takes_value(true))
|
||||
.get_matches();
|
||||
#[bridge]
|
||||
mod jni {
|
||||
use jni::objects::{GlobalRef, JObject, JValue, JString};
|
||||
use jni::sys::{jboolean, jchar, jint, jstring};
|
||||
use log::{info, trace};
|
||||
use log::LevelFilter;
|
||||
use log4rs::append::file::FileAppender;
|
||||
use log4rs::encode::pattern::PatternEncoder;
|
||||
use log4rs::config::{Appender, Config, Root};
|
||||
use robusta_jni::convert::{IntoJavaValue, Signature, TryFromJavaValue, TryIntoJavaValue};
|
||||
use robusta_jni::jni::errors::Result as JniResult;
|
||||
use robusta_jni::jni::objects::AutoLocal;
|
||||
use robusta_jni::jni::JNIEnv;
|
||||
use crate::mobile;
|
||||
use crate::TUN_QUIT;
|
||||
use std::fs::File;
|
||||
|
||||
let cfg_raw = matches.value_of("config").unwrap();
|
||||
|
||||
let config: ClientConfiguration = serde_yaml::from_slice(RFC4648.decode(cfg_raw.as_bytes()).unwrap().as_slice()).expect("Bad client config file structure");
|
||||
|
||||
client::client_mode(config, matches.value_of("fd").unwrap().parse().unwrap()).await;
|
||||
#[derive(Signature, TryIntoJavaValue, IntoJavaValue, TryFromJavaValue)]
|
||||
#[package(com.alterdekim.frida)]
|
||||
pub struct FridaLib<'env: 'borrow, 'borrow> {
|
||||
#[instance]
|
||||
raw: AutoLocal<'env, 'borrow>,
|
||||
}
|
||||
|
||||
impl<'env: 'borrow, 'borrow> FridaLib<'env, 'borrow> {
|
||||
pub extern "jni" fn start(self, env: &JNIEnv, config_b32: String,
|
||||
tun_fd: i32,
|
||||
close_fd_on_drop: bool,
|
||||
temp_file: String) -> JniResult<i32> {
|
||||
|
||||
let logfile = FileAppender::builder()
|
||||
.encoder(Box::new(PatternEncoder::new("{l} - {m}\n")))
|
||||
.build(&temp_file).unwrap();
|
||||
|
||||
let config = Config::builder()
|
||||
.appender(Appender::builder().build("logfile", Box::new(logfile)))
|
||||
.build(Root::builder()
|
||||
.appender("logfile")
|
||||
.build(LevelFilter::Info)).unwrap();
|
||||
|
||||
log4rs::init_config(config);
|
||||
|
||||
info!("Hello, world!");
|
||||
|
||||
let close_token = tokio_util::sync::CancellationToken::new();
|
||||
if let Ok(mut l) = TUN_QUIT.lock() {
|
||||
if l.is_some() {
|
||||
return Ok(-1);
|
||||
}
|
||||
*l = Some(close_token.clone());
|
||||
} else {
|
||||
return Ok(-2);
|
||||
}
|
||||
|
||||
let main_loop = async move {
|
||||
mobile::mobile_run(config_b32, close_fd_on_drop, tun_fd, /*env,*/ close_token).await;
|
||||
};
|
||||
|
||||
let exit_code = match tokio::runtime::Builder::new_multi_thread().enable_all().build() {
|
||||
Err(_e) => -3,
|
||||
Ok(rt) => { rt.block_on(main_loop); -4 } //spawn
|
||||
};
|
||||
|
||||
Ok(exit_code)
|
||||
}
|
||||
|
||||
pub extern "jni" fn stop(self, env: &JNIEnv) -> JniResult<i32> {
|
||||
if let Ok(mut l) = TUN_QUIT.lock() {
|
||||
if let Some(close_token) = l.take() {
|
||||
close_token.cancel();
|
||||
return Ok(0);
|
||||
}
|
||||
}
|
||||
Ok(-1)
|
||||
}
|
||||
|
||||
pub extern "java" fn traceFromNative(
|
||||
env: &JNIEnv,
|
||||
text: String,
|
||||
) -> JniResult<()> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
11
src/mobile.rs
Normal file
11
src/mobile.rs
Normal file
@ -0,0 +1,11 @@
|
||||
use log::{error, info, warn};
|
||||
use crate::config::{ ServerConfiguration, ClientConfiguration, ObfsProtocol, ServerPeer };
|
||||
use crate::client;
|
||||
use jni::sys::jint;
|
||||
use tokio::runtime::Runtime;
|
||||
use robusta_jni::jni::JNIEnv;
|
||||
|
||||
pub async fn mobile_run(cfg_raw: String, close_fd_on_drop: bool, tun_fd: i32, /*env: &JNIEnv<'_>,*/ close_token: tokio_util::sync::CancellationToken) {
|
||||
let config: ClientConfiguration = serde_yaml::from_slice(hex::decode(cfg_raw).unwrap().as_slice()).expect("Bad client config file structure");
|
||||
client::client_mode(config, tun_fd, /*env,*/ close_token).await;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user