traffic_forward 0.1.8

This is a tool that allows you to easily create traffic forwarding rules through this command, which is implemented through the iptables tool.
Documentation
use traffic_forward::service;

#[test]
fn test_forward()
{
    let target_ip = "192.168.50.2";
    let target_port = "8800";
    let local_port = "2002";

    if let Err(e) = service::add(
        target_ip,
        target_port,
        local_port
    ) {
        assert!(false, "Forward Error: {}", e); 
    } else {
        assert!(true); 
    }  
}

#[test]
fn test_delete_forward()
{
    let target_ip = "192.168.50.2";

    if let Err(e) = service::del(
        target_ip
    ) {
        assert!(false, "Forward Error: {}", e); 
    } else {
        assert!(true); 
    }  
}

#[test]
fn test_traffic_forward()
{
    let target_ip = "192.168.50.2";

    let data = service::traffic(
        target_ip
    );

    if let Err(e) = data {
        assert!(false, "Forward Error: {}", e); 
    } else {
        println!("traffic forward: {:?}", data.unwrap());
        assert!(true); 
    }  
}