public virtual Security.AuthenticationBlock CreateAuthenticationBlock(SlpReader reader) { var result = new Security.AuthenticationBlock(); result.Descriptor = reader.ReadInt16(); var length = reader.ReadInt16(); result.TimeStamp = reader.ReadDateTime(); result.SpiString = reader.ReadString(); result.Data = reader.ReadBytes(length); return result; }
public virtual Security.AuthenticationBlock CreateAuthenticationBlock(SlpReader reader) { var result = new Security.AuthenticationBlock(); result.Descriptor = reader.ReadInt16(); var length = reader.ReadInt16(); result.TimeStamp = reader.ReadDateTime(); result.SpiString = reader.ReadString(); result.Data = reader.ReadBytes(length); return(result); }
/// <summary> /// Parses the binary data and returns an extension /// </summary> /// <param name="data">Data to parse. The data may contain multiple extensions, but only the first one is returned</param> /// <returns>New extension if the extension is supported</returns> internal ExtensionBase GetExtension(SlpReader reader) { var id = reader.ReadInt16(); if (id < 0 || id > 0x8ff) { throw new ServiceProtocolException(ServiceErrorCode.OptionNotUnderstood, "The ID was out of the allowed range of possible values."); } if (id >= 0x400 && id < 0x800) { if (!_RegisteredExtensions.ContainsKey(id)) { throw new ServiceProtocolException(ServiceErrorCode.OptionNotUnderstood); } } if (!_RegisteredExtensions.ContainsKey(id)) { return(null); } var result = (ExtensionBase)Services.Locator.GetInstance(_RegisteredExtensions[id]); return(result.Create(reader)); }
internal override void Create(SlpReader reader) { base.Create(reader); ErrorCode = (ServiceErrorCode)reader.ReadInt16(); Attributes = Services.Locator.GetInstance <AttributeCollection>(reader); ReadAuthBlocks(reader, AuthBlocks); }
internal override void Create(SlpReader reader) { base.Create(reader); ErrorCode = (ServiceErrorCode)reader.ReadInt16(); Attributes = Services.Locator.GetInstance<AttributeCollection>(reader); ReadAuthBlocks(reader, AuthBlocks); }
/// <summary> /// Initalises a new extension from the received data /// </summary> /// <param name="data">byte array of data to parse</param> /// <returns>new UserDefined Extension</returns> internal override ExtensionBase Create(SlpReader reader) { var result = new UnknownExtension(); result._Id = reader.ReadInt16(); result.Offset = reader.ReadInt24(); result.Data = reader.ReadBytes(result.Offset); return result; }
/// <summary> /// Initalises a new extension from the received data /// </summary> /// <param name="data">byte array of data to parse</param> /// <returns>new UserDefined Extension</returns> internal override ExtensionBase Create(SlpReader reader) { var result = new UnknownExtension(); result._Id = reader.ReadInt16(); result.Offset = reader.ReadInt24(); result.Data = reader.ReadBytes(result.Offset); return(result); }
internal override void Create(SlpReader reader) { base.Create(reader); var tmp = reader.ReadInt16(); var result = new ServiceEntry[tmp]; for (int i = 0; i < tmp; i++) { result[i] = Slp.Services.Locator.GetInstance<ServiceEntry>(reader); } Services = new ReadOnlyCollection<ServiceEntry>(result); }
internal override void Create(SlpReader reader) { base.Create(reader); ErrorCode = (ServiceErrorCode)reader.ReadInt16(); BootTimeStamp = reader.ReadDateTime(); var url = reader.ReadString(); Scopes.AddRange(reader.ReadList()); Uri = new ServiceUri(url, Services.Locator.GetInstance <AttributeCollection>(reader)); SpiStrings.AddRange(reader.ReadList()); ReadAuthBlocks(reader, AuthBlocks); }
internal override void Create(SlpReader reader) { base.Create(reader); var tmp = reader.ReadInt16(); var result = new ServiceEntry[tmp]; for (int i = 0; i < tmp; i++) { result[i] = Slp.Services.Locator.GetInstance <ServiceEntry>(reader); } Services = new ReadOnlyCollection <ServiceEntry>(result); }
/// <summary> /// Read the message bytes and set the properties on this instance /// </summary> /// <param name="reader"></param> internal virtual void Create(SlpReader reader) { reader.ReadInt24(); var flags = reader.ReadByte(); IsOverFlow = (flags & 0x80) == 0x80; IsFresh = (flags & 0x40) == 0x40; IsMulticast = (flags & 0x20) == 0x20; reader.ReadByte(); _ExtensionOffset = reader.ReadInt24(); MessageId = reader.ReadInt16(); Language = reader.ReadString(); }
internal override void Create(SlpReader reader) { base.Create(reader); var tmp = reader.ReadInt16(); if (tmp == 0xfff) { GetAllAuthorities = true; } else { NamingAuthority = reader.ReadString(tmp); } Scopes.AddRange(reader.ReadList()); }
internal override void Create(SlpReader reader) { base.Create(reader); var tmp = reader.ReadInt16(); if (tmp == 0xfff) GetAllAuthorities = true; else NamingAuthority = reader.ReadString(tmp); Scopes.AddRange(reader.ReadList()); }
internal override void Create(SlpReader reader) { base.Create(reader); ErrorCode = (ServiceErrorCode)reader.ReadInt16(); BootTimeStamp = reader.ReadDateTime(); var url = reader.ReadString(); Scopes.AddRange(reader.ReadList()); Uri = new ServiceUri(url, Services.Locator.GetInstance<AttributeCollection>(reader)); SpiStrings.AddRange(reader.ReadList()); ReadAuthBlocks(reader, AuthBlocks); }