Exemplo n.º 1
0
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            alloc_hint = binaryReader.ReadUInt32();
            p_cont_id  = binaryReader.ReadUInt16();
            opnum      = binaryReader.ReadUInt16();

            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                alloc_hint = EndianUtility.ReverseByteOrder(alloc_hint);
                p_cont_id  = EndianUtility.ReverseByteOrder(p_cont_id);
                opnum      = EndianUtility.ReverseByteOrder(opnum);
            }

            if ((pfc_flags & RpceCoPfcFlags.PFC_OBJECT_UUID) != 0)
            {
                @object = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
            }

            int stubLength = frag_length;

            stubLength -= GetSize();
            if (auth_verifier != null)
            {
                stubLength -= auth_verifier.Value.auth_pad_length;
                stubLength -= RpceUtility.AUTH_VERIFIER_SIZE;
                stubLength -= auth_length;
            }
            stub = binaryReader.ReadBytes(stubLength);
        }
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            alloc_hint   = binaryReader.ReadUInt32();
            p_cont_id    = binaryReader.ReadUInt16();
            cancel_count = binaryReader.ReadByte();
            reserved     = binaryReader.ReadByte();
            status       = binaryReader.ReadUInt32();
            reserved2    = binaryReader.ReadUInt32();

            // read stub
            int stubLength = frag_length;

            stubLength -= GetSize();
            if (auth_verifier != null)
            {
                stubLength -= auth_verifier.Value.auth_pad_length;
                stubLength -= RpceUtility.AUTH_VERIFIER_SIZE;
                stubLength -= auth_length;
            }
            stub = binaryReader.ReadBytes(stubLength);
        }
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            alloc_hint   = binaryReader.ReadUInt32();
            p_cont_id    = binaryReader.ReadUInt16();
            cancel_count = binaryReader.ReadByte();
            reserved     = binaryReader.ReadByte();

            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                alloc_hint = EndianUtility.ReverseByteOrder(alloc_hint);
                p_cont_id  = EndianUtility.ReverseByteOrder(p_cont_id);
            }

            // read stub.
            int stubLength = frag_length;

            stubLength -= GetSize();
            if (auth_verifier != null)
            {
                stubLength -= auth_verifier.Value.auth_pad_length;
                stubLength -= RpceUtility.AUTH_VERIFIER_SIZE;
                stubLength -= auth_length;
            }
            stub = binaryReader.ReadBytes(stubLength);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Un-marshal a byte array to PDU struct.
 /// </summary>
 /// <param name="binaryReader">BinaryReader</param>
 internal override void FromBytes(BinaryReader binaryReader)
 {
     base.FromBytes(binaryReader);
     auth_verifier = RpceUtility.AuthVerifierFromBytes(
         binaryReader,
         auth_length);
 }
