C# Class Ipop.Dht.DhtDns

This class provides the ability to lookup names using the Dht. To add a name into the Dht either add a Hostname node into your AddressData node inside the IpopConfig or use another method to publish to the Dht. The format of acceptable hostnames is [a-zA-Z0-9-_\.]*.ipop (i.e. must end in .ipop)
Inheritance: Dns
Mostrar archivo Open project: pstjuste/brunet Class Usage Examples

Protected Properties

Property Type Description
_dht IDht
_ipop_namespace String
_sync object
dns_a Cache
dns_ptr Cache

Public Methods

Method Description
AddressLookUp ( String name ) : String

Called during LookUp to perform translation from hostname to IP. If an entry isn't in cache, we can try to get it from the Dht. Throws an exception if the name is invalid and returns null if no name is found.

DhtDns ( MemBlock ip, MemBlock netmask, string name_server, bool forward_queries, IDht dht, String ipop_namespace ) : Brunet

Create a DhtDns using the specified Dht object

NameLookUp ( String IP ) : String

Called during LookUp to perfrom a translation from IP to hostname. Entries get here via the AddressLookUp as the Dht does not retain pointer lookup information.

Method Details

AddressLookUp() public method

Called during LookUp to perform translation from hostname to IP. If an entry isn't in cache, we can try to get it from the Dht. Throws an exception if the name is invalid and returns null if no name is found.
public AddressLookUp ( String name ) : String
name String The name to lookup
return String

DhtDns() public method

Create a DhtDns using the specified Dht object
public DhtDns ( MemBlock ip, MemBlock netmask, string name_server, bool forward_queries, IDht dht, String ipop_namespace ) : Brunet
ip MemBlock
netmask MemBlock
name_server string
forward_queries bool
dht IDht A Dht object used to acquire name translations
ipop_namespace String
return Brunet

NameLookUp() public method

Called during LookUp to perfrom a translation from IP to hostname. Entries get here via the AddressLookUp as the Dht does not retain pointer lookup information.
public NameLookUp ( String IP ) : String
IP String The IP to look up.
return String

Property Details

_dht protected_oe property

Use this Dht to resolve names that aren't in cache
protected IDht _dht
return IDht

_ipop_namespace protected_oe property

The namespace where the hostnames are being stored.
protected String _ipop_namespace
return String

_sync protected_oe property

protected object _sync
return object

dns_a protected_oe property

Maps names to IP Addresses
protected Cache dns_a
return Cache

dns_ptr protected_oe property

Maps IP Addresses to names
protected Cache dns_ptr
return Cache