added base p2prc instruction~

This commit is contained in:
2025-06-26 18:17:07 +01:00
parent 7eedcec536
commit f41119634a
2 changed files with 41 additions and 22 deletions

View File

@@ -0,0 +1,17 @@
use std::io::Error;
use std::process::{Command, Output};
// Runs p2prc with custom arguments called.
pub fn run_p2prc_command(arguments: &str) -> Result<Output, std::io::Error> {
Command::new("p2prc")
.arg(arguments)
.output()
}
// Runs p2prc map port command
pub fn p2prc_map_port_command(local_port_no: &str, address: &str) -> String{
let output = run_p2prc_command(&*"--ls".to_string());
let stdout = String::from_utf8_lossy(&output.unwrap().stdout).to_string();
stdout
}