Exemplo n.º 5
0
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            alloc_hint = binaryReader.ReadUInt32();
            p_cont_id  = binaryReader.ReadUInt16();
            opnum      = binaryReader.ReadUInt16();

            if ((pfc_flags & RpceCoPfcFlags.PFC_OBJECT_UUID) != 0)
            {
                @object = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
            }

            int stubLength = frag_length;

            stubLength -= GetSize();
            if (auth_verifier != null)
            {
                stubLength -= auth_verifier.Value.auth_pad_length;
                stubLength -= RpceUtility.AUTH_VERIFIER_SIZE;
                stubLength -= auth_length;
            }
            stub = binaryReader.ReadBytes(stubLength);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);
            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);
            pad = binaryReader.ReadUInt32();

            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                pad = EndianUtility.ReverseByteOrder(pad);
            }
        }
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            max_xmit_frag  = binaryReader.ReadUInt16();
            max_recv_frag  = binaryReader.ReadUInt16();
            assoc_group_id = binaryReader.ReadUInt32();

            p_context_elem = new p_cont_list_t();

            p_context_elem.n_context_elem = binaryReader.ReadByte();
            p_context_elem.reserved       = binaryReader.ReadByte();
            p_context_elem.reserved2      = binaryReader.ReadUInt16();

            p_context_elem.p_cont_elem = new p_cont_elem_t[p_context_elem.n_context_elem];
            for (int i = 0; i < p_context_elem.n_context_elem; i++)
            {
                p_context_elem.p_cont_elem[i].p_cont_id      = binaryReader.ReadUInt16();
                p_context_elem.p_cont_elem[i].n_transfer_syn = binaryReader.ReadByte();
                p_context_elem.p_cont_elem[i].reserved       = binaryReader.ReadByte();

                p_context_elem.p_cont_elem[i].abstract_syntax = new p_syntax_id_t();
                p_context_elem.p_cont_elem[i].abstract_syntax.if_uuid
                    = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
                p_context_elem.p_cont_elem[i].abstract_syntax.if_vers_major
                    = binaryReader.ReadUInt16();
                p_context_elem.p_cont_elem[i].abstract_syntax.if_vers_minor
                    = binaryReader.ReadUInt16();

                p_context_elem.p_cont_elem[i].transfer_syntaxes
                    = new p_syntax_id_t[p_context_elem.p_cont_elem[i].n_transfer_syn];
                for (int j = 0; j < p_context_elem.p_cont_elem[i].transfer_syntaxes.Length; j++)
                {
                    p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_uuid
                        = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
                    p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_vers_major
                        = binaryReader.ReadUInt16();
                    p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_vers_minor
                        = binaryReader.ReadUInt16();
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            max_xmit_frag  = binaryReader.ReadUInt16();
            max_recv_frag  = binaryReader.ReadUInt16();
            assoc_group_id = binaryReader.ReadUInt32();

            sec_addr           = new port_any_t();
            sec_addr.length    = binaryReader.ReadUInt16();
            sec_addr.port_spec = binaryReader.ReadBytes(sec_addr.length);

            // restore 4-octet alignment
            int pad2length = RpceUtility.Align((int)binaryReader.BaseStream.Position, 4)
                             - (int)binaryReader.BaseStream.Position;

            pad2 = binaryReader.ReadBytes(pad2length);

            p_result_list           = new p_result_list_t();
            p_result_list.n_results = binaryReader.ReadByte();
            p_result_list.reserved  = binaryReader.ReadByte();
            p_result_list.reserved2 = binaryReader.ReadUInt16();

            p_result_list.p_results = new p_result_t[p_result_list.n_results];
            for (int i = 0; i < p_result_list.n_results; i++)
            {
                p_result_list.p_results[i].result          = (p_cont_def_result_t)binaryReader.ReadUInt16();
                p_result_list.p_results[i].reason          = (p_provider_reason_t)binaryReader.ReadUInt16();
                p_result_list.p_results[i].transfer_syntax = new p_syntax_id_t();
                p_result_list.p_results[i].transfer_syntax.if_uuid
                    = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
                p_result_list.p_results[i].transfer_syntax.if_vers_major
                    = binaryReader.ReadUInt16();
                p_result_list.p_results[i].transfer_syntax.if_vers_minor
                    = binaryReader.ReadUInt16();
            }
        }
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            max_xmit_frag  = binaryReader.ReadUInt16();
            max_recv_frag  = binaryReader.ReadUInt16();
            assoc_group_id = binaryReader.ReadUInt32();

            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                max_xmit_frag  = EndianUtility.ReverseByteOrder(max_xmit_frag);
                max_recv_frag  = EndianUtility.ReverseByteOrder(max_recv_frag);
                assoc_group_id = EndianUtility.ReverseByteOrder(assoc_group_id);
            }

            sec_addr        = new port_any_t();
            sec_addr.length = binaryReader.ReadUInt16();
            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                sec_addr.length = EndianUtility.ReverseByteOrder(sec_addr.length);
            }
            sec_addr.port_spec = binaryReader.ReadBytes(sec_addr.length);

            // restore 4-octet alignment
            int pad2Length = RpceUtility.Align((int)binaryReader.BaseStream.Position, 4)
                             - (int)binaryReader.BaseStream.Position;

            pad2 = binaryReader.ReadBytes(pad2Length);

            p_result_list           = new p_result_list_t();
            p_result_list.n_results = binaryReader.ReadByte();
            p_result_list.reserved  = binaryReader.ReadByte();
            p_result_list.reserved2 = binaryReader.ReadUInt16();

            p_result_list.p_results = new p_result_t[p_result_list.n_results];
            for (int i = 0; i < p_result_list.n_results; i++)
            {
                if (packed_drep.dataRepFormat == RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
                {
                    p_result_list.p_results[i].result = (p_cont_def_result_t)binaryReader.ReadUInt16();
                    p_result_list.p_results[i].reason = (p_provider_reason_t)binaryReader.ReadUInt16();
                }
                else
                {
                    p_result_list.p_results[i].result = (p_cont_def_result_t)EndianUtility.ReverseByteOrder(binaryReader.ReadUInt16());
                    p_result_list.p_results[i].reason = (p_provider_reason_t)EndianUtility.ReverseByteOrder(binaryReader.ReadUInt16());
                }

                p_result_list.p_results[i].transfer_syntax = new p_syntax_id_t();
                p_result_list.p_results[i].transfer_syntax.if_uuid
                    = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
                p_result_list.p_results[i].transfer_syntax.if_version
                    = binaryReader.ReadUInt32();

                if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
                {
                    p_result_list.p_results[i].transfer_syntax.if_uuid    = EndianUtility.ReverseByteOrder(p_result_list.p_results[i].transfer_syntax.if_uuid);
                    p_result_list.p_results[i].transfer_syntax.if_version = EndianUtility.ReverseByteOrder(p_result_list.p_results[i].transfer_syntax.if_version);
                }
            }
        }
        /// <summary>
        /// Un-marshal a byte array to PDU struct.
        /// </summary>
        /// <param name="binaryReader">BinaryReader</param>
        internal override void FromBytes(BinaryReader binaryReader)
        {
            base.FromBytes(binaryReader);

            auth_verifier = RpceUtility.AuthVerifierFromBytes(
                binaryReader,
                auth_length);

            max_xmit_frag  = binaryReader.ReadUInt16();
            max_recv_frag  = binaryReader.ReadUInt16();
            assoc_group_id = binaryReader.ReadUInt32();

            if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
            {
                max_xmit_frag  = EndianUtility.ReverseByteOrder(max_xmit_frag);
                max_recv_frag  = EndianUtility.ReverseByteOrder(max_recv_frag);
                assoc_group_id = EndianUtility.ReverseByteOrder(assoc_group_id);
            }

            p_context_elem = new p_cont_list_t();

            p_context_elem.n_context_elem = binaryReader.ReadByte();
            p_context_elem.reserved       = binaryReader.ReadByte();
            p_context_elem.reserved2      = binaryReader.ReadUInt16();

            p_context_elem.p_cont_elem = new p_cont_elem_t[p_context_elem.n_context_elem];
            for (int i = 0; i < p_context_elem.n_context_elem; i++)
            {
                p_context_elem.p_cont_elem[i].p_cont_id      = binaryReader.ReadUInt16();
                p_context_elem.p_cont_elem[i].n_transfer_syn = binaryReader.ReadByte();
                p_context_elem.p_cont_elem[i].reserved       = binaryReader.ReadByte();

                p_context_elem.p_cont_elem[i].abstract_syntax = new p_syntax_id_t();
                p_context_elem.p_cont_elem[i].abstract_syntax.if_uuid
                    = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
                p_context_elem.p_cont_elem[i].abstract_syntax.if_version
                    = binaryReader.ReadUInt32();

                if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
                {
                    p_context_elem.p_cont_elem[i].p_cont_id = EndianUtility.ReverseByteOrder(p_context_elem.p_cont_elem[i].p_cont_id);
                    p_context_elem.p_cont_elem[i].abstract_syntax.if_uuid    = EndianUtility.ReverseByteOrder(p_context_elem.p_cont_elem[i].abstract_syntax.if_uuid);
                    p_context_elem.p_cont_elem[i].abstract_syntax.if_version = EndianUtility.ReverseByteOrder(p_context_elem.p_cont_elem[i].abstract_syntax.if_version);
                }

                p_context_elem.p_cont_elem[i].transfer_syntaxes
                    = new p_syntax_id_t[p_context_elem.p_cont_elem[i].n_transfer_syn];
                for (int j = 0; j < p_context_elem.p_cont_elem[i].transfer_syntaxes.Length; j++)
                {
                    p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_uuid
                        = new Guid(binaryReader.ReadBytes(RpceUtility.GUID_SIZE));
                    p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_version
                        = binaryReader.ReadUInt32();

                    if (packed_drep.dataRepFormat != RpceDataRepresentationFormat.IEEE_LittleEndian_ASCII)
                    {
                        p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_uuid    = EndianUtility.ReverseByteOrder(p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_uuid);
                        p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_version = EndianUtility.ReverseByteOrder(p_context_elem.p_cont_elem[i].transfer_syntaxes[j].if_version);
                    }
                }
            }
        }