Some structure

This commit is contained in:
Ara Sadoyan
2025-02-12 12:17:15 +01:00
parent 4f998497bb
commit a2edbcfe73
7 changed files with 90 additions and 37 deletions

24
src/utils/discovery.rs Normal file
View File

@@ -0,0 +1,24 @@
use dashmap::DashMap;
use std::sync::atomic::AtomicUsize;
pub fn discover() -> DashMap<String, (Vec<(String, u16)>, AtomicUsize)> {
let upstreams: DashMap<String, (Vec<(String, u16)>, AtomicUsize)> = DashMap::new();
let mut toreturn = vec![];
toreturn.push(("192.168.1.1".to_string(), 8000.to_owned()));
toreturn.push(("192.168.1.10".to_string(), 8000.to_owned()));
toreturn.push(("127.0.0.1".to_string(), 8000.to_owned()));
toreturn.push(("127.0.0.2".to_string(), 8000.to_owned()));
toreturn.push(("127.0.0.3".to_string(), 8000.to_owned()));
toreturn.push(("127.0.0.4".to_string(), 8000.to_owned()));
toreturn.push(("127.0.0.5".to_string(), 8000.to_owned()));
toreturn.push(("127.0.0.6".to_string(), 8000.to_owned()));
upstreams.insert("myip.netangels.net".to_string(), (toreturn, AtomicUsize::new(0)));
let mut toreturn = vec![];
toreturn.push(("192.168.1.1".to_string(), 8000.to_owned()));
toreturn.push(("192.168.1.10".to_string(), 8000.to_owned()));
upstreams.insert("polo.netangels.net".to_string(), (toreturn, AtomicUsize::new(0)));
let mut toreturn = vec![];
toreturn.push(("192.168.1.20".to_string(), 8000.to_owned()));
upstreams.insert("glop.netangels.net".to_string(), (toreturn, AtomicUsize::new(0)));
upstreams
}