WIP: adding more cross compilation support
This commit is contained in:
@@ -8,7 +8,9 @@ ansi_term = "0.12.1"
|
||||
anyhow = "1.0.75"
|
||||
ecies-ed25519 = { version = "0.5.1", features = ["serde"] }
|
||||
ed25519-dalek = "1.0.1"
|
||||
flate2 = "1.0.33"
|
||||
libc = "0.2.147"
|
||||
md5 = "0.7.0"
|
||||
rand = "0.7"
|
||||
rmp-serde = "1.1.2"
|
||||
serde = { version = "1.0.188", features = ["derive"] }
|
||||
|
||||
@@ -18,6 +18,8 @@ ecies-ed25519 = { version = "0.5.1", features = ["serde"] }
|
||||
packets = { path = "../../packets" }
|
||||
pcap-sys = { path = "../../pcap-sys", optional = true }
|
||||
windows-service = { version = "0.6.0", optional = true }
|
||||
flate2 = "1.0.33"
|
||||
md5 = "0.7.0"
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.0"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
use std::ffi::c_int;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::Context;
|
||||
use sparse_05_common::messages::{Capabilities, OperatingSystem, TransportType};
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
@@ -174,7 +174,9 @@ impl InterfaceReceiver {
|
||||
if udp_pkt.dstport() != *port {
|
||||
return Ok(false);
|
||||
}
|
||||
let _ = (f)(packet.to_owned());
|
||||
if let Err(e) = (f)(packet.to_owned()) {
|
||||
log::warn!("error on handling a new connection: {e:?}");
|
||||
}
|
||||
Ok(false)
|
||||
},
|
||||
false,
|
||||
|
||||
@@ -20,7 +20,11 @@ mod interface;
|
||||
|
||||
fn main_to_run() -> anyhow::Result<()> {
|
||||
simple_logger::SimpleLogger::new()
|
||||
.with_level(log::LevelFilter::Off)
|
||||
.with_level(if cfg!(debug_assertions) {
|
||||
log::LevelFilter::Warn
|
||||
} else {
|
||||
log::LevelFilter::Off
|
||||
})
|
||||
.with_module_level("sparse-05-server", log::LevelFilter::Debug)
|
||||
.init()?;
|
||||
|
||||
@@ -32,9 +36,9 @@ fn main_to_run() -> anyhow::Result<()> {
|
||||
|
||||
log::debug!("Capabilities: {:?}", capabilities);
|
||||
|
||||
let config_bytes = catconf::read_from_exe(CONFIG_SEPARATOR, 512)?;
|
||||
let config_bytes = catconf::read_from_exe(CONFIG_SEPARATOR, 128)?;
|
||||
if config_bytes.len() != 66 {
|
||||
bail!("could not load configuration");
|
||||
bail!("could not load configuration: {} bytes", config_bytes.len());
|
||||
}
|
||||
|
||||
let (port, conn_pubkey, enc_pubkey) = {
|
||||
@@ -58,6 +62,7 @@ fn main_to_run() -> anyhow::Result<()> {
|
||||
let Ok(packet) = recv_eth_packet.recv() else {
|
||||
continue;
|
||||
};
|
||||
log::trace!("Sending packet of length: {}", packet.pkt().data.len());
|
||||
if let Err(_) = interface_sender.sendpacket(packet.pkt()) {}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user