add dns server to embassy-os (#1572)

* add dns server to embassy-os

* fix initialization

* multiple ip addresses
This commit is contained in:
Aiden McClelland
2022-06-27 10:53:06 -06:00
committed by GitHub
parent 0849df524a
commit 22af45fb6e
11 changed files with 332 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
use std::collections::BTreeMap;
use std::net::IpAddr;
use std::net::Ipv4Addr;
use avahi_sys::{
self, avahi_client_errno, avahi_entry_group_add_service, avahi_entry_group_commit,
@@ -17,7 +17,7 @@ use crate::s9pk::manifest::PackageId;
use crate::util::Invoke;
use crate::Error;
pub async fn resolve_mdns(hostname: &str) -> Result<IpAddr, Error> {
pub async fn resolve_mdns(hostname: &str) -> Result<Ipv4Addr, Error> {
Ok(String::from_utf8(
Command::new("avahi-resolve-host-name")
.arg("-4")