Наследование: System.Runtime.Serialization.ISerializable
Пример #1
0
        public DebugEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

            ds_time = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
            milli_seconds =
            ((Asn1Integer) decoder.decode(decodedData, length)).intValue();

            strPerpetratorDN =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
            strFormatString =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
            nVerb = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
            parameter_count =
            ((Asn1Integer) decoder.decode(decodedData, length)).intValue();

            parameter_collection = new ArrayList();

            if (parameter_count > 0)
            {
            Asn1Sequence seq = (Asn1Sequence) decoder.decode(decodedData, length);
            for (int i = 0; i < parameter_count; i++)
            {
                parameter_collection.Add(
                    new DebugParameter((Asn1Tagged) seq.get_Renamed(i))
            );
            }
            }

            DataInitDone();
        }
Пример #2
0
		/// <summary> Constructs a new Search Request copying from an existing request.</summary>
		/* package */
		internal RfcSearchRequest(Asn1Object[] origRequest, System.String base_Renamed, System.String filter, bool request):base(origRequest, origRequest.Length)
		{
			
			// Replace the base if specified, otherwise keep original base
			if ((System.Object) base_Renamed != null)
			{
				set_Renamed(0, new RfcLdapDN(base_Renamed));
			}
			
			// If this is a reencode of a search continuation reference
			// and if original scope was one-level, we need to change the scope to
			// base so we don't return objects a level deeper than requested
			if (request)
			{
				int scope = ((Asn1Enumerated) origRequest[1]).intValue();
				if (scope == LdapConnection.SCOPE_ONE)
				{
					set_Renamed(1, new Asn1Enumerated(LdapConnection.SCOPE_BASE));
				}
			}
			// Replace the filter if specified, otherwise keep original filter
			if ((System.Object) filter != null)
			{
				set_Renamed(6, new RfcFilter(filter));
			}
			return ;
		}
        public SecurityEquivalenceEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

              strEntryDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              retry_count = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              strValueDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

              Asn1Sequence referalseq = ((Asn1Sequence) decoder.decode(decodedData, length));

              referral_count = ((Asn1Integer) referalseq.get_Renamed(0)).intValue();
              referral_list = new ArrayList();
              if (referral_count > 0)
              {
            Asn1Sequence referalseqof = ((Asn1Sequence) referalseq.get_Renamed(1));

            for (int i = 0; i < referral_count; i++)
            {
              referral_list.Add( new ReferralAddress( (Asn1Sequence) referalseqof.get_Renamed(i) ) );
            }
              }

              DataInitDone();
        }
Пример #4
0
        public ValueEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];
            Asn1OctetString octData;

            strPerpetratorDN =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
            strEntry =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
            strAttribute =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
            strSyntax =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

            strClassId =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

            timeStampObj =
            new DSETimeStamp((Asn1Sequence) decoder.decode(decodedData, length));

            octData = ((Asn1OctetString) decoder.decode(decodedData, length));
            strData = octData.stringValue();
            binData = SupportClass.ToByteArray(octData.byteValue());

            nVerb = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();

            DataInitDone();
        }
Пример #5
0
        public BaseEdirEventData(EdirEventDataType eventDataType, Asn1Object message)
        {
            event_data_type = eventDataType;

              byte[] byteData = SupportClass.ToByteArray(((Asn1OctetString) message).byteValue());
              decodedData = new MemoryStream(byteData);
              decoder = new LBERDecoder();
        }
		/// <summary> Constructs a new Delete Request copying from the ArrayList of
		/// an existing request.
		/// </summary>
		/* package */
		internal RfcModifyDNRequest(Asn1Object[] origRequest, System.String base_Renamed):base(origRequest, origRequest.Length)
		{
			// Replace the base if specified, otherwise keep original base
			if ((System.Object) base_Renamed != null)
			{
				set_Renamed(0, new RfcLdapDN(base_Renamed));
			}
			return ;
		}
Пример #7
0
    public NetworkAddressEventData(EdirEventDataType eventDataType, Asn1Object message)
      : base(eventDataType, message)
    {
      int[] length = new int[1];

      nType = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
      strData = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

      DataInitDone();
    }
Пример #8
0
    public ConnectionStateEventData(EdirEventDataType eventDataType, Asn1Object message)
      : base(eventDataType, message)
    {
      int[] length = new int[1];

      strConnectionDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
      old_flags = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
      new_flags = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
      source_module = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

      DataInitDone();
    }
