diff --git a/snow-scanner/src/main.rs b/snow-scanner/src/main.rs index 38507e1..24fb8ac 100644 --- a/snow-scanner/src/main.rs +++ b/snow-scanner/src/main.rs @@ -3,6 +3,7 @@ use chrono::{NaiveDateTime, Utc}; #[macro_use] extern crate rocket; +use cidr::IpCidr; use event_bus::{EventBusSubscriber, EventBusWriter}; use rocket::{fairing::AdHoc, futures::SinkExt, trace::error, Rocket, State}; use rocket_db_pools::{ @@ -18,6 +19,8 @@ use rocket_db_pools::{ Connection, }; +use crate::worker::modules::{Network, WorkerMessages}; + use rocket_db_pools::diesel::mysql::{Mysql, MysqlValue}; use rocket_db_pools::diesel::serialize::IsNull; use rocket_db_pools::diesel::sql_types::Text; @@ -29,9 +32,9 @@ use rocket_ws::WebSocket; use server::Server; use worker::detection::{detect_scanner, get_dns_client, Scanners}; -use std::path::PathBuf; use std::{env, fmt}; use std::{io::Write, net::SocketAddr}; +use std::{path::PathBuf, str::FromStr}; use uuid::Uuid; use serde::{Deserialize, Deserializer, Serialize}; @@ -220,17 +223,21 @@ enum MultiReply { } #[post("/scan", data = "