C# Class Ipop.Managed.ManagedAddressResolverAndDns

This class implements Dns, IAddressResolver, IManagedHandler, and ITranslator. It provides most functionality needed by ManagedIpopNode.
Inheritance: System.Net.Dns, IAddressResolver, ITranslator
Afficher le fichier Open project: pstjuste/brunet Class Usage Examples

Méthodes publiques

Свойство Type Description
mcast_addr List

Protected Properties

Свойство Type Description
_addr_ip MemBlock>.Dictionary
_blocked_addrs MemBlock>.Dictionary
_dhcp DhcpServer
_dns_a string>.Dictionary
_dns_ptr string>.Dictionary
_ip_addr Address>.Dictionary
_local_ip MemBlock
_node StructuredNode
_resolver WriteOnce
_rx_counters int>.Dictionary
_sync object
_tx_counters int>.Dictionary
_udp_translators IProtocolTranslator[]

Méthodes publiques

Méthode Description
AddDnsMapping ( string alias, string ip, bool reverse ) : void

Maps DNS alias to IP address.

AddIPMapping ( string ip, Brunet.Address addr ) : string

Maps IP address to Brunet address.

AddressLookUp ( String name ) : String

This method does an address lookup on the Dns

Check ( MemBlock ip, Brunet.Address addr ) : bool
GetStats ( string address ) : string
ManagedAddressResolverAndDns ( StructuredNode node, DhcpServer dhcp, MemBlock local_ip, string name_server, bool forward_queries ) : Brunet

Constructor for the class, it initializes various objects

MapLocalDns ( string name ) : bool

Sets up DNS for localhost

NameLookUp ( String ip ) : String

This method does an inverse lookup for the DNS

RemoveDnsMapping ( string alias, bool reverse ) : void

Remove Dns alias mapping.

RemoveIPMapping ( string ip ) : void

Remove IP to Brunet address mapping.

Resolve ( MemBlock IP ) : Brunet.Address

Returns the Brunet address given an IP

Translate ( MemBlock packet, Brunet.Address from ) : MemBlock

Implements the ITranslator portion for ManagedAddress..., takes an IP Packet, based upon who the originating Brunet Sender was, changes who the packet was sent from and then switches the destination address to the local nodes address. Takes incomming packets only.

Méthodes protégées

Méthode Description
UpdateCounter ( int>.Dictionary counters, Brunet.Address addr ) : void

Method Details

AddDnsMapping() public méthode

Maps DNS alias to IP address.
public AddDnsMapping ( string alias, string ip, bool reverse ) : void
alias string Dns alias to map
ip string IP address to map
reverse bool If true, add reverve mapping
Résultat void

AddIPMapping() public méthode

Maps IP address to Brunet address.
public AddIPMapping ( string ip, Brunet.Address addr ) : string
ip string IP address to map
addr Brunet.Address Brunet address to map
Résultat string

AddressLookUp() public méthode

This method does an address lookup on the Dns
public AddressLookUp ( String name ) : String
name String Takes in name as string to lookup
Résultat String

Check() public méthode

public Check ( MemBlock ip, Brunet.Address addr ) : bool
ip MemBlock
addr Brunet.Address
Résultat bool

GetStats() public méthode

public GetStats ( string address ) : string
address string
Résultat string

ManagedAddressResolverAndDns() public méthode

Constructor for the class, it initializes various objects
public ManagedAddressResolverAndDns ( StructuredNode node, DhcpServer dhcp, MemBlock local_ip, string name_server, bool forward_queries ) : Brunet
node StructuredNode Takes in a structured node
dhcp DhcpServer
local_ip MemBlock
name_server string
forward_queries bool
Résultat Brunet

MapLocalDns() public méthode

Sets up DNS for localhost
public MapLocalDns ( string name ) : bool
name string The DNS alias for the localhost
Résultat bool

NameLookUp() public méthode

This method does an inverse lookup for the DNS
public NameLookUp ( String ip ) : String
ip String IP address of the name that's being looked up
Résultat String

RemoveDnsMapping() public méthode

Remove Dns alias mapping.
public RemoveDnsMapping ( string alias, bool reverse ) : void
alias string Dns alias to remove
reverse bool If true, remove reverse mapping
Résultat void

RemoveIPMapping() public méthode

Remove IP to Brunet address mapping.
public RemoveIPMapping ( string ip ) : void
ip string IP address to remove
Résultat void

Resolve() public méthode

Returns the Brunet address given an IP
public Resolve ( MemBlock IP ) : Brunet.Address
IP MemBlock A MemBlock of the IP
Résultat Brunet.Address

Translate() public méthode

Implements the ITranslator portion for ManagedAddress..., takes an IP Packet, based upon who the originating Brunet Sender was, changes who the packet was sent from and then switches the destination address to the local nodes address. Takes incomming packets only.
public Translate ( MemBlock packet, Brunet.Address from ) : MemBlock
packet MemBlock The IP Packet to translate.
from Brunet.Address The Brunet address the packet was sent from.
Résultat MemBlock

UpdateCounter() protected méthode

protected UpdateCounter ( int>.Dictionary counters, Brunet.Address addr ) : void
counters int>.Dictionary
addr Brunet.Address
Résultat void

Property Details

_addr_ip protected_oe property

Maps Brunet Address as Address to MemBlock IP Addresses
protected Dictionary _addr_ip
Résultat MemBlock>.Dictionary

_blocked_addrs protected_oe property

Keeps track of blocked addresses
protected Dictionary _blocked_addrs
Résultat MemBlock>.Dictionary

_dhcp protected_oe property

Helps assign remote end points
protected DhcpServer _dhcp
Résultat DhcpServer

_dns_a protected_oe property

Contains ip:hostname mapping
protected Dictionary _dns_a
Résultat string>.Dictionary

_dns_ptr protected_oe property

Contains hostname:ip mapping
protected Dictionary _dns_ptr
Résultat string>.Dictionary

_ip_addr protected_oe property

Maps MemBlock IP Addresses to Brunet Address as Address
protected Dictionary _ip_addr
Résultat Address>.Dictionary

_local_ip protected_oe property

MemBlock of the IP mapped to local node
protected MemBlock _local_ip
Résultat MemBlock

_node protected_oe property

The node to do ping checks on
protected StructuredNode _node
Résultat StructuredNode

_resolver protected_oe property

Create a new address resolver
protected WriteOnce _resolver
Résultat WriteOnce

_rx_counters protected_oe property

Keeps track of number or received packets
protected Dictionary _rx_counters
Résultat int>.Dictionary

_sync protected_oe property

Synchronization object
protected object _sync
Résultat object

_tx_counters protected_oe property

Keeps track of number of sent packets
protected Dictionary _tx_counters
Résultat int>.Dictionary

_udp_translators protected_oe property

protected IProtocolTranslator[] _udp_translators
Résultat IProtocolTranslator[]

mcast_addr public_oe property

Array list of multicast addresses
public List
mcast_addr
Résultat List