Пример #1
0
            public PrivateMessage Decode(BitArrayInputStream input)
            {
                PrivateMessage message = new PrivateMessage();

                message.InitDefaults();
                input.ReadBit();
                input.skipUnreadedBits();
                message.privateIEs = new List <PrivateIE_Field>();
                const int nBits = 0x10;
                int       num5  = input.ReadBits(nBits) + 1;

                for (int i = 0; i < num5; i++)
                {
                    PrivateIE_Field item = PrivateIE_Field.PerDecoder.Instance.Decode(input);
                    message.privateIEs.Add(item);
                }
                return(message);
            }
Пример #2
0
            public PrivateIE_Field Decode(BitArrayInputStream input)
            {
                PrivateIE_Field field = new PrivateIE_Field();

                field.InitDefaults();
                input.skipUnreadedBits();
                int nBits = 0;

                while (true)
                {
                    switch (input.ReadBit())
                    {
                    case 0:
                        nBits += input.ReadBits(7);
                        goto Label_00A5;

                    case 1:
                        switch (input.ReadBit())
                        {
                        case 0:
                            nBits += input.ReadBits(14);
                            goto Label_00A5;

                        case 1:
                            input.ReadBits(2);
                            nBits += input.ReadBits(4) * 0x400;
                            break;
                        }
                        break;
                    }
                }
Label_00A5:
                long num3 = input.Position;

                try
                {
                    field.id = PrivateIE_ID.PerDecoder.Instance.Decode(input);
                    input.skipUnreadedBits();
                }
                catch (Exception)
                {
                    input.skipUnreadedBits();
                    input.Position  = num3;
                    field.id.global = input.readOctetString(nBits);
                }
                if (input.Position != (num3 + nBits))
                {
                    input.Position = num3 + nBits;
                }
                int num4 = 2;

                field.criticality = (Criticality)input.ReadBits(num4);
                input.skipUnreadedBits();
                nBits = 0;
                while (true)
                {
                    switch (input.ReadBit())
                    {
                    case 0:
                        nBits += input.ReadBits(7);
                        goto Label_01AE;

                    case 1:
                        switch (input.ReadBit())
                        {
                        case 0:
                            nBits += input.ReadBits(14);
                            goto Label_01AE;

                        case 1:
                            input.ReadBits(2);
                            nBits += input.ReadBits(4) * 0x400;
                            break;
                        }
                        break;
                    }
                }
Label_01AE:
                num3 = input.Position;
                try
                {
                    field.value = S1AP_PRIVATE_IES.Switcher(field.id, "Value", input);
                    input.skipUnreadedBits();
                }
                catch (Exception)
                {
                    input.skipUnreadedBits();
                    input.Position = num3;
                    field.value    = input.readOctetString(nBits);
                }
                if (input.Position != (num3 + nBits))
                {
                    input.Position = num3 + nBits;
                }
                return(field);
            }
Пример #3
0
            public PrivateIE_Field Decode(BitArrayInputStream input)
            {
                PrivateIE_Field field = new PrivateIE_Field();
                field.InitDefaults();
                input.skipUnreadedBits();
                int nBits = 0;
                while (true)
                {
                    switch (input.ReadBit())
                    {
                        case 0:
                            nBits += input.ReadBits(7);
                            goto Label_00A5;

                        case 1:
                            switch (input.ReadBit())
                            {
                                case 0:
                                    nBits += input.ReadBits(14);
                                    goto Label_00A5;

                                case 1:
                                    input.ReadBits(2);
                                    nBits += input.ReadBits(4) * 0x400;
                                    break;
                            }
                            break;
                    }
                }
            Label_00A5:
                long num3 = input.Position;
                try
                {
                    field.id = PrivateIE_ID.PerDecoder.Instance.Decode(input);
                    input.skipUnreadedBits();
                }
                catch (Exception)
                {
                    input.skipUnreadedBits();
                    input.Position = num3;
                    field.id.global = input.readOctetString(nBits);
                }
                if (input.Position != (num3 + nBits))
                {
                    input.Position = num3 + nBits;
                }
                int num4 = 2;
                field.criticality = (Criticality)input.ReadBits(num4);
                input.skipUnreadedBits();
                nBits = 0;
                while (true)
                {
                    switch (input.ReadBit())
                    {
                        case 0:
                            nBits += input.ReadBits(7);
                            goto Label_01AE;

                        case 1:
                            switch (input.ReadBit())
                            {
                                case 0:
                                    nBits += input.ReadBits(14);
                                    goto Label_01AE;

                                case 1:
                                    input.ReadBits(2);
                                    nBits += input.ReadBits(4) * 0x400;
                                    break;
                            }
                            break;
                    }
                }
            Label_01AE:
                num3 = input.Position;
                try
                {
                    field.value = S1AP_PRIVATE_IES.Switcher(field.id, "Value", input);
                    input.skipUnreadedBits();
                }
                catch (Exception)
                {
                    input.skipUnreadedBits();
                    input.Position = num3;
                    field.value = input.readOctetString(nBits);
                }
                if (input.Position != (num3 + nBits))
                {
                    input.Position = num3 + nBits;
                }
                return field;
            }