mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-10 18:38:22 +00:00
Remove old test code
This commit is contained in:
parent
529a105bef
commit
30b314d16a
1 changed files with 0 additions and 67 deletions
67
src/main.rs
67
src/main.rs
|
@ -73,71 +73,4 @@ async fn main() {
|
|||
.serve(main_router.into_make_service())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
/*
|
||||
let mut tx = config_manager.start_transaction().unwrap();
|
||||
|
||||
tx.changes
|
||||
.firewall
|
||||
.forward_rules
|
||||
.push(definitions::firewall::ForwardRule {
|
||||
name: "name".to_string(),
|
||||
comment: "test".to_string(),
|
||||
counter: true,
|
||||
verdict: definitions::firewall::Verdict::Accept,
|
||||
services: Vec::new(),
|
||||
destination_addresses: Vec::new(),
|
||||
source_addresses: Vec::new(),
|
||||
});
|
||||
|
||||
tx.commit().unwrap();
|
||||
|
||||
config_manager.apply_pending_changes().unwrap();
|
||||
|
||||
let mut tx2 = config_manager.start_transaction().unwrap();
|
||||
|
||||
tx2.changes.network.interfaces.insert(
|
||||
"inter1".to_string(),
|
||||
definitions::network::NetworkInterface {
|
||||
alias: "test".to_owned(),
|
||||
comment: "test comment".to_owned(),
|
||||
interface_type: definitions::network::NetworkInterfaceType::Hardware {
|
||||
device: "eth0".to_owned(),
|
||||
},
|
||||
addressing_mode: definitions::network::AddressingMode::None,
|
||||
},
|
||||
);
|
||||
|
||||
tx2.changes.network.interfaces.insert(
|
||||
"inter2".to_string(),
|
||||
definitions::network::NetworkInterface {
|
||||
alias: "test2".to_owned(),
|
||||
comment: "test comment".to_owned(),
|
||||
interface_type: definitions::network::NetworkInterfaceType::Hardware {
|
||||
device: "eth0".to_owned(),
|
||||
},
|
||||
addressing_mode: definitions::network::AddressingMode::Static {
|
||||
address: "192.168.1.1".to_owned(),
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
tx2.changes
|
||||
.network
|
||||
.static_routes
|
||||
.push(definitions::network::StaticRoute {
|
||||
name: "test1".to_string(),
|
||||
interface: "eth0".to_string(),
|
||||
gateway: "192.168.1.1".parse().unwrap(),
|
||||
destination: "10.42.42.0/24".parse().unwrap(),
|
||||
metric: 0,
|
||||
});
|
||||
|
||||
tx2.commit().unwrap();
|
||||
|
||||
config_manager.apply_pending_changes().unwrap();
|
||||
|
||||
let applied_config = config_manager.get_current_config();
|
||||
info!("applied_config = {:#?}", applied_config);
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue