netns 0.1.0

A library to work with linux network namespaces
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate netns;

use std::process::Command;
use netns::NetNS;

fn main() {
	let ns = NetNS::new();
	if ns.is_ok() {
		let temp = ns.unwrap();
		println!("{:?}", temp);
		NetNS::set(temp);
		let output = Command::new("ip").arg("a").output().unwrap();
		println!("{}", String::from_utf8_lossy(&output.stdout));
		println!("{}", String::from_utf8_lossy(&output.stderr));
	}
}