-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
2,601 additions
and
2,032 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
[package] | ||
name = "althea_rs" | ||
version = "0.1.4" | ||
version = "0.1.5" | ||
authors = ["Stan Drozd <[email protected]>"] | ||
|
||
[features] | ||
development = ["rita/development"] | ||
|
||
[dependencies] | ||
rita = { path = "./rita" } | ||
|
||
|
@@ -11,7 +14,6 @@ members = ["althea_kernel_interface", "bounty_hunter", "settings", "clu", "exit_ | |
|
||
[profile.release] | ||
opt-level = "z" | ||
debug=true | ||
lto = true | ||
codegen-units = 1 | ||
incremental = false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use super::KernelInterface; | ||
|
||
use std::fs::File; | ||
use std::io::Error; | ||
use std::io::Read; | ||
use std::net::IpAddr; | ||
|
||
impl KernelInterface { | ||
/// Gets a list of IP addresses of nameservers from /etc/resolv.conf, may be v6, v4 or both | ||
/// generally ignores malformed lines but produces IO errors | ||
pub fn get_resolv_servers(&self) -> Result<Vec<IpAddr>, Error> { | ||
let mut f = File::open("/etc/resolv.conf")?; | ||
let mut contents = String::new(); | ||
f.read_to_string(&mut contents)?; | ||
|
||
let mut res = Vec::new(); | ||
for line in contents.lines() { | ||
if line.starts_with("nameserver") { | ||
let mut nameserver = line.split(" "); | ||
nameserver.next(); | ||
match nameserver.next() { | ||
Some(ip) => match ip.parse() { | ||
Ok(addr) => res.push(addr), | ||
Err(e) => { | ||
warn!("Could not parse /etc/resolv.conf ip {:?} with {:?}", ip, e) | ||
} | ||
}, | ||
None => warn!("Invalid /etc/resolv.conf!"), | ||
} | ||
} | ||
} | ||
Ok(res) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,11 @@ authors = ["Jehan <[email protected]>"] | |
|
||
[dependencies] | ||
num256 = { path = "../num256" } | ||
base64 = "0.9.0" | ||
serde_derive = "1.0.24" | ||
serde = "1.0.24" | ||
serde_json = "1.0.8" | ||
hex = "0.3.1" | ||
base64 = "0.9.2" | ||
serde_derive = "1.0.70" | ||
serde = "1.0.70" | ||
serde_json = "1.0.24" | ||
hex = "0.3.2" | ||
eui48 = { git = "https://github.com/althea-mesh/eui48", features = ["serde"] } | ||
actix = { git = "https://github.com/kingoflolz/actix", branch = "althea-mesh", optional=true} | ||
ethereum-types = {git="https://github.com/paritytech/primitives.git"} | ||
ethereum-types = {git="https://github.com/paritytech/primitives.git"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,9 @@ authors = ["jkilpatr <[email protected]>"] | |
|
||
[dependencies] | ||
mockstream = { git = "https://github.com/lazy-bitfield/rust-mockstream.git" } | ||
ascii = "0.8.6" | ||
bufstream = "0.1" | ||
ascii = "0.9.0" | ||
bufstream = "0.1.3" | ||
ipnetwork = "0.13.0" | ||
failure = "0.1.1" | ||
log = "^0.4" | ||
env_logger = "0.5" | ||
failure = "0.1.2" | ||
log = "0.4.3" | ||
env_logger = "0.5.11" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,16 @@ version = "0.1.0" | |
authors = ["kingoflolz <[email protected]>"] | ||
|
||
[dependencies] | ||
log = "^0.4" | ||
env_logger = "^0.5.5" | ||
log = "0.4.3" | ||
env_logger = "0.5.11" | ||
num256 = { path = "../num256" } | ||
althea_types = { path = "../althea_types" } | ||
diesel = { version = "=1.2.0", features = ["sqlite"] } | ||
dotenv = "0.9.0" | ||
serde = "1.0.24" | ||
serde_derive = "1.0.24" | ||
serde_json = "1.0.8" | ||
diesel = { version = "1.3.2", features = ["sqlite"] } | ||
dotenv = "0.13.0" | ||
serde = "1.0.70" | ||
serde_derive = "1.0.70" | ||
serde_json = "1.0.24" | ||
|
||
[dependencies.rouille] | ||
version = "2.0" | ||
default-features = false | ||
version = "2.1.0" | ||
default-features = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,14 @@ authors = ["Justin <[email protected]>"] | |
settings = { path = "../settings" } | ||
althea_kernel_interface = { path = "../althea_kernel_interface" } | ||
althea_types = { path = "../althea_types" } | ||
lazy_static = "1.0" | ||
docopt = "0.8.1" | ||
log = "^0.4" | ||
env_logger = "^0.5.5" | ||
failure = "0.1.1" | ||
lazy_static = "1.0.2" | ||
docopt = "0.8.3" | ||
log = "0.4.3" | ||
env_logger = "0.5.11" | ||
failure = "0.1.2" | ||
ipgen = "0.0.4" | ||
regex = "0.2" | ||
rand = "0.4" | ||
serde = "1.0" | ||
serde_derive = "1.0" | ||
serde_json = "1.0" | ||
regex = "1.0.2" | ||
rand = "0.5.4" | ||
serde = "1.0.70" | ||
serde_derive = "1.0.70" | ||
serde_json = "1.0.24" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.