protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Flags); messageData[currentPosition++] = Protocol; messageData[currentPosition++] = (byte)Algorithm; DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicKey); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Priority); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Weight); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Port); DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Target, false, domainNames); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, KeyTag); messageData[currentPosition++] = (byte)Algorithm; messageData[currentPosition++] = (byte)DigestType; DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Digest); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { foreach (AddressPrefix addressPrefix in Prefixes) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)addressPrefix.AddressFamily); messageData[currentPosition++] = addressPrefix.Prefix; // no increment of position pointer, just set 1 bit if (addressPrefix.IsNegated) { messageData[currentPosition] = 128; } byte[] addressData = addressPrefix.Address.GetNetworkAddress(addressPrefix.Prefix).GetAddressBytes(); int length = addressData.Length; for (; length > 0; length--) { if (addressData[length - 1] != 0) { break; } } messageData[currentPosition++] |= (byte)length; DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, addressData, length); } }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { messageData[currentPosition++] = (byte)HashAlgorithm; messageData[currentPosition++] = Flags; DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Iterations); messageData[currentPosition++] = (byte)Salt.Length; DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Salt); }
internal override void EncodeData(Span <byte> messageData, ref int currentPosition) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Version); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)OperationCode); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)ErrorCode); DnsMessageBase.EncodeULong(messageData, ref currentPosition, Id); DnsMessageBase.EncodeUInt(messageData, ref currentPosition, (uint)LeaseTime.TotalSeconds); }
internal void EncodeRecordHeader(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames, out int recordPosition) { DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Name, true, domainNames); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)RecordType); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)RecordClass); DnsMessageBase.EncodeInt(messageData, ref currentPosition, TimeToLive); recordPosition = currentPosition + 2; }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Order); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Preference); DnsMessageBase.EncodeTextBlock(messageData, ref currentPosition, Flags); DnsMessageBase.EncodeTextBlock(messageData, ref currentPosition, Services); DnsMessageBase.EncodeTextBlock(messageData, ref currentPosition, RegExp); DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Replacement, false, domainNames); }
protected override void EncodePublicKey(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Prime.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Prime); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Generator.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Generator); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)PublicValue.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicValue); }
internal override void EncodeData(Span <byte> messageData, ref int currentPosition) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)(Family == AddressFamily.InterNetwork ? 1 : 2)); messageData[currentPosition++] = SourceNetmask; messageData[currentPosition++] = ScopeNetmask; byte[] data = Address.GetAddressBytes(); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, data, GetAddressLength()); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { messageData[currentPosition++] = (byte)Hit.Length; messageData[currentPosition++] = (byte)Algorithm; DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)PublicKey.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Hit); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicKey); foreach (string server in RendezvousServers) { DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, server, false, domainNames); } }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)TypeCovered); messageData[currentPosition++] = (byte)Algorithm; messageData[currentPosition++] = Labels; DnsMessageBase.EncodeInt(messageData, ref currentPosition, OriginalTimeToLive); EncodeDateTime(messageData, ref currentPosition, SignatureExpiration); EncodeDateTime(messageData, ref currentPosition, SignatureInception); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, KeyTag); DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, SignersName, false, null); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Signature); }
private void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames, byte[] mac) { DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, TSigAlgorithmHelper.GetDomainName(Algorithm), false, domainNames); EncodeDateTime(messageData, ref currentPosition, TimeSigned); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Fudge.TotalSeconds); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)mac.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, mac); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, OriginalID); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Error); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)OtherData.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, OtherData); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, TSigAlgorithmHelper.GetDomainName(Algorithm), false, domainNames); EncodeDateTime(messageData, ref currentPosition, Inception); EncodeDateTime(messageData, ref currentPosition, Expiration); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Mode); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Error); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)Key.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, Key); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)OtherData.Length); DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, OtherData); }
protected internal override void EncodeRecordData(Span <byte> messageData, int offset, ref int currentPosition, Dictionary <DomainName, ushort> domainNames, bool useCanonical) { if ((Options != null) && (Options.Count != 0)) { foreach (EDnsOptionBase option in Options) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)option.Type); DnsMessageBase.EncodeUShort(messageData, ref currentPosition, option.DataLength); option.EncodeData(messageData, ref currentPosition); } } }
internal void EncodeRecordLength(byte[] messageData, int offset, ref int recordDataOffset, Dictionary <string, ushort> domainNames, int recordPosition) { DnsMessageBase.EncodeUShort(messageData, ref recordDataOffset, (ushort)(recordPosition - recordDataOffset - 2)); recordDataOffset = recordPosition; }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)SubType); DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Hostname, false, domainNames); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Preference); DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Exchanger, true, domainNames); }
protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames) { DnsMessageBase.EncodeUShort(messageData, ref currentPosition, Preference); DnsMessageBase.EncodeULong(messageData, ref currentPosition, Locator64); }