Пример #9
0
        /// <summary> Constructs an Asn1Tagged object.</summary>
        public Asn1Tagged(Asn1Identifier identifier, Asn1Object object_Renamed, bool explicit_Renamed)
            : base(identifier)
        {
            this.content = object_Renamed;
            this.explicit_Renamed = explicit_Renamed;

            if (!explicit_Renamed && content != null)
            {
                // replace object's id with new tag.
                content.setIdentifier(identifier);
            }
            return ;
        }
        public BinderyObjectEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

              strEntryDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              nType = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              nEmuObjFlags = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              nSecurity = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              strName = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

              DataInitDone();
        }
Пример #11
0
        public ModuleStateEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

              strConnectionDN = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              nFlags = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              strName = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              strDescription = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              strSource = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

              DataInitDone();
        }
        public ChangeAddressEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

              nFlags = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              nProto = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              address_family = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              strAddress = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              pstk_name = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              source_module = ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

              DataInitDone();
        }
Пример #13
0
        public EntryEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];
              strPerpetratorDN =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              strEntry =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();
              strClassId =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

              timeStampObj =
            new DSETimeStamp((Asn1Sequence) decoder.decode(decodedData, length));
              nVerb = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              nFlags = ((Asn1Integer) decoder.decode(decodedData, length)).intValue();
              strNewDN =
            ((Asn1OctetString) decoder.decode(decodedData, length)).stringValue();

              DataInitDone();
        }
Пример #14
0
 /* **********************************************************************
 *  The following methods aid in building filters sequentially,
 *  and is used by DSMLHandler:
 ***********************************************************************/
 /// <summary> Called by sequential filter building methods to add to a filter
 /// component.
 /// 
 /// Verifies that the specified Asn1Object can be added, then adds the
 /// object to the filter.
 /// </summary>
 /// <param name="current">  Filter component to be added to the filter
 /// @throws LdapLocalException Occurs when an invalid component is added, or
 /// when the component is out of sequence.
 /// </param>
 private void addObject(Asn1Object current)
 {
     if (filterStack == null)
     {
         filterStack = new System.Collections.Stack();
     }
     if (choiceValue() == null)
     {
         //ChoiceValue is the root Asn1 node
         ChoiceValue = current;
     }
     else
     {
         Asn1Tagged topOfStack = (Asn1Tagged) filterStack.Peek();
         Asn1Object value_Renamed = topOfStack.taggedValue();
         if (value_Renamed == null)
         {
             topOfStack.TaggedValue = current;
             filterStack.Push(current);
     //					filterStack.Add(current);
         }
         else if (value_Renamed is Asn1SetOf)
         {
             ((Asn1SetOf) value_Renamed).add(current);
             //don't add this to the stack:
         }
         else if (value_Renamed is Asn1Set)
         {
             ((Asn1Set) value_Renamed).add(current);
             //don't add this to the stack:
         }
         else if (value_Renamed.getIdentifier().Tag == LdapSearchRequest.NOT)
         {
             throw new LdapLocalException("Attemp to create more than one 'not' sub-filter", LdapException.FILTER_ERROR);
         }
     }
     int type = current.getIdentifier().Tag;
     if (type == AND || type == OR || type == NOT)
     {
     //				filterStack.Add(current);
         filterStack.Push(current);
     }
     return ;
 }
Пример #15
0
        /// <summary> Create an RfcLdapMessage by copying the content array
        /// 
        /// </summary>
        /// <param name="origContent">the array list to copy
        /// </param>
        /* package */
        internal RfcLdapMessage(Asn1Object[] origContent, RfcRequest origRequest, System.String dn, System.String filter, bool reference)
            : base(origContent, origContent.Length)
        {
            set_Renamed(0, new RfcMessageID()); // MessageID has static counter

            RfcRequest req = (RfcRequest) origContent[1];
            RfcRequest newreq = req.dupRequest(dn, filter, reference);
            op = (Asn1Object) newreq;
            set_Renamed(1, (Asn1Object) newreq);

            return ;
        }
Пример #16
0
        /// <summary> Create an RfcLdapMessage response from input parameters.</summary>
        public RfcLdapMessage(Asn1Sequence op, RfcControls controls)
            : base(3)
        {
            this.op = op;
            this.controls = controls;

            add(new RfcMessageID()); // MessageID has static counter
            add(op);
            if (controls != null)
            {
                add(controls);
            }
            return ;
        }
Пример #17
0
		public Asn1Tagged(Asn1Decoder dec, System.IO.Stream in_Renamed, int len, Asn1Identifier identifier):base(identifier)
		{
			
			// If we are decoding an implicit tag, there is no way to know at this
			// low level what the base type really is. We can place the content
			// into an Asn1OctetString type and pass it back to the application who
			// will be able to create the appropriate ASN.1 type for this tag.
			content = new Asn1OctetString(dec, in_Renamed, len);
			return ;
		}
