コード例 #1
0
ファイル: SrvRecord.cs プロジェクト: mrtesoft/DNSAgent
 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);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: DnsRecordBase.cs プロジェクト: mrtesoft/DNSAgent
        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;
        }
コード例 #4
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, MasterName, true, domainNames);
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, ResponsibleName, true, domainNames);
     DnsMessageBase.EncodeUInt(messageData, ref currentPosition, SerialNumber);
     DnsMessageBase.EncodeInt(messageData, ref currentPosition, RefreshInterval);
     DnsMessageBase.EncodeInt(messageData, ref currentPosition, RetryInterval);
     DnsMessageBase.EncodeInt(messageData, ref currentPosition, ExpireInterval);
     DnsMessageBase.EncodeInt(messageData, ref currentPosition, NegativeCachingTTL);
 }
コード例 #5
0
ファイル: HipRecord.cs プロジェクト: mrtesoft/DNSAgent
 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);
     }
 }
コード例 #6
0
ファイル: SigRecord.cs プロジェクト: mrtesoft/DNSAgent
 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);
 }
コード例 #7
0
 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);
 }
コード例 #8
0
 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);
 }
コード例 #9
0
        protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
        {
            messageData[currentPosition++] = Precedence;
            messageData[currentPosition++] = (byte)GatewayType;
            messageData[currentPosition++] = (byte)Algorithm;
            switch (GatewayType)
            {
            case IpSecGatewayType.IpV4:
            case IpSecGatewayType.IpV6:
                byte[] addressBuffer = IPAddress.Parse(Gateway).GetAddressBytes();
                DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, addressBuffer);
                break;

            case IpSecGatewayType.Domain:
                DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Gateway, false, domainNames);
                break;
            }
            DnsMessageBase.EncodeByteArray(messageData, ref currentPosition, PublicKey);
        }
コード例 #10
0
 protected internal override void EncodeRecordData(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames)
 {
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, NextDomainName, false, domainNames);
     EncodeTypeBitmap(messageData, ref currentPosition, Types);
 }
コード例 #11
0
ファイル: MxRecord.cs プロジェクト: mrtesoft/DNSAgent
 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, ExchangeDomainName, true, domainNames);
 }
コード例 #12
0
 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);
 }
コード例 #13
0
 internal void Encode(byte[] messageData, int offset, ref int currentPosition, Dictionary <string, ushort> domainNames, bool useCompressionMutation)
 {
     DnsMessageBase.EncodeDomainName(messageData, offset, ref currentPosition, Name, true, useCompressionMutation, domainNames);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)RecordType);
     DnsMessageBase.EncodeUShort(messageData, ref currentPosition, (ushort)RecordClass);
 }