public DnsResourceDataHostIdentityProtocol(DataSegment hostIdentityTag, DnsPublicKeyAlgorithm publicKeyAlgorithm, DataSegment publicKey, IEnumerable <DnsDomainName> rendezvousServers)
 {
     if (hostIdentityTag == null)
     {
         throw new ArgumentNullException("hostIdentityTag");
     }
     if (publicKey == null)
     {
         throw new ArgumentNullException("publicKey");
     }
     if (hostIdentityTag.Length > (int)byte.MaxValue)
     {
         throw new ArgumentOutOfRangeException("hostIdentityTag", (object)hostIdentityTag.Length, string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Cannot be bigger than {0}.", new object[1]
         {
             (object)byte.MaxValue
         }));
     }
     if (publicKey.Length > (int)ushort.MaxValue)
     {
         throw new ArgumentOutOfRangeException("publicKey", (object)publicKey.Length, string.Format((IFormatProvider)CultureInfo.InvariantCulture, "Cannot be bigger than {0}.", new object[1]
         {
             (object)ushort.MaxValue
         }));
     }
     this.HostIdentityTag    = hostIdentityTag;
     this.PublicKeyAlgorithm = publicKeyAlgorithm;
     this.PublicKey          = publicKey;
     this.RendezvousServers  = IListExtensions.AsReadOnly <DnsDomainName>((IList <DnsDomainName>)Enumerable.ToArray <DnsDomainName>(rendezvousServers));
 }
Ejemplo n.º 2
0
 public IpV4OptionTimestampAndAddress(IpV4OptionTimestampType timestampType, byte overflow, byte pointedIndex, IList <IpV4OptionTimedAddress> timedRoute)
     : base(timestampType, overflow, pointedIndex)
 {
     if (timestampType != IpV4OptionTimestampType.AddressAndTimestamp && timestampType != IpV4OptionTimestampType.AddressPrespecified)
     {
         throw new ArgumentException("Illegal timestamp type " + (object)timestampType, "timestampType");
     }
     this._addressesAndTimestamps = IListExtensions.AsReadOnly <IpV4OptionTimedAddress>(timedRoute);
 }
Ejemplo n.º 3
0
 protected IpV4OptionRoute(IpV4OptionType optionType, IList <IpV4Address> route, byte pointedAddressIndex)
     : base(optionType)
 {
     if ((int)pointedAddressIndex > 62)
     {
         throw new ArgumentOutOfRangeException("pointedAddressIndex", (object)pointedAddressIndex, "Maximum value is " + (object)62);
     }
     this._route = IListExtensions.AsReadOnly <IpV4Address>(route);
     this._pointedAddressIndex = pointedAddressIndex;
 }
 private void SetTransferCodings(IList <string> transferCodings)
 {
     if (Enumerable.Any <string>((IEnumerable <string>)transferCodings, (Func <string, bool>)(coding => Enumerable.Any <char>((IEnumerable <char>)coding, (Func <char, bool>)(c => CharExtensions.IsUppercaseAlpha(c))))))
     {
         this._transferCodings = IListExtensions.AsReadOnly <string>((IList <string>)Enumerable.ToArray <string>(Enumerable.Select <string, string>((IEnumerable <string>)transferCodings, (Func <string, string>)(coding => coding.ToLowerInvariant()))));
     }
     else
     {
         this._transferCodings = IListExtensions.AsReadOnly <string>(transferCodings);
     }
 }
Ejemplo n.º 5
0
        private Options(IList <T> options, bool isValid)
        {
            this._options    = IListExtensions.AsReadOnly <T>(options);
            this.IsValid     = isValid;
            this.BytesLength = Options <T> .SumBytesLength((IEnumerable <T>) this.OptionsCollection);

            if (this.BytesLength % 4 == 0)
            {
                return;
            }
            this.BytesLength = (this.BytesLength / 4 + 1) * 4;
        }
 public IgmpReportVersion3Layer()
 {
     this.GroupRecords = IListExtensions.AsReadOnly <IgmpGroupRecord>((IList <IgmpGroupRecord>) new IgmpGroupRecord[0]);
 }
 public IpV4OptionTimestampOnly(byte overflow, byte pointedIndex, IList <IpV4TimeOfDay> timestamps)
     : base(IpV4OptionTimestampType.TimestampOnly, overflow, pointedIndex)
 {
     this._timestamps = IListExtensions.AsReadOnly <IpV4TimeOfDay>(timestamps);
 }
Ejemplo n.º 8
0
 public DnsOptions(IList <DnsOption> options)
 {
     this.Options     = IListExtensions.AsReadOnly <DnsOption>(options);
     this.BytesLength = Enumerable.Sum <DnsOption>((IEnumerable <DnsOption>)options, (Func <DnsOption, int>)(option => option.Length));
 }
 internal DnsResourceDataDomainNames(params DnsDomainName[] domainNames)
     : this(IListExtensions.AsReadOnly <DnsDomainName>((IList <DnsDomainName>)domainNames))
 {
 }
Ejemplo n.º 10
0
 public DnsResourceDataNInfo(params DataSegment[] strings)
     : this(IListExtensions.AsReadOnly <DataSegment>((IList <DataSegment>)strings))
 {
 }
Ejemplo n.º 11
0
 internal DnsResourceDataStrings(params DataSegment[] strings)
     : this(IListExtensions.AsReadOnly <DataSegment>((IList <DataSegment>)strings))
 {
 }
Ejemplo n.º 12
0
 private void SetFieldNames(IEnumerable <string> fieldNames)
 {
     this._fieldNames = IListExtensions.AsReadOnly <string>((IList <string>)Enumerable.ToArray <string>(Enumerable.Select <string, string>(fieldNames, (Func <string, string>)(name => name.ToUpperInvariant()))));
 }
Ejemplo n.º 13
0
 internal HttpField(string name, IList <byte> value)
     : this(name, IListExtensions.AsReadOnly <byte>(value))
 {
 }
Ejemplo n.º 14
0
 public IgmpQueryVersion3Layer()
 {
     this.SourceAddresses = IListExtensions.AsReadOnly <IpV4Address>((IList <IpV4Address>) new IpV4Address[0]);
 }
 public DnsResourceDataAddressPrefixList(IList <DnsAddressPrefix> items)
 {
     this.Items = IListExtensions.AsReadOnly <DnsAddressPrefix>(items);
 }
 internal GreSourceRouteEntryIp(IpV4Address[] addresses, int nextAddressIndex)
     : this(IListExtensions.AsReadOnly <IpV4Address>((IList <IpV4Address>)addresses), nextAddressIndex)
 {
 }
 public DnsResourceDataUri(ushort priority, ushort weight, IList <DataSegment> target)
 {
     this.Priority = priority;
     this.Weight   = weight;
     this.Target   = IListExtensions.AsReadOnly <DataSegment>(target);
 }
 internal GreSourceRouteEntryAs(ushort[] asNumbers, int nextAsNumberIndex)
     : this(IListExtensions.AsReadOnly <ushort>((IList <ushort>)asNumbers), nextAsNumberIndex)
 {
 }