/// <summary> /// Create a new Ldap packet with message id /// </summary> /// <param name="messageId"></param> public LdapResultAttribute(LdapOperation operation, LdapResult result, String matchedDN = "", String diagnosticMessage = "") : base(operation) { ChildAttributes.Add(new LdapAttribute(UniversalDataType.Enumerated, (Byte)result)); ChildAttributes.Add(new LdapAttribute(UniversalDataType.OctetString, matchedDN)); ChildAttributes.Add(new LdapAttribute(UniversalDataType.OctetString, diagnosticMessage)); // todo add referral if needed // todo bindresponse can contain more child attributes... }
/// <summary> /// Create a partial Attribute from list of values /// </summary> /// <param name="attributeDescription"></param> /// <param name="attributeValues"></param> public LdapPartialAttribute(String attributeDescription, IEnumerable <String> attributeValues) : base(UniversalDataType.Sequence) { ChildAttributes.Add(new LdapAttribute(UniversalDataType.OctetString, attributeDescription)); var values = new LdapAttribute(UniversalDataType.Set); values.ChildAttributes.AddRange(attributeValues.Select(o => new LdapAttribute(UniversalDataType.OctetString, o))); ChildAttributes.Add(values); }
/// <summary> /// Create a new Ldap packet with message id /// </summary> /// <param name="messageId"></param> public LdapPacket(Int32 messageId) : base(UniversalDataType.Sequence) { ChildAttributes.Add(new LdapAttribute(UniversalDataType.Integer, messageId)); }