Пример #18
0
		/* Constructors for Asn1Choice
		*/
		
		/// <summary> Constructs an Asn1Choice object using an Asn1Object value.
		/// 
		/// </summary>
		/// <param name="content">The Asn1Object that this Asn1Choice will
		/// encode.  Since all Asn1 objects are derived from Asn1Object
		/// any basic type can be passed in.
		/// </param>
		public Asn1Choice(Asn1Object content):base(null)
		{
			this.content = content;
			return ;
		}
Пример #19
0
 /// <summary> Adds a new Asn1Object to the end of this Asn1Structured
 /// object.
 /// 
 /// </summary>
 /// <param name="value">The Asn1Object to add to this Asn1Structured
 /// object.
 /// </param>
 public void add(Asn1Object value_Renamed)
 {
     if (contentIndex == content.Length)
     {
         // Array too small, need to expand it, double length
         int newSize = contentIndex + contentIndex;
         Asn1Object[] newArray = new Asn1Object[newSize];
         Array.Copy((System.Array) content, 0, (System.Array) newArray, 0, contentIndex);
         content = newArray;
     }
     content[contentIndex++] = value_Renamed;
     return ;
 }
Пример #20
0
 /// <summary> No arg Constructor. This is used by Filter, who subsequently sets the
 /// content after parsing the RFC 2254 Search Filter String.
 /// </summary>
 protected internal Asn1Choice() : base(null)
 {
     content = null;
     return;
 }
Пример #21
0
 /// <summary> No arg Constructor. This is used by Filter, who subsequently sets the
 /// content after parsing the RFC 2254 Search Filter String.
 /// </summary>
 protected internal Asn1Choice()
     : base(null)
 {
     this.content = null;
 }
Пример #22
0
        public GeneralDSEventData(EdirEventDataType eventDataType, Asn1Object message)
            : base(eventDataType, message)
        {
            int[] length = new int[1];

              ds_time = getTaggedIntValue(
                (Asn1Tagged) decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_DSTIME);
              milli_seconds = getTaggedIntValue(
                (Asn1Tagged) decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_MILLISEC);

              nVerb = getTaggedIntValue(
                (Asn1Tagged) decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_VERB);
              current_process = getTaggedIntValue(
                (Asn1Tagged) decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_CURRPROC);

              strPerpetratorDN = getTaggedStringValue(
                (Asn1Tagged) decoder.decode(decodedData, length),
                GeneralEventField.EVT_TAG_GEN_PERP);

              Asn1Tagged temptaggedvalue =
            ((Asn1Tagged) decoder.decode(decodedData, length));

              if (temptaggedvalue.getIdentifier().Tag
            == (int) GeneralEventField.EVT_TAG_GEN_INTEGERS)
              {
            //Integer List.
            Asn1Sequence inteseq = getTaggedSequence(temptaggedvalue, GeneralEventField.EVT_TAG_GEN_INTEGERS);
            Asn1Object[] intobject = inteseq.toArray();
            integer_values = new int[intobject.Length];

            for (int i = 0; i < intobject.Length; i++)
            {
              integer_values[i] = ((Asn1Integer) intobject[i]).intValue();
            }

            //second decoding for Strings.
            temptaggedvalue = ((Asn1Tagged) decoder.decode(decodedData, length));
              }
              else
              {
            integer_values = null;
              }

              if ((temptaggedvalue.getIdentifier().Tag
            == (int) GeneralEventField.EVT_TAG_GEN_STRINGS)
            && (temptaggedvalue.getIdentifier().Constructed))
              {
            //String values.
            Asn1Sequence inteseq =
                getTaggedSequence(temptaggedvalue, GeneralEventField.EVT_TAG_GEN_STRINGS);
            Asn1Object[] stringobject = inteseq.toArray();
            string_values = new string[stringobject.Length];

            for (int i = 0; i < stringobject.Length; i++)
            {
              string_values[i] =
                    ((Asn1OctetString) stringobject[i]).stringValue();
            }
              }
              else
              {
            string_values = null;
              }

              DataInitDone();
        }
Пример #23
0
        /* Constructors for Asn1Tagged
         */

        /// <summary> Constructs an Asn1Tagged object using the provided
        /// AN1Identifier and the Asn1Object.
        ///
        /// The explicit flag defaults to true as per the spec.
        /// </summary>
        public Asn1Tagged(Asn1Identifier identifier, Asn1Object object_Renamed) : this(identifier, object_Renamed, true)
        {
            return;
        }
