diff --git a/.cargo/config.toml b/.cargo/config.toml index fb101fd..3d9f20d 100755 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,9 +1,7 @@ -[target.x86_64-unknown-linux-musl] -linker = "x86_64-linux-musl-gcc" - [target.aarch64-unknown-linux-gnu] linker = "aarch64-linux-gnu-gcc" -ar = "aarch64-linux-gnu-ar" +ar = "aarch64-linux-gnu-gcc" +strip = { path = "aarch64-linux-gnu-strip" } # ranlib = "aarch64-linux-gnu-ranlib" [target.x86_64-pc-windows-gnu] diff --git a/Cargo.lock b/Cargo.lock index e9a603c..c00db28 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - [[package]] name = "aes" version = "0.8.4" @@ -35,7 +20,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", - "getrandom 0.3.3", + "getrandom 0.3.4", "once_cell", "version_check", "zerocopy", @@ -74,12 +59,68 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + [[package]] name = "anyhow" version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +[[package]] +name = "ar" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" + [[package]] name = "arrayvec" version = "0.7.6" @@ -112,21 +153,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - [[package]] name = "base64" version = "0.21.7" @@ -147,11 +173,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -210,6 +236,44 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "cargo-deb" +version = "3.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3709056228ca1e8eaada532d2f205b16f8455b9af4f2da4e78bb1c7162aceb1a" +dependencies = [ + "anstream", + "anstyle", + "ar", + "cargo_toml", + "clap 4.5.50", + "elf", + "env_logger", + "glob", + "itertools 0.14.0", + "log", + "quick-error", + "rayon", + "regex", + "serde", + "serde_json", + "tar", + "tempfile", + "toml", + "xz2", + "zopfli", +] + +[[package]] +name = "cargo_toml" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" +dependencies = [ + "serde", + "toml", +] + [[package]] name = "cbc" version = "0.1.2" @@ -221,9 +285,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.40" +version = "1.2.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d05d92f4b1fd76aad469d46cdd858ca761576082cd37df81416691e50199fb" +checksum = "ac9fe6cdbb24b6ade63616c0a0688e45bb56732262c158df3c0c4bea4ca47cb7" dependencies = [ "find-msvc-tools", "shlex", @@ -231,9 +295,9 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" @@ -267,12 +331,45 @@ dependencies = [ "ansi_term", "atty", "bitflags 1.3.2", - "strsim", + "strsim 0.8.0", "textwrap", "unicode-width", "vec_map", ] +[[package]] +name = "clap" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + [[package]] name = "const-oid" version = "0.9.6" @@ -327,6 +424,25 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-queue" version = "0.3.12" @@ -419,7 +535,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -449,6 +565,34 @@ dependencies = [ "serde", ] +[[package]] +name = "elf" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" + +[[package]] +name = "env_filter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "log", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -498,10 +642,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "find-msvc-tools" -version = "0.1.3" +name = "filetime" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.60.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52051878f80a721bb68ebfbc930e07b65ba72f2da88968ea5c06fd6ca3d3a127" [[package]] name = "fixedbitset" @@ -596,7 +752,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -631,9 +787,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.7" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" dependencies = [ "typenum", "version_check", @@ -647,26 +803,26 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.7+wasi-0.2.4", + "wasip2", ] [[package]] -name = "gimli" -version = "0.32.3" +name = "glob" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" [[package]] name = "hashbrown" @@ -892,9 +1048,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.11.4" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" +checksum = "6717a8d2a5a929a1a2eb43a12812498ed141a0bcfb7e8f7844fbdbe4303bba9f" dependencies = [ "equivalent", "hashbrown 0.16.0", @@ -911,15 +1067,10 @@ dependencies = [ ] [[package]] -name = "io-uring" -version = "0.7.10" +name = "is_terminal_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046fa2d4d00aea763528b4950358d0ead425372445dc8ff86312b3c69ff7727b" -dependencies = [ - "bitflags 2.9.4", - "cfg-if", - "libc", -] +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" @@ -930,6 +1081,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.15" @@ -983,7 +1143,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "libc", "redox_syscall", ] @@ -1038,6 +1198,17 @@ version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "md-5" version = "0.10.6" @@ -1060,24 +1231,15 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", -] - [[package]] name = "mio" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" dependencies = [ "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] @@ -1123,11 +1285,11 @@ dependencies = [ [[package]] name = "nu-ansi-term" -version = "0.50.1" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a28e057d01f97e61255210fcff094d74ed0466038633e95017f5beb68e4399" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1185,9 +1347,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" +checksum = "b1207a7e20ad57b847bbddc6776b968420d38292bbfe2089accff5e19e82454c" dependencies = [ "num_enum_derive", "rustversion", @@ -1195,23 +1357,14 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" +checksum = "ff32365de1b6743cb203b710788263c44a03de03802daf96092f2da4fe6ba4d7" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.106", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", + "syn 2.0.107", ] [[package]] @@ -1220,6 +1373,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + [[package]] name = "parking_lot" version = "0.12.5" @@ -1344,7 +1503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -1407,7 +1566,7 @@ checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" dependencies = [ "bytes", "heck 0.5.0", - "itertools", + "itertools 0.12.1", "log", "multimap", "once_cell", @@ -1416,7 +1575,7 @@ dependencies = [ "prost", "prost-types", "regex", - "syn 2.0.106", + "syn 2.0.107", "tempfile", ] @@ -1427,10 +1586,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -1446,6 +1605,7 @@ dependencies = [ name = "punchnet" version = "1.0.0" dependencies = [ + "cargo-deb", "crc", "crc32fast", "dashmap 6.1.0", @@ -1467,6 +1627,12 @@ dependencies = [ "wintun", ] +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quote" version = "1.0.41" @@ -1512,20 +1678,40 @@ dependencies = [ "getrandom 0.2.16", ] +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", ] [[package]] name = "regex" -version = "1.11.3" +version = "1.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b5288124840bee7b386bc413c487869b360b2b4ec421ea56425128692f2a82c" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" dependencies = [ "aho-corasick", "memchr", @@ -1535,9 +1721,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833eb9ce86d40ef33cb1306d8accf7bc8ec2bfea4355cbdebb3df68b40925cad" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -1546,9 +1732,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf4aa5b0f434c91fe5c7f1ecb6a5ece2130b02ad2a590589dda5146df959001" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" [[package]] name = "rolling-file" @@ -1583,19 +1769,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustc-demangle" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" - [[package]] name = "rustix" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" dependencies = [ - "bitflags 2.9.4", + "bitflags 2.10.0", "errno", "libc", "linux-raw-sys", @@ -1672,7 +1852,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -1696,7 +1876,16 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", +] + +[[package]] +name = "serde_spanned" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" +dependencies = [ + "serde_core", ] [[package]] @@ -1755,6 +1944,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "slab" version = "0.4.11" @@ -1769,12 +1964,12 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.60.2", ] [[package]] @@ -1901,7 +2096,7 @@ checksum = "1ed31390216d20e538e447a7a9b959e06ed9fc51c37b514b46eb758016ecd418" dependencies = [ "atoi", "base64", - "bitflags 2.9.4", + "bitflags 2.10.0", "byteorder", "bytes", "crc", @@ -1943,7 +2138,7 @@ checksum = "7c824eb80b894f926f89a0b9da0c7f435d27cdd35b8c655b114e58223918577e" dependencies = [ "atoi", "base64", - "bitflags 2.9.4", + "bitflags 2.10.0", "byteorder", "crc", "dotenvy", @@ -2019,13 +2214,19 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "structopt" version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" dependencies = [ - "clap", + "clap 2.34.0", "lazy_static", "structopt-derive", ] @@ -2062,9 +2263,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.106" +version = "2.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +checksum = "2a26dbd934e5451d21ef060c018dae56fc073894c5a7896f882928a76e6d081b" dependencies = [ "proc-macro2", "quote", @@ -2079,7 +2280,17 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", +] + +[[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", ] [[package]] @@ -2089,7 +2300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" dependencies = [ "fastrand", - "getrandom 0.3.3", + "getrandom 0.3.4", "once_cell", "rustix", "windows-sys 0.61.2", @@ -2130,7 +2341,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2141,7 +2352,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2211,33 +2422,30 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.47.1" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" +checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" dependencies = [ - "backtrace", "bytes", - "io-uring", "libc", "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", - "slab", "socket2", "tokio-macros", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2253,6 +2461,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime", + "toml_parser", + "toml_writer", + "winnow", +] + [[package]] name = "toml_datetime" version = "0.7.3" @@ -2283,6 +2506,12 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_writer" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" + [[package]] name = "tracing" version = "0.1.41" @@ -2315,7 +2544,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2368,9 +2597,9 @@ checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] name = "unicode-ident" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63a545481291138910575129486daeaf8ac54aee4387fe7906919f7830c7d9d" +checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" [[package]] name = "unicode-normalization" @@ -2428,13 +2657,19 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "uuid" version = "1.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "js-sys", "wasm-bindgen", ] @@ -2469,15 +2704,6 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" -[[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" -dependencies = [ - "wasip2", -] - [[package]] name = "wasip2" version = "1.0.1+wasi-0.2.4" @@ -2516,7 +2742,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", "wasm-bindgen-shared", ] @@ -2538,7 +2764,7 @@ checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2624,7 +2850,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2635,7 +2861,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2671,15 +2897,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -2927,6 +3144,15 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + [[package]] name = "yoke" version = "0.8.0" @@ -2947,7 +3173,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", "synstructure", ] @@ -2968,7 +3194,7 @@ checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", ] [[package]] @@ -2988,7 +3214,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", "synstructure", ] @@ -3028,5 +3254,17 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.106", + "syn 2.0.107", +] + +[[package]] +name = "zopfli" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfc5ee405f504cd4984ecc6f14d02d55cfda60fa4b689434ef4102aae150cd7" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", ] diff --git a/Cargo.toml b/Cargo.toml index 1620872..4c2a2c2 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,3 +31,27 @@ wintun = "0.4.0" [features] tun = [] + +[build-dependencies] +cargo-deb = "3.6.2" + +[package.metadata.deb] +maintainer = "alex " +copyright = "2025, alex" +# license-file = ["MIT"] +depends = "$auto" + +## assets +assets = [ + ## libs and exxcutables + ["target/release/punchnet", "usr/local/", "755"], + ["assets/yolov5", "usr/bin/dump-rtsp-jpg", "755"], + ["assets/libswscale.so.5.7.100", "usr/lib/libswscale.so.5.7.100", "755"], + # ["usr/lib/libswscale.so.5", "usr/lib/libswscale.so.5.7.100", "symlink"] + # ["usr/lib/libswscale.so", "usr/lib/libswscale.so.5.7.100", "symlink"] +] + +maintainer-scripts = "debian" +systemd-units = [ + { unit-name = "sys-op-api", enable = true } +] \ No newline at end of file diff --git a/Makefile b/Makefile index efe8315..f6c7547 100755 --- a/Makefile +++ b/Makefile @@ -22,10 +22,16 @@ libtun-so-clang: cd src/network && clang -fPIC -shared -o libtuntap.so tuntap.c && cd - libtun-so: - cd src/network && gcc -fPIC -shared -o libtuntap.so tuntap.c && cd - + cd src/network && gcc -fPIC -shared -o libtuntap.so tuntap.c && cp libtuntap.so ../.. && cd - -libtun-a: - cd src/network && gcc -c tuntap.c && ar rcs libtuntap.a tuntap.o && cd - +libtun-aarch64-so: + cd src/network && aarch64-linux-gnu-gcc -fPIC -shared -o libtuntap_aarch64.so tuntap.c && cp libtuntap_aarch64.so ../../libtuntap.so && cd - pack: - tar -czvf punchnet.tar.gz punchnet punchnet.service libtuntap.so install.sh \ No newline at end of file + tar -czvf punchnet.tar.gz punchnet punchnet.service libtuntap.so install.sh + +deb-aarch64: libtun-aarch64-so + cargo deb --target aarch64-unknown-linux-gnu + +deb: libtun-so + cargo deb \ No newline at end of file diff --git a/message.proto b/message.proto old mode 100755 new mode 100644 index ddc66e6..fa87c29 --- a/message.proto +++ b/message.proto @@ -15,7 +15,7 @@ message SDLV6Info { // 设备网络地址信息 message SDLDevAddr { - uint32 network_id = 1; + string network_id = 1; bytes mac = 2; uint32 net_addr = 3; uint32 net_bit_len = 4; @@ -33,6 +33,7 @@ message SDLRegisterSuper { SDLDevAddr dev_addr = 4; string pub_key = 5; string token = 6; + string network_id = 7; } message SDLRegisterSuperAck { @@ -106,7 +107,7 @@ message SDLFlows { message SDLStunRequest { uint32 cookie = 1; string client_id = 2; - uint32 network_id = 3; + string network_id = 3; bytes mac = 4; uint32 ip = 5; uint32 nat_type = 6; @@ -118,7 +119,7 @@ message SDLStunReply { } message SDLData { - uint32 network_id = 1; + string network_id = 1; bytes src_mac = 2; bytes dst_mac = 3; bool is_p2p = 4; @@ -127,13 +128,13 @@ message SDLData { } message SDLRegister { - uint32 network_id = 1; + string network_id = 1; bytes src_mac = 2; bytes dst_mac = 3; } message SDLRegisterAck { - uint32 network_id = 1; + string network_id = 1; bytes src_mac = 2; bytes dst_mac = 3; } diff --git a/src/bin/punchnet/main.rs b/src/bin/punchnet/main.rs index 982c899..8ed008c 100755 --- a/src/bin/punchnet/main.rs +++ b/src/bin/punchnet/main.rs @@ -6,6 +6,7 @@ use sdlan_sn_rs::log; use tracing::error; +use std::process::exit; use std::time::Duration; use structopt::StructOpt; @@ -22,6 +23,12 @@ async fn main() { let _guard = log::init_log(); let cmd = CommandLineInput::from_args(); + if cmd.token.is_empty() && cmd.user_network_id.is_empty() { + eprintln!("[ERROR] no token or network_id is specifed. \n\ttry \"punchnet --help\" for detailed usage"); + exit(-1); + // error!("no token or network_id is specified"); + // exit(-1); + } // println!("port is {}", cmd.port); @@ -41,6 +48,7 @@ async fn main() { tos: 0, local_port: cmd.port, token: "test-token".to_owned(), + user_network_id: cmd.user_network_id, allow_p2p: true, }, tx, diff --git a/src/lib.rs b/src/lib.rs index e20c12b..ac2e4e1 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,6 +45,7 @@ pub async fn run_sdlan( if let Err(e) = init_edge( &args.token, + &args.user_network_id, node_conf, args.tos, start_stop_sender, diff --git a/src/network/async_main.rs b/src/network/async_main.rs index 4573c32..05b7041 100755 --- a/src/network/async_main.rs +++ b/src/network/async_main.rs @@ -79,7 +79,8 @@ async fn handle_tcp_message(msg: SdlanTcp) { .net_bit_len .store(dev.net_bit_len as u8, Ordering::Relaxed); edge.device.reload_config(&edge.device_config); - edge.network_id.store(dev.network_id, Ordering::Relaxed); + *edge.network_id.lock().unwrap() = dev.network_id; + // edge.network_id.store(dev.network_id, Ordering::Relaxed); edge.set_authorized(true, aes); send_stun_request(edge).await; @@ -290,6 +291,7 @@ pub async fn async_main( let installed_channel = install_channel.to_owned(); Box::pin(async move { let token = edge._token.lock().unwrap().clone(); + let networkid = edge.network_id.lock().unwrap().clone(); // let edge = get_edge(); // let edge = get_edge(); // let token = args.token.clone(); @@ -310,11 +312,12 @@ pub async fn async_main( dev_addr: Some(SdlDevAddr { mac: Vec::from(edge.device_config.get_mac()), net_addr: 0, - network_id: 0, + network_id: "".to_owned(), net_bit_len: 0, }), pub_key: edge.rsa_pubkey.clone(), token, + network_id: networkid, }; // debug!("send register super: {:?}", register_super); let packet_id = match pkt_id { @@ -448,7 +451,8 @@ async fn send_stun_request(eee: &Node) { let req = SdlStunRequest { cookie: 0, client_id: eee.config.node_uuid.clone(), - network_id: eee.network_id.load(Ordering::Relaxed), + network_id: eee.network_id.lock().unwrap().clone(), + // network_id: eee.network_id.load(Ordering::Relaxed), ip: eee.device_config.get_ip(), mac: Vec::from(eee.device_config.get_mac()), nat_type: eee.get_nat_type() as u32, diff --git a/src/network/node.rs b/src/network/node.rs index 25add95..2fdda93 100755 --- a/src/network/node.rs +++ b/src/network/node.rs @@ -31,6 +31,7 @@ static EDGE: OnceCell = OnceCell::new(); pub async fn init_edge( token: &str, + user_network_id: &str, node_conf: NodeConfig, tos: u32, start_stop: Sender, @@ -72,6 +73,7 @@ pub async fn init_edge( sock_v4, sock_multicast, token, + user_network_id, privatekey, tcp_pong.clone(), start_stop, @@ -112,7 +114,7 @@ pub struct StartStopInfo { pub struct Node { packet_id: AtomicU32, - pub network_id: AtomicU32, + pub network_id: Mutex, pub tcp_pong: Arc, @@ -120,6 +122,7 @@ pub struct Node { // user token info pub _token: Mutex, + pub _user_network_id: String, pub device_config: DeviceConfig, pub device: Iface, @@ -245,6 +248,8 @@ impl Node { multicast_sock: Option, // tcpsock: TCPSocket, token: &str, + user_network_id: &str, + // network: &str, private: RsaPrivateKey, tcp_pong: Arc, start_stop: Sender, @@ -258,8 +263,10 @@ impl Node { Self { packet_id: AtomicU32::new(1), - network_id: AtomicU32::new(0), + network_id: Mutex::new("".to_owned()), + // network_id: AtomicU32::new(0), _token: Mutex::new(token.to_owned()), + _user_network_id: user_network_id.to_owned(), start_stop_sender: start_stop, diff --git a/src/network/packet.rs b/src/network/packet.rs index 248147a..cc20d4f 100755 --- a/src/network/packet.rs +++ b/src/network/packet.rs @@ -730,8 +730,10 @@ async fn send_register( debug!("skipping register as p2p is disabled"); return; } - let network_id = eee.network_id.load(Ordering::Relaxed); - if network_id == 0 { + + let network_id = eee.network_id.lock().unwrap().clone(); + // let network_id = eee.network_id.load(Ordering::Relaxed); + if network_id.is_empty() { error!("not authed"); return; } @@ -1020,11 +1022,13 @@ async fn send_register_ack(eee: &Node, orig_sender: &SdlanSock, reg: &SdlRegiste debug!("Skipping REGISTER ACK as P2P is disallowed"); return; } - let network_id = eee.network_id.load(Ordering::Relaxed); - if network_id == 0 { + let network_id = eee.network_id.lock().unwrap().clone(); + // let network_id = eee.network_id.load(Ordering::Relaxed); + if network_id.is_empty() { error!("not authed"); return; } + let src_mac = reg.src_mac.clone(); let ack = SdlRegisterAck { network_id, @@ -1123,12 +1127,11 @@ pub async fn check_query_peer_info(eee: &'static Node, mac: Mac) { } async fn send_query_peer(eee: &Node, dst_mac: Mac) -> Result<()> { - let network_id = eee.network_id.load(Ordering::Relaxed); - - if network_id == 0 { + if !eee.is_authorized() { error!("not authed"); return Err(SDLanError::NormalError("not connected")); } + let query = SdlQueryInfo { dst_mac: Vec::from(dst_mac), }; diff --git a/src/network/tun_linux.rs b/src/network/tun_linux.rs index e370766..0febfc2 100755 --- a/src/network/tun_linux.rs +++ b/src/network/tun_linux.rs @@ -206,9 +206,10 @@ impl TunTapPacketHandler for Iface { error!("failed to encrypt packet request"); return Ok(()); }; + let network_id = edge.network_id.lock().unwrap().clone(); let data = SdlData { is_p2p: true, - network_id: edge.network_id.load(Ordering::Relaxed), + network_id, ttl: SDLAN_DEFAULT_TTL as u32, src_mac: Vec::from(edge.device_config.get_mac()), dst_mac: Vec::from(target), diff --git a/src/network/tuntap.rs b/src/network/tuntap.rs index 085d554..d9876f5 100755 --- a/src/network/tuntap.rs +++ b/src/network/tuntap.rs @@ -76,7 +76,7 @@ impl ArpWaitList { } let encrypt_key = edge.get_encrypt_key(); - let network_id = edge.network_id.load(Ordering::Relaxed); + let network_id = edge.network_id.lock().unwrap().clone(); let src_mac = edge.device_config.get_mac(); let now = get_current_timestamp(); @@ -94,7 +94,7 @@ impl ArpWaitList { }; let data = SdlData { is_p2p: true, - network_id, + network_id: network_id.clone(), ttl: SDLAN_DEFAULT_TTL as u32, src_mac: Vec::from(src_mac), dst_mac: Vec::from(mac), diff --git a/src/pb/message.rs b/src/pb/message.rs old mode 100755 new mode 100644 index 3c85a29..e4359e3 --- a/src/pb/message.rs +++ b/src/pb/message.rs @@ -21,8 +21,8 @@ pub struct Sdlv6Info { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SdlDevAddr { - #[prost(uint32, tag = "1")] - pub network_id: u32, + #[prost(string, tag = "1")] + pub network_id: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub mac: ::prost::alloc::vec::Vec, #[prost(uint32, tag = "3")] @@ -49,6 +49,8 @@ pub struct SdlRegisterSuper { pub pub_key: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub token: ::prost::alloc::string::String, + #[prost(string, tag = "7")] + pub network_id: ::prost::alloc::string::String, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -153,8 +155,8 @@ pub struct SdlStunRequest { pub cookie: u32, #[prost(string, tag = "2")] pub client_id: ::prost::alloc::string::String, - #[prost(uint32, tag = "3")] - pub network_id: u32, + #[prost(string, tag = "3")] + pub network_id: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "4")] pub mac: ::prost::alloc::vec::Vec, #[prost(uint32, tag = "5")] @@ -173,8 +175,8 @@ pub struct SdlStunReply { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SdlData { - #[prost(uint32, tag = "1")] - pub network_id: u32, + #[prost(string, tag = "1")] + pub network_id: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub src_mac: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "3")] @@ -189,8 +191,8 @@ pub struct SdlData { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SdlRegister { - #[prost(uint32, tag = "1")] - pub network_id: u32, + #[prost(string, tag = "1")] + pub network_id: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub src_mac: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "3")] @@ -199,8 +201,8 @@ pub struct SdlRegister { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SdlRegisterAck { - #[prost(uint32, tag = "1")] - pub network_id: u32, + #[prost(string, tag = "1")] + pub network_id: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub src_mac: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "3")] diff --git a/src/utils/command.rs b/src/utils/command.rs index d9f2bfd..cbfb69c 100755 --- a/src/utils/command.rs +++ b/src/utils/command.rs @@ -7,6 +7,9 @@ pub struct CommandLineInput { #[structopt(short = "p", long = "port", default_value = "0", help="which port to use")] pub port: u16, + + #[structopt(long = "network_id", short = "n", default_value = "", help="specify a networkid")] + pub user_network_id: String, } #[derive(StructOpt, Debug)] @@ -50,6 +53,9 @@ pub struct CommandLine { #[structopt(long = "token", default_value = "0")] pub token: String, + #[structopt(long = "network_id", default_value = "")] + pub user_network_id: String, + #[structopt(short = "p")] pub allow_p2p: bool, @@ -70,6 +76,7 @@ impl Clone for CommandLine { name: self.name.clone(), tos: self.tos, token: self.token.clone(), + user_network_id: self.user_network_id.clone(), allow_p2p: self.allow_p2p, nat_server1: self.nat_server1.clone(), nat_server2: self.nat_server2.clone(),