Class DNSPacket
Represents a DNS packet.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: Cosmos.System.Network.IPv4.UDP.DNS
Assembly: Cosmos.System2.dll
Syntax
public class DNSPacket : UDPPacket
Constructors
| Improve this Doc View SourceDNSPacket(Address, Address, UInt16, UInt16)
Initializes a new instance of the UDPPacket class.
Declaration
public DNSPacket(Address source, Address dest, ushort urlnb, ushort len)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | source | Source address. |
| Address | dest | Destination address. |
| System.UInt16 | urlnb | Domain name number. |
| System.UInt16 | len | Length |
Exceptions
| Type | Condition |
|---|---|
| System.OverflowException | Thrown if data array length is greater than Int32.MaxValue. |
| System.ArgumentException | Thrown if RawData is invalid or null. |
DNSPacket(Byte[])
Initializes a new instance of the DNSPacket class.
Declaration
public DNSPacket(byte[] rawData)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | rawData | Raw data. |
Methods
| Improve this Doc View SourceInitializeFields()
Declaration
protected override void InitializeFields()
Overrides
| Improve this Doc View SourceParseName(Byte[], ref Int32)
Gets the domain name from the given data and offset.
Declaration
public string ParseName(byte[] rawData, ref int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | rawData | The raw data of the packet. |
| System.Int32 | index | The offset in the |
Returns
| Type | Description |
|---|---|
| System.String |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |