mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Replace DnDns with HeijdenDns
HeijdenDns seems to do a better job at querying SRV records
This commit is contained in:
parent
a344ac4101
commit
693073edfc
112 changed files with 5491 additions and 5009 deletions
65
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordGPOS.cs
Normal file
65
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordGPOS.cs
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
using System;
|
||||
/*
|
||||
* http://tools.ietf.org/rfc/rfc1712.txt
|
||||
*
|
||||
3. RDATA Format
|
||||
|
||||
MSB LSB
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
/ LONGITUDE /
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
/ LATITUDE /
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
/ ALTITUDE /
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
|
||||
where:
|
||||
|
||||
LONGITUDE The real number describing the longitude encoded as a
|
||||
printable string. The precision is limited by 256 charcters
|
||||
within the range -90..90 degrees. Positive numbers
|
||||
indicate locations north of the equator.
|
||||
|
||||
LATITUDE The real number describing the latitude encoded as a
|
||||
printable string. The precision is limited by 256 charcters
|
||||
within the range -180..180 degrees. Positive numbers
|
||||
indicate locations east of the prime meridian.
|
||||
|
||||
ALTITUDE The real number describing the altitude (in meters) from
|
||||
mean sea-level encoded as a printable string. The precision
|
||||
is limited by 256 charcters. Positive numbers indicate
|
||||
locations above mean sea-level.
|
||||
|
||||
Latitude/Longitude/Altitude values are encoded as strings as to avoid
|
||||
the precision limitations imposed by encoding as unsigned integers.
|
||||
Although this might not be considered optimal, it allows for a very
|
||||
high degree of precision with an acceptable average encoded record
|
||||
length.
|
||||
|
||||
*/
|
||||
|
||||
namespace Heijden.DNS
|
||||
{
|
||||
public class RecordGPOS : Record
|
||||
{
|
||||
public string LONGITUDE;
|
||||
public string LATITUDE;
|
||||
public string ALTITUDE;
|
||||
|
||||
public RecordGPOS(RecordReader rr)
|
||||
{
|
||||
LONGITUDE = rr.ReadString();
|
||||
LATITUDE = rr.ReadString();
|
||||
ALTITUDE = rr.ReadString();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} {1} {2}",
|
||||
LONGITUDE,
|
||||
LATITUDE,
|
||||
ALTITUDE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
41
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordMD.cs
Normal file
41
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordMD.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
/*
|
||||
3.3.4. MD RDATA format (Obsolete)
|
||||
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
/ MADNAME /
|
||||
/ /
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
|
||||
where:
|
||||
|
||||
MADNAME A <domain-name> which specifies a host which has a mail
|
||||
agent for the domain which should be able to deliver
|
||||
mail for the domain.
|
||||
|
||||
MD records cause additional section processing which looks up an A type
|
||||
record corresponding to MADNAME.
|
||||
|
||||
MD is obsolete. See the definition of MX and [RFC-974] for details of
|
||||
the new scheme. The recommended policy for dealing with MD RRs found in
|
||||
a master file is to reject them, or to convert them to MX RRs with a
|
||||
preference of 0.
|
||||
* */
|
||||
namespace Heijden.DNS
|
||||
{
|
||||
public class RecordMD : Record
|
||||
{
|
||||
public string MADNAME;
|
||||
|
||||
public RecordMD(RecordReader rr)
|
||||
{
|
||||
MADNAME = rr.ReadDomainName();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return MADNAME;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
41
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordMF.cs
Normal file
41
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordMF.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
/*
|
||||
*
|
||||
3.3.5. MF RDATA format (Obsolete)
|
||||
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
/ MADNAME /
|
||||
/ /
|
||||
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|
||||
|
||||
where:
|
||||
|
||||
MADNAME A <domain-name> which specifies a host which has a mail
|
||||
agent for the domain which will accept mail for
|
||||
forwarding to the domain.
|
||||
|
||||
MF records cause additional section processing which looks up an A type
|
||||
record corresponding to MADNAME.
|
||||
|
||||
MF is obsolete. See the definition of MX and [RFC-974] for details ofw
|
||||
the new scheme. The recommended policy for dealing with MD RRs found in
|
||||
a master file is to reject them, or to convert them to MX RRs with a
|
||||
preference of 10. */
|
||||
namespace Heijden.DNS
|
||||
{
|
||||
public class RecordMF : Record
|
||||
{
|
||||
public string MADNAME;
|
||||
|
||||
public RecordMF(RecordReader rr)
|
||||
{
|
||||
MADNAME = rr.ReadDomainName();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return MADNAME;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
using System;
|
||||
/*
|
||||
* http://tools.ietf.org/rfc/rfc1348.txt
|
||||
|
||||
* The NSAP-PTR RR
|
||||
|
||||
The NSAP-PTR RR is defined with mnemonic NSAP-PTR and a type code 23
|
||||
(decimal).
|
||||
|
||||
Its function is analogous to the PTR record used for IP addresses [4,7].
|
||||
|
||||
NSAP-PTR has the following format:
|
||||
|
||||
<NSAP-suffix> <ttl> <class> NSAP-PTR <owner>
|
||||
|
||||
All fields are required.
|
||||
|
||||
<NSAP-suffix> enumerates the actual octet values assigned by the
|
||||
assigning authority for the LOCAL network. Its format in master
|
||||
files is a <character-string> syntactically identical to that used in
|
||||
TXT and HINFO.
|
||||
|
||||
The format of NSAP-PTR is class insensitive. NSAP-PTR RR causes no
|
||||
additional section processing.
|
||||
|
||||
For example:
|
||||
|
||||
In net ff08000574.nsap-in-addr.arpa:
|
||||
|
||||
444433332222111199990123000000ff NSAP-PTR foo.bar.com.
|
||||
|
||||
Or in net 11110031f67293.nsap-in-addr.arpa:
|
||||
|
||||
67894444333322220000 NSAP-PTR host.school.de.
|
||||
|
||||
The RR data is the ASCII representation of the digits. It is encoded
|
||||
as a <character-string>.
|
||||
|
||||
*/
|
||||
|
||||
namespace Heijden.DNS
|
||||
{
|
||||
public class RecordNSAPPTR : Record
|
||||
{
|
||||
public string OWNER;
|
||||
|
||||
public RecordNSAPPTR(RecordReader rr)
|
||||
{
|
||||
OWNER = rr.ReadString();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}",OWNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
80
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordNXT.cs
Normal file
80
MinecraftClient/Protocol/Dns/Records/Obsolete/RecordNXT.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
/*
|
||||
* http://tools.ietf.org/rfc/rfc2065.txt
|
||||
*
|
||||
5.2 NXT RDATA Format
|
||||
|
||||
The RDATA for an NXT RR consists simply of a domain name followed by
|
||||
a bit map.
|
||||
|
||||
The type number for the NXT RR is 30.
|
||||
|
||||
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
|
||||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| next domain name /
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
| type bit map /
|
||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
|
||||
The NXT RR type bit map is one bit per RR type present for the owner
|
||||
name similar to the WKS socket bit map. The first bit represents RR
|
||||
type zero (an illegal type which should not be present.) A one bit
|
||||
indicates that at least one RR of that type is present for the owner
|
||||
name. A zero indicates that no such RR is present. All bits not
|
||||
specified because they are beyond the end of the bit map are assumed
|
||||
to be zero. Note that bit 30, for NXT, will always be on so the
|
||||
minimum bit map length is actually four octets. The NXT bit map
|
||||
should be printed as a list of RR type mnemonics or decimal numbers
|
||||
similar to the WKS RR.
|
||||
|
||||
The domain name may be compressed with standard DNS name compression
|
||||
when being transmitted over the network. The size of the bit map can
|
||||
be inferred from the RDLENGTH and the length of the next domain name.
|
||||
|
||||
|
||||
|
||||
*/
|
||||
namespace Heijden.DNS
|
||||
{
|
||||
public class RecordNXT : Record
|
||||
{
|
||||
public string NEXTDOMAINNAME;
|
||||
public byte[] BITMAP;
|
||||
|
||||
public RecordNXT(RecordReader rr)
|
||||
{
|
||||
ushort length = rr.ReadUInt16(-2);
|
||||
NEXTDOMAINNAME = rr.ReadDomainName();
|
||||
length -= (ushort)rr.Position;
|
||||
BITMAP = new byte[length];
|
||||
BITMAP = rr.ReadBytes(length);
|
||||
}
|
||||
|
||||
private bool IsSet(int bitNr)
|
||||
{
|
||||
int intByte = (int)(bitNr / 8);
|
||||
int intOffset = (bitNr % 8);
|
||||
byte b = BITMAP[intByte];
|
||||
int intTest = 1 << intOffset;
|
||||
if ((b & intTest) == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int bitNr = 1; bitNr < (BITMAP.Length * 8); bitNr++)
|
||||
{
|
||||
if (IsSet(bitNr))
|
||||
sb.Append(" " + (Type)bitNr);
|
||||
}
|
||||
return string.Format("{0}{1}", NEXTDOMAINNAME, sb.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue