Commit eff86bb1 authored by Brickner_cp's avatar Brickner_cp

DNS

parent 259185f4
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// RFC 1035.
/// RFC 1035, 2136.
/// Other sources: Dyer 1987, Moon 1981.
/// CLASS fields appear in resource records.
/// </summary>
public enum DnsClass : ushort
{
/// <summary>
/// The Internet.
/// RFC 1035.
/// Internet.
/// </summary>
In = 1,
/// <summary>
/// The CSNET class (Obsolete - used only for examples in some obsolete RFCs).
/// </summary>
Cs = 2,
/// <summary>
/// Moon 1981 1035.
/// The CHAOS class.
/// </summary>
Ch = 3,
/// <summary>
/// Hesiod [Dyer 87].
/// Dyer 87.
/// Hesiod.
/// </summary>
Hs = 4,
/// <summary>
/// RFC 2136.
/// None.
/// Query class.
/// </summary>
NoneExistent = 254,
/// <summary>
/// RFC 1035.
/// *.
/// Any class.
/// Query Class.
/// Query class.
/// </summary>
Any = 255,
......
......@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Dns
/// The top level format of message is divided into 5 sections (some of which are empty in certain cases) shown below:
/// <pre>
/// +-----+----+--------+----+----+----+----+------+--------+
/// | bit | 0 | 1-4 | 5 | 6 | 7 | 8 | 9-11 | 12-15 |
/// | bit | 0 | 1-4 | 5 | 6 | 7 | 8 | 9-10 | 11-15 |
/// +-----+----+--------+----+----+----+----+------+--------+
/// | 0 | ID |
/// +-----+----+--------+----+----+----+----+------+--------+
......@@ -72,14 +72,14 @@ namespace PcapDotNet.Packets.Dns
public const byte IsTruncated = 0x02;
public const byte IsRecusionDesired = 0x01;
public const byte IsRecusionAvailable = 0x80;
public const byte FutureUse = 0x70;
public const byte ResponseCode = 0x0F;
public const byte FutureUse = 0x60;
public const byte ResponseCode = 0x1F;
}
private static class Shift
{
public const int Opcode = 3;
public const int FutureUse = 4;
public const int FutureUse = 5;
}
/// <summary>
......@@ -87,7 +87,7 @@ namespace PcapDotNet.Packets.Dns
/// </summary>
public const int HeaderLength = 12;
public const byte MaxFutureUse = 7;
public const byte MaxFutureUse = 3;
/// <summary>
/// A 16 bit identifier assigned by the program that generates any kind of query.
......
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// RFCs 1035, 1996, 2136, 3425.
/// Specifies kind of query in this message.
/// This value is set by the originator of a query and copied into the response.
/// </summary>
public enum DnsOpcode : byte
{
/// <summary>
/// RFC 1035.
/// A standard query (QUERY).
/// </summary>
Query = 0,
/// <summary>
/// RFC 3425.
/// An inverse query (IQUERY).
/// </summary>
IQuery = 1,
/// <summary>
/// RFC 1035.
/// A server status request (STATUS).
/// </summary>
Status = 2,
/// <summary>
/// RFC 1996.
/// </summary>
Notify = 4,
/// <summary>
/// RFC 2136.
/// </summary>
Update = 5,
}
}
\ No newline at end of file
namespace PcapDotNet.Packets.Dns
{
/// <summary>
/// RFCs 1035, 2136, 2671, 2845, 2930, 4635.
/// </summary>
public enum DnsResponseCode : byte
{
/// <summary>
/// RFC 1035.
/// No error condition
/// </summary>
NoError = 0,
/// <summary>
/// RFC 1035.
/// Format error - The name server was unable to interpret the query.
/// </summary>
FormatError = 1,
/// <summary>
/// RFC 1035.
/// Server failure - The name server was unable to process this query due to a problem with the name server.
/// </summary>
ServerFailure = 2,
/// <summary>
/// RFC 1035.
/// Name Error - Meaningful only for responses from an authoritative name server,
/// this code signifies that the domain name referenced in the query does not exist.
/// </summary>
NameError = 3,
NotExistentDomain = 3,
/// <summary>
/// RFC 1035.
/// Not Implemented - The name server does not support the requested kind of query.
/// </summary>
NotImplemented = 4,
/// <summary>
/// RFC 1035.
/// Refused - The name server refuses to perform the specified operation for policy reasons.
/// For example, a name server may not wish to provide the information to the particular requester,
/// or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data.
/// </summary>
Refused = 5,
/// <summary>
/// RFC 2136.
/// YXDomain. Name Exists when it should not
/// </summary>
YxDomain = 6,
/// <summary>
/// RFC 2136.
/// RR Set Exists when it should not.
/// </summary>
YxRrSet = 7,
/// <summary>
/// RFC 2136.
/// RR Set that should exist does not.
/// </summary>
NxRrSet = 8,
/// <summary>
/// RFC 2136.
/// Server Not Authoritative for zone.
/// </summary>
NotAuth = 9,
/// <summary>
/// RFC 2136.
/// Name not contained in zone.
/// </summary>
NotZone = 10,
/// <summary>
/// RFCs 2671, 2845.
/// Bad OPT Version or TSIG Signature Failure.
/// </summary>
BadVersOrBadSig = 16,
/// <summary>
/// RFC 2845.
/// Key not recognized.
/// </summary>
BadKey = 17,
/// <summary>
/// RFC 2845.
/// Signature out of time window.
/// </summary>
BadTime = 18,
/// <summary>
/// RFC 2930.
/// Bad TKEY Mode.
/// </summary>
BadMode = 19,
/// <summary>
/// RFC 2930.
/// Duplicate key name.
/// </summary>
BadName = 20,
/// <summary>
/// RFC 2930.
/// Algorithm not supported.
/// </summary>
BadAlg = 21,
/// <summary>
/// RFC 4635.
/// Bad Truncation.
/// </summary>
BadTrunc = 22,
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment