Skip to content

Commit

Permalink
add client functions interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephyy committed Nov 1, 2023
1 parent 9e7a195 commit 117b6bd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion src/resolver/async_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ impl AsyncResolver {
};
async_resolver
}


/// RFC 1034
/// 5.2. Client-resolver interface
///
/// Host name to host address translation
pub async fn lookup_ip(&self, domain_name: &str, transport_protocol: &str) -> Result<IpAddr, ResolverError> {
println!("[LOOKUP IP ASYNCRESOLVER]");

Expand Down Expand Up @@ -62,6 +66,25 @@ impl AsyncResolver {
Ok(ip_addr)
}

/// RFC 1034
/// 5.2. Client-resolver interface
///
/// Host address to host name translation
pub async fn reverse_query() {
unimplemented!()
}

/// RFC 1034
/// Client-resolver interface
///
/// General lookup function
pub async fn lookup() {
unimplemented!()
}




}

#[cfg(test)]
Expand Down
2 changes: 1 addition & 1 deletion src/resolver/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::client::{udp_connection::ClientUDPConnection, tcp_connection::ClientT

use std::{net::{IpAddr,SocketAddr,Ipv4Addr}, time::Duration, vec};

pub struct ResolverConfig{
pub struct ResolverConfig {
//Servers
name_servers: Vec<(ClientUDPConnection,ClientTCPConnection)>,
//Addres of resolver
Expand Down

0 comments on commit 117b6bd

Please sign in to comment.