Exemple #1
0
        protected override async Task WriteContentsAsync(LDAPWriter writer)
        {
            var opWriter = new LDAPWriter();

            await opWriter.WriteAsync(Version);

            await opWriter.WriteAsync(Name);

            await Authentication.WriteAsync(opWriter);

            await writer.WriteAsync(opWriter, 0, EncodingScope.APPLICATION);
        }
Exemple #2
0
        protected override async Task WriteContentsAsync(LDAPWriter writer)
        {
            var opWriter = new LDAPWriter();

            await opWriter.WriteAsync(DistinguishedName);

            var attrWriter = new LDAPWriter();

            foreach (var attr in Attributes ?? new LDAPAttribute[] { })
            {
                await attrWriter.WriteAsync(attr);
            }

            await opWriter.WriteAsync(attrWriter);

            await writer.WriteAsync(opWriter, (int)Operation, EncodingScope.APPLICATION);
        }
Exemple #3
0
        public async Task WriteAsync(LDAPWriter writer)
        {
            // Buffer the sequence to a memory stream first
            var opWriter = new LDAPWriter();
            await opWriter.WriteAsync(MessageId);

            // Write the op choice
            await WriteContentsAsync(opWriter);

            // Write the message as a generic sequence
            await writer.WriteAsync(opWriter);
        }
Exemple #4
0
        protected override async Task WriteContentsAsync(LDAPWriter writer)
        {
            var opWriter = new LDAPWriter();

            await opWriter.WriteAsync(DistinguishedName);

            var modWriter = new LDAPWriter();

            foreach (var attr in Added ?? new LDAPAttribute[0])
            {
                var w = new LDAPWriter();
                await w.WriteAsync(attr);

                await modWriter.WriteAsync(w, 0, EncodingScope.CONTEXT_SPECIFIC);
            }

            foreach (var attr in Removed ?? new LDAPAttribute[0])
            {
                var w = new LDAPWriter();
                await w.WriteAsync(attr);

                await modWriter.WriteAsync(w, 1, EncodingScope.CONTEXT_SPECIFIC);
            }

            foreach (var attr in Modified ?? new LDAPAttribute[0])
            {
                var w = new LDAPWriter();
                await w.WriteAsync(attr);

                await modWriter.WriteAsync(w, 2, EncodingScope.CONTEXT_SPECIFIC);
            }

            await opWriter.WriteAsync(modWriter);

            await writer.WriteAsync(opWriter, (int)Operation, EncodingScope.APPLICATION);
        }
Exemple #5
0
        protected override async Task WriteContentsAsync(LDAPWriter writer)
        {
            var opWriter = new LDAPWriter();

            await opWriter.WriteAsync(DistinguishedName);

            await opWriter.WriteAsync((int)Scope);

            await opWriter.WriteAsync((int)Aliasing);

            await opWriter.WriteAsync(SizeLimit);

            await opWriter.WriteAsync(TimeLimit);

            await opWriter.WriteAsync(TypesOnly);

            // Encode filters here
            await opWriter.WriteAsync(Filter);

            // Attributes
            if (Attributes == null || Attributes.Length == 0)
            {
                await opWriter.WriteNullAsync();
            }
            else
            {
                var atWriter = new LDAPWriter();
                foreach (var s in Attributes)
                {
                    await atWriter.WriteAsync(s);
                }

                await opWriter.WriteAsync(atWriter);
            }

            await writer.WriteAsync(opWriter, 3, EncodingScope.APPLICATION);
        }
Exemple #6
0
 public override async Task WriteAsync(LDAPWriter writer) =>
 // Tag for simple is 0
 await writer.WriteAsync(Credentials, 0, EncodingScope.CONTEXT_SPECIFIC);
Exemple #7
0
 protected override async Task WriteContentsAsync(LDAPWriter writer) => await writer.WriteAsync(DistinguishedName, 10, EncodingScope.APPLICATION);