Commit eff86bb1 authored by Brickner_cp's avatar Brickner_cp

DNS

parent 259185f4
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
/// <summary> /// <summary>
/// RFC 1035. /// RFC 1035, 2136.
/// Other sources: Dyer 1987, Moon 1981.
/// CLASS fields appear in resource records. /// CLASS fields appear in resource records.
/// </summary> /// </summary>
public enum DnsClass : ushort public enum DnsClass : ushort
{ {
/// <summary> /// <summary>
/// The Internet. /// RFC 1035.
/// Internet.
/// </summary> /// </summary>
In = 1, In = 1,
/// <summary> /// <summary>
/// The CSNET class (Obsolete - used only for examples in some obsolete RFCs). /// Moon 1981 1035.
/// </summary>
Cs = 2,
/// <summary>
/// The CHAOS class. /// The CHAOS class.
/// </summary> /// </summary>
Ch = 3, Ch = 3,
/// <summary> /// <summary>
/// Hesiod [Dyer 87]. /// Dyer 87.
/// Hesiod.
/// </summary> /// </summary>
Hs = 4, Hs = 4,
/// <summary> /// <summary>
/// RFC 2136.
/// None.
/// Query class.
/// </summary>
NoneExistent = 254,
/// <summary>
/// RFC 1035.
/// *. /// *.
/// Any class. /// Any class.
/// Query Class. /// Query class.
/// </summary> /// </summary>
Any = 255, Any = 255,
......
...@@ -11,7 +11,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -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: /// The top level format of message is divided into 5 sections (some of which are empty in certain cases) shown below:
/// <pre> /// <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 | /// | 0 | ID |
/// +-----+----+--------+----+----+----+----+------+--------+ /// +-----+----+--------+----+----+----+----+------+--------+
...@@ -72,14 +72,14 @@ namespace PcapDotNet.Packets.Dns ...@@ -72,14 +72,14 @@ namespace PcapDotNet.Packets.Dns
public const byte IsTruncated = 0x02; public const byte IsTruncated = 0x02;
public const byte IsRecusionDesired = 0x01; public const byte IsRecusionDesired = 0x01;
public const byte IsRecusionAvailable = 0x80; public const byte IsRecusionAvailable = 0x80;
public const byte FutureUse = 0x70; public const byte FutureUse = 0x60;
public const byte ResponseCode = 0x0F; public const byte ResponseCode = 0x1F;
} }
private static class Shift private static class Shift
{ {
public const int Opcode = 3; public const int Opcode = 3;
public const int FutureUse = 4; public const int FutureUse = 5;
} }
/// <summary> /// <summary>
...@@ -87,7 +87,7 @@ namespace PcapDotNet.Packets.Dns ...@@ -87,7 +87,7 @@ namespace PcapDotNet.Packets.Dns
/// </summary> /// </summary>
public const int HeaderLength = 12; public const int HeaderLength = 12;
public const byte MaxFutureUse = 7; public const byte MaxFutureUse = 3;
/// <summary> /// <summary>
/// A 16 bit identifier assigned by the program that generates any kind of query. /// A 16 bit identifier assigned by the program that generates any kind of query.
......
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
/// <summary> /// <summary>
/// RFCs 1035, 1996, 2136, 3425.
/// Specifies kind of query in this message. /// Specifies kind of query in this message.
/// This value is set by the originator of a query and copied into the response. /// This value is set by the originator of a query and copied into the response.
/// </summary> /// </summary>
public enum DnsOpcode : byte public enum DnsOpcode : byte
{ {
/// <summary> /// <summary>
/// RFC 1035.
/// A standard query (QUERY). /// A standard query (QUERY).
/// </summary> /// </summary>
Query = 0, Query = 0,
/// <summary> /// <summary>
/// RFC 3425.
/// An inverse query (IQUERY). /// An inverse query (IQUERY).
/// </summary> /// </summary>
IQuery = 1, IQuery = 1,
/// <summary> /// <summary>
/// RFC 1035.
/// A server status request (STATUS). /// A server status request (STATUS).
/// </summary> /// </summary>
Status = 2, Status = 2,
/// <summary>
/// RFC 1996.
/// </summary>
Notify = 4,
/// <summary>
/// RFC 2136.
/// </summary>
Update = 5,
} }
} }
\ No newline at end of file
namespace PcapDotNet.Packets.Dns namespace PcapDotNet.Packets.Dns
{ {
/// <summary>
/// RFCs 1035, 2136, 2671, 2845, 2930, 4635.
/// </summary>
public enum DnsResponseCode : byte public enum DnsResponseCode : byte
{ {
/// <summary> /// <summary>
/// RFC 1035.
/// No error condition /// No error condition
/// </summary> /// </summary>
NoError = 0, NoError = 0,
/// <summary> /// <summary>
/// RFC 1035.
/// Format error - The name server was unable to interpret the query. /// Format error - The name server was unable to interpret the query.
/// </summary> /// </summary>
FormatError = 1, FormatError = 1,
/// <summary> /// <summary>
/// RFC 1035.
/// Server failure - The name server was unable to process this query due to a problem with the name server. /// Server failure - The name server was unable to process this query due to a problem with the name server.
/// </summary> /// </summary>
ServerFailure = 2, ServerFailure = 2,
/// <summary> /// <summary>
/// RFC 1035.
/// Name Error - Meaningful only for responses from an authoritative name server, /// 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. /// this code signifies that the domain name referenced in the query does not exist.
/// </summary> /// </summary>
NameError = 3, NotExistentDomain = 3,
/// <summary> /// <summary>
/// RFC 1035.
/// Not Implemented - The name server does not support the requested kind of query. /// Not Implemented - The name server does not support the requested kind of query.
/// </summary> /// </summary>
NotImplemented = 4, NotImplemented = 4,
/// <summary> /// <summary>
/// RFC 1035.
/// Refused - The name server refuses to perform the specified operation for policy reasons. /// 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, /// 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. /// or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data.
/// </summary> /// </summary>
Refused = 5, 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