Пример #24
0
 /// <summary> Constructs an extended request from an existing request.
 /// 
 /// </summary>
 /// <param name="origRequest">Asn1Object of existing request
 /// </param>
 /* package */
 public RfcExtendedRequest(Asn1Object[] origRequest)
     : base(origRequest, origRequest.Length)
 {
     return ;
 }
Пример #25
0
 /// <summary> Replaces the Asn1Object in the specified index position of
 /// this Asn1Structured object.
 /// 
 /// </summary>
 /// <param name="index">The index into the Asn1Structured object where
 /// this new ANS1Object will be placed.
 /// 
 /// </param>
 /// <param name="value">The Asn1Object to set in this Asn1Structured
 /// object.
 /// </param>
 public void set_Renamed(int index, Asn1Object value_Renamed)
 {
     if ((index >= contentIndex) || (index < 0))
     {
         throw new System.IndexOutOfRangeException("Asn1Structured: get: index " + index + ", size " + contentIndex);
     }
     content[index] = value_Renamed;
     return ;
 }
Пример #26
0
        /* Constructors for Asn1Choice
         */

        /// <summary> Constructs an Asn1Choice object using an Asn1Object value.
        ///
        /// </summary>
        /// <param name="content">The Asn1Object that this Asn1Choice will
        /// encode.  Since all Asn1 objects are derived from Asn1Object
        /// any basic type can be passed in.
        /// </param>
        public Asn1Choice(Asn1Object content)
            : base(null)
        {
            this.content = content;
        }
Пример #27
0
 /// <summary> Returns an array containing the individual ASN.1 elements
 /// of this Asn1Structed object.
 /// 
 /// </summary>
 /// <returns> an array of Asn1Objects
 /// </returns>
 public Asn1Object[] toArray()
 {
     Asn1Object[] cloneArray = new Asn1Object[contentIndex];
     Array.Copy((System.Array) content, 0, (System.Array) cloneArray, 0, contentIndex);
     return cloneArray;
 }
Пример #28
0
 /// <summary> Constructs an Asn1Sequence object with an array representing an
 /// Asn1 sequence.
 /// 
 /// </summary>
 /// <param name="newContent">the array containing the Asn1 data for the sequence
 /// 
 /// </param>
 /// <param name="size">Specifies the number of items in the array
 /// </param>
 public Asn1Sequence(Asn1Object[] newContent, int size)
     : base(ID, newContent, size)
 {
     return ;
 }
Пример #29
0
 /*
 * Create a an Asn1 structured type with default size of 10
 *
 * @param id the Asn1Identifier containing the tag for this structured type
 *
 * @param content an array containing the content
 *
 * @param size the number of items of content in the array
 */
 protected internal Asn1Structured(Asn1Identifier id, Asn1Object[] newContent, int size)
     : base(id)
 {
     content = newContent;
     contentIndex = size;
     return ;
 }
Пример #30
0
		/// <summary> No arg Constructor. This is used by Filter, who subsequently sets the
		/// content after parsing the RFC 2254 Search Filter String.
		/// </summary>
		protected internal Asn1Choice():base(null)
		{
			this.content = null;
			return ;
		}
Пример #31
0
        /// <summary> Create an RfcLdapMessage request from input parameters.</summary>
        public RfcLdapMessage(RfcRequest op, RfcControls controls)
            : base(3)
        {
            this.op = (Asn1Object) op;
            this.controls = controls;

            add(new RfcMessageID()); // MessageID has static counter
            add((Asn1Object) op);
            if (controls != null)
            {
                add(controls);
            }
            return ;
        }
Пример #32
0
		/* Constructors for Asn1Tagged
		*/
		
		/// <summary> Constructs an Asn1Tagged object using the provided 
		/// AN1Identifier and the Asn1Object.
		/// 
		/// The explicit flag defaults to true as per the spec.
		/// </summary>
		public Asn1Tagged(Asn1Identifier identifier, Asn1Object object_Renamed):this(identifier, object_Renamed, true)
		{
			return ;
		}
Пример #33
0
 /// <summary> Returns an array containing the individual ASN.1 elements
 /// of this Asn1Structed object.
 ///
 /// </summary>
 /// <returns> an array of Asn1Objects
 /// </returns>
 public Asn1Object[] toArray()
 {
     Asn1Object[] cloneArray = new Asn1Object[contentIndex];
     Array.Copy((System.Array)content, 0, (System.Array)cloneArray, 0, contentIndex);
     return(cloneArray);
 }