C# Class Ipop.Dns

A basic abstract Dns server. Must implement the translation process using NameLookUp and AddressLookUp.
ファイルを表示 Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
DomainName string

Protected Properties

Property Type Description
_base_address MemBlock
_forward_queries bool
_name_server System.Net.EndPoint
_netmask MemBlock

Public Methods

Method Description
AddressLookUp ( String name ) : String

Called during LookUp to perform translation from hostname to IP

Dns ( MemBlock ip_address, MemBlock netmask, string name_server, bool forward_queries ) : Brunet

Default constructor

LookUp ( IPPacket in_ip ) : IPPacket

Look up a hostname given a Dns request in the form of IPPacket

NameLookUp ( String IP ) : String

Called during LookUp to perfrom a translation from IP to hostname.

Resolve ( EndPoint server, byte request ) : MemBlock

Sends Dns query to Dns Server and returns the response.

Protected Methods

Method Description
InRange ( String IP ) : bool

Determines if an IP Address is in the applicable range for the Dns server

Method Details

AddressLookUp() public abstract method

Called during LookUp to perform translation from hostname to IP
public abstract AddressLookUp ( String name ) : String
name String The name to lookup
return String

Dns() public method

Default constructor
public Dns ( MemBlock ip_address, MemBlock netmask, string name_server, bool forward_queries ) : Brunet
ip_address MemBlock An IP Address in the range.
netmask MemBlock The netmask for the range.
name_server string The external name server to be queried.
forward_queries bool Set if queries are to be forwarded to external name server.
return Brunet

InRange() protected method

Determines if an IP Address is in the applicable range for the Dns server
protected InRange ( String IP ) : bool
IP String The IP Address to test.
return bool

LookUp() public method

Look up a hostname given a Dns request in the form of IPPacket
public LookUp ( IPPacket in_ip ) : IPPacket
in_ip NetworkPackets.IPPacket An IPPacket containing the Dns request
return NetworkPackets.IPPacket

NameLookUp() public abstract method

Called during LookUp to perfrom a translation from IP to hostname.
public abstract NameLookUp ( String IP ) : String
IP String The IP to look up.
return String

Resolve() public method

Sends Dns query to Dns Server and returns the response.
public Resolve ( EndPoint server, byte request ) : MemBlock
server System.Net.EndPoint
request byte
return MemBlock

Property Details

DomainName public_oe static_oe property

Domain name is:
public static string DomainName
return string

_base_address protected_oe property

The base ip address to perfom lookups on
protected MemBlock _base_address
return MemBlock

_forward_queries protected_oe property

Is true if IPOP is asked to forward Dns queries to external nameserver
protected bool _forward_queries
return bool

_name_server protected_oe property

Dns Server
protected EndPoint,System.Net _name_server
return System.Net.EndPoint

_netmask protected_oe property

The mask for the ip address to perform lookups on.
protected MemBlock _netmask
return MemBlock