From 87f18c0c8bfab97d201dca9a89bd333f41ce3083 Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Tue, 30 Jan 2024 09:58:05 -0800 Subject: [PATCH 1/2] Rename directories (again) --- {rayhunter => bin}/Cargo.toml | 0 {rayhunter => bin}/src/config.rs | 0 {rayhunter => bin}/src/diag.rs | 0 {rayhunter => bin}/src/error.rs | 0 {rayhunter => bin}/src/main.rs | 0 {rayhunter => bin}/src/pcap.rs | 0 {rayhunter => bin}/src/qmdl_store.rs | 0 {rayhunter => bin}/src/server.rs | 0 {rayhunter => bin}/src/stats.rs | 0 {rayhunter => bin}/static/css/style.css | 0 {rayhunter => bin}/static/index.html | 0 {rayhunter => bin}/static/js/main.js | 0 {orca => lib}/Cargo.toml | 0 {orca => lib}/src/diag.rs | 0 {orca => lib}/src/diag_device.rs | 0 {orca => lib}/src/diag_reader.rs | 0 {orca => lib}/src/gsmtap.rs | 0 {orca => lib}/src/gsmtap_parser.rs | 0 {orca => lib}/src/hdlc.rs | 0 {orca => lib}/src/lib.rs | 0 {orca => lib}/src/log_codes.rs | 0 {orca => lib}/src/pcap.rs | 0 {orca => lib}/src/qmdl.rs | 0 {orca => lib}/tests/test_lte_parsing.rs | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename {rayhunter => bin}/Cargo.toml (100%) rename {rayhunter => bin}/src/config.rs (100%) rename {rayhunter => bin}/src/diag.rs (100%) rename {rayhunter => bin}/src/error.rs (100%) rename {rayhunter => bin}/src/main.rs (100%) rename {rayhunter => bin}/src/pcap.rs (100%) rename {rayhunter => bin}/src/qmdl_store.rs (100%) rename {rayhunter => bin}/src/server.rs (100%) rename {rayhunter => bin}/src/stats.rs (100%) rename {rayhunter => bin}/static/css/style.css (100%) rename {rayhunter => bin}/static/index.html (100%) rename {rayhunter => bin}/static/js/main.js (100%) rename {orca => lib}/Cargo.toml (100%) rename {orca => lib}/src/diag.rs (100%) rename {orca => lib}/src/diag_device.rs (100%) rename {orca => lib}/src/diag_reader.rs (100%) rename {orca => lib}/src/gsmtap.rs (100%) rename {orca => lib}/src/gsmtap_parser.rs (100%) rename {orca => lib}/src/hdlc.rs (100%) rename {orca => lib}/src/lib.rs (100%) rename {orca => lib}/src/log_codes.rs (100%) rename {orca => lib}/src/pcap.rs (100%) rename {orca => lib}/src/qmdl.rs (100%) rename {orca => lib}/tests/test_lte_parsing.rs (100%) diff --git a/rayhunter/Cargo.toml b/bin/Cargo.toml similarity index 100% rename from rayhunter/Cargo.toml rename to bin/Cargo.toml diff --git a/rayhunter/src/config.rs b/bin/src/config.rs similarity index 100% rename from rayhunter/src/config.rs rename to bin/src/config.rs diff --git a/rayhunter/src/diag.rs b/bin/src/diag.rs similarity index 100% rename from rayhunter/src/diag.rs rename to bin/src/diag.rs diff --git a/rayhunter/src/error.rs b/bin/src/error.rs similarity index 100% rename from rayhunter/src/error.rs rename to bin/src/error.rs diff --git a/rayhunter/src/main.rs b/bin/src/main.rs similarity index 100% rename from rayhunter/src/main.rs rename to bin/src/main.rs diff --git a/rayhunter/src/pcap.rs b/bin/src/pcap.rs similarity index 100% rename from rayhunter/src/pcap.rs rename to bin/src/pcap.rs diff --git a/rayhunter/src/qmdl_store.rs b/bin/src/qmdl_store.rs similarity index 100% rename from rayhunter/src/qmdl_store.rs rename to bin/src/qmdl_store.rs diff --git a/rayhunter/src/server.rs b/bin/src/server.rs similarity index 100% rename from rayhunter/src/server.rs rename to bin/src/server.rs diff --git a/rayhunter/src/stats.rs b/bin/src/stats.rs similarity index 100% rename from rayhunter/src/stats.rs rename to bin/src/stats.rs diff --git a/rayhunter/static/css/style.css b/bin/static/css/style.css similarity index 100% rename from rayhunter/static/css/style.css rename to bin/static/css/style.css diff --git a/rayhunter/static/index.html b/bin/static/index.html similarity index 100% rename from rayhunter/static/index.html rename to bin/static/index.html diff --git a/rayhunter/static/js/main.js b/bin/static/js/main.js similarity index 100% rename from rayhunter/static/js/main.js rename to bin/static/js/main.js diff --git a/orca/Cargo.toml b/lib/Cargo.toml similarity index 100% rename from orca/Cargo.toml rename to lib/Cargo.toml diff --git a/orca/src/diag.rs b/lib/src/diag.rs similarity index 100% rename from orca/src/diag.rs rename to lib/src/diag.rs diff --git a/orca/src/diag_device.rs b/lib/src/diag_device.rs similarity index 100% rename from orca/src/diag_device.rs rename to lib/src/diag_device.rs diff --git a/orca/src/diag_reader.rs b/lib/src/diag_reader.rs similarity index 100% rename from orca/src/diag_reader.rs rename to lib/src/diag_reader.rs diff --git a/orca/src/gsmtap.rs b/lib/src/gsmtap.rs similarity index 100% rename from orca/src/gsmtap.rs rename to lib/src/gsmtap.rs diff --git a/orca/src/gsmtap_parser.rs b/lib/src/gsmtap_parser.rs similarity index 100% rename from orca/src/gsmtap_parser.rs rename to lib/src/gsmtap_parser.rs diff --git a/orca/src/hdlc.rs b/lib/src/hdlc.rs similarity index 100% rename from orca/src/hdlc.rs rename to lib/src/hdlc.rs diff --git a/orca/src/lib.rs b/lib/src/lib.rs similarity index 100% rename from orca/src/lib.rs rename to lib/src/lib.rs diff --git a/orca/src/log_codes.rs b/lib/src/log_codes.rs similarity index 100% rename from orca/src/log_codes.rs rename to lib/src/log_codes.rs diff --git a/orca/src/pcap.rs b/lib/src/pcap.rs similarity index 100% rename from orca/src/pcap.rs rename to lib/src/pcap.rs diff --git a/orca/src/qmdl.rs b/lib/src/qmdl.rs similarity index 100% rename from orca/src/qmdl.rs rename to lib/src/qmdl.rs diff --git a/orca/tests/test_lte_parsing.rs b/lib/tests/test_lte_parsing.rs similarity index 100% rename from orca/tests/test_lte_parsing.rs rename to lib/tests/test_lte_parsing.rs From ed9d2b41d7e791f2afa63801c4b836c758b232bc Mon Sep 17 00:00:00 2001 From: Will Greenberg Date: Tue, 30 Jan 2024 10:07:11 -0800 Subject: [PATCH 2/2] Renamed library crate to rayhunter, binary to rayhunter-daemon The produced binary is still called rayhunter though! --- Cargo.lock | 32 ++++++++++++++++---------------- Cargo.toml | 4 ++-- bin/Cargo.toml | 8 +++++--- bin/src/diag.rs | 6 +++--- bin/src/error.rs | 2 +- bin/src/main.rs | 4 ++-- bin/src/pcap.rs | 8 ++++---- bin/static/index.html | 2 +- lib/Cargo.toml | 4 ++-- lib/tests/test_lte_parsing.rs | 4 ++-- 10 files changed, 38 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c60c788..7060a7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -750,21 +750,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "orca" -version = "0.1.0" -dependencies = [ - "bytes", - "chrono", - "crc", - "deku", - "env_logger", - "libc", - "log", - "pcap-file", - "thiserror", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -902,6 +887,21 @@ checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] name = "rayhunter" version = "0.1.0" +dependencies = [ + "bytes", + "chrono", + "crc", + "deku", + "env_logger", + "libc", + "log", + "pcap-file", + "thiserror", +] + +[[package]] +name = "rayhunter-daemon" +version = "0.1.0" dependencies = [ "axum", "chrono", @@ -911,7 +911,7 @@ dependencies = [ "include_dir", "log", "mime_guess", - "orca", + "rayhunter", "serde", "tempdir", "thiserror", diff --git a/Cargo.toml b/Cargo.toml index 958cdeb..11a66a4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ - "orca", - "rayhunter", + "lib", + "bin", ] resolver = "2" diff --git a/bin/Cargo.toml b/bin/Cargo.toml index 9538413..63f96d0 100644 --- a/bin/Cargo.toml +++ b/bin/Cargo.toml @@ -1,12 +1,14 @@ [package] -name = "rayhunter" +name = "rayhunter-daemon" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[[bin]] +name = "rayhunter" +path = "src/main.rs" [dependencies] -orca = { path = "../orca" } +rayhunter = { path = "../lib" } toml = "0.8.8" serde = { version = "1.0.193", features = ["derive"] } tokio = { version = "1.35.1", features = ["full"] } diff --git a/bin/src/diag.rs b/bin/src/diag.rs index 3aefe1b..1086ec2 100644 --- a/bin/src/diag.rs +++ b/bin/src/diag.rs @@ -2,11 +2,11 @@ use std::sync::Arc; use axum::extract::State; use axum::http::StatusCode; -use orca::diag_device::DiagDevice; -use orca::diag_reader::DiagReader; +use rayhunter::diag_device::DiagDevice; +use rayhunter::diag_reader::DiagReader; use tokio::sync::RwLock; use tokio::sync::mpsc::{Receiver, self}; -use orca::qmdl::QmdlWriter; +use rayhunter::qmdl::QmdlWriter; use log::{debug, info}; use tokio::sync::mpsc::error::TryRecvError; use tokio::task::JoinHandle; diff --git a/bin/src/error.rs b/bin/src/error.rs index 42c5f48..78d15a8 100644 --- a/bin/src/error.rs +++ b/bin/src/error.rs @@ -1,5 +1,5 @@ use thiserror::Error; -use orca::diag_device::DiagDeviceError; +use rayhunter::diag_device::DiagDeviceError; use crate::qmdl_store::QmdlStoreError; diff --git a/bin/src/main.rs b/bin/src/main.rs index 41aec2c..55fab69 100644 --- a/bin/src/main.rs +++ b/bin/src/main.rs @@ -17,10 +17,10 @@ use crate::error::RayhunterError; use axum::response::Redirect; use diag::{DiagDeviceCtrlMessage, start_recording, stop_recording}; use log::{info, error}; -use orca::diag_device::DiagDevice; +use rayhunter::diag_device::DiagDevice; use axum::routing::{get, post}; use axum::Router; -use orca::qmdl::QmdlWriter; +use rayhunter::qmdl::QmdlWriter; use stats::get_qmdl_manifest; use tokio::sync::mpsc::{self, Sender}; use tokio::task::JoinHandle; diff --git a/bin/src/pcap.rs b/bin/src/pcap.rs index ea51ba1..7694c39 100644 --- a/bin/src/pcap.rs +++ b/bin/src/pcap.rs @@ -1,9 +1,9 @@ use crate::ServerState; -use orca::gsmtap_parser::GsmtapParser; -use orca::pcap::GsmtapPcapWriter; -use orca::qmdl::{QmdlReader, QmdlReaderError}; -use orca::diag_reader::DiagReader; +use rayhunter::gsmtap_parser::GsmtapParser; +use rayhunter::pcap::GsmtapPcapWriter; +use rayhunter::qmdl::{QmdlReader, QmdlReaderError}; +use rayhunter::diag_reader::DiagReader; use axum::body::Body; use axum::http::header::CONTENT_TYPE; use axum::extract::{State, Path}; diff --git a/bin/static/index.html b/bin/static/index.html index c7387b1..3ba9b67 100644 --- a/bin/static/index.html +++ b/bin/static/index.html @@ -1,6 +1,6 @@ - ORCA + rayhunter