当前位置: 首页>>代码示例>>C#>>正文


C# DataSegment.ReadUInt方法代码示例

本文整理汇总了C#中DataSegment.ReadUInt方法的典型用法代码示例。如果您正苦于以下问题:C# DataSegment.ReadUInt方法的具体用法?C# DataSegment.ReadUInt怎么用?C# DataSegment.ReadUInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSegment的用法示例。


在下文中一共展示了DataSegment.ReadUInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateInstance

        internal override IpV6Option CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
                return null;

            return new IpV6OptionJumboPayload(data.ReadUInt(0, Endianity.Big));
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:7,代码来源:IpV6OptionJumboPayload.cs

示例2: ReadData

 public static void ReadData(DataSegment data, out IpV4OptionQuickStartFunction function, out byte rate, out byte ttl, out uint nonce)
 {
     function = (IpV4OptionQuickStartFunction)(data[Offset.Function] & Mask.Function);
     rate = (byte)(data[Offset.Rate] & Mask.Rate);
     ttl = data[Offset.Ttl];
     nonce = data.ReadUInt(Offset.Nonce, Endianity.Big);
 }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:7,代码来源:IpOptionQuickStartCommon.cs

示例3: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
                return null;

            uint greKeyIdentifier = data.ReadUInt(Offset.GreKeyIdentifier, Endianity.Big);
            return new IpV6MobilityOptionGreKey(greKeyIdentifier);
        }
开发者ID:JackWangCUMT,项目名称:WiFiSpy,代码行数:8,代码来源:IpV6MobilityOptionGreKey.cs

示例4: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
                return null;

            uint restartCounter = data.ReadUInt(0, Endianity.Big);
            return new IpV6MobilityOptionRestartCounter(restartCounter);
        }
开发者ID:amitla,项目名称:Pcap.Net,代码行数:8,代码来源:IpV6MobilityOptionRestartCounter.cs

示例5: CreateInstance

        /// <summary>
        /// Parses an option from the given data.
        /// </summary>
        /// <param name="data">The data to parse.</param>
        /// <returns>The option if parsing was successful, null otherwise.</returns>
        public IpV6Option CreateInstance(DataSegment data)
        {
            if (data == null) 
                throw new ArgumentNullException("data");
            if (data.Length != OptionDataLength)
                return null;

            return new IpV6OptionJumboPayload(data.ReadUInt(0, Endianity.Big));
        }
开发者ID:amitla,项目名称:Pcap.Net,代码行数:14,代码来源:IpV6OptionJumboPayload.cs

示例6: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length < OptionDataMinimumLength)
                return null;

            uint vendorId = data.ReadUInt(Offset.VendorId, Endianity.Big);
            byte subType = data[Offset.SubType];
            DataSegment vendorSpecificData = data.Subsegment(Offset.Data, data.Length - Offset.Data);
            return new IpV6MobilityOptionVendorSpecific(vendorId, subType, vendorSpecificData);
        }
开发者ID:amitla,项目名称:Pcap.Net,代码行数:10,代码来源:IpV6MobilityOptionVendorSpecific.cs

示例7: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
                return null;

            IpV6MobileNodeGroupIdentifierSubtype subtype = (IpV6MobileNodeGroupIdentifierSubtype)data[Offset.SubType];
            uint mobileNodeGroupIdentifier = data.ReadUInt(Offset.MobileNodeGroupIdentifier, Endianity.Big);

            return new IpV6MobilityOptionMobileNodeGroupIdentifier(subtype, mobileNodeGroupIdentifier);
        }
开发者ID:amitla,项目名称:Pcap.Net,代码行数:10,代码来源:IpV6MobilityOptionMobileNodeGroupIdentifier.cs

示例8: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length < OptionDataMinimumLength)
                return null;

            IpV6AuthenticationSubtype subtype = (IpV6AuthenticationSubtype)data[Offset.Subtype];
            uint mobilitySecurityParameterIndex = data.ReadUInt(Offset.MobilitySecurityParameterIndex, Endianity.Big);
            DataSegment authenticationData = data.Subsegment(Offset.AuthenticationData, data.Length - Offset.AuthenticationData);

            return new IpV6MobilityOptionAuthentication(subtype, mobilitySecurityParameterIndex, authenticationData);
        }
开发者ID:amitla,项目名称:Pcap.Net,代码行数:11,代码来源:IpV6MobilityOptionAuthentication.cs

示例9: ParseData

        internal static IpV6ExtensionHeaderFragmentData ParseData(IpV4Protocol nextHeader, DataSegment data)
        {
            if (data.Length != DataLength)
                return null;

            ushort fragmentOffset = (ushort)((data.ReadUShort(DataOffset.FragmentOffset, Endianity.Big) & DataMask.FragmentOffset) >> DataShift.FragmentOffset);
            bool moreFragments = data.ReadBool(DataOffset.MoreFragments, DataMask.MoreFragments);
            uint identification = data.ReadUInt(DataOffset.Identification, Endianity.Big);

            return new IpV6ExtensionHeaderFragmentData(nextHeader, fragmentOffset, moreFragments, identification);
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:11,代码来源:IpV6ExtensionHeaderFragmentData.cs

示例10: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
                return null;

            bool udpEncapsulationRequired = data.ReadBool(Offset.UdpEncapsulationRequired, Mask.UdpEncapsulationRequired);
            uint refreshTime = data.ReadUInt(Offset.RefreshTime, Endianity.Big);
            return new IpV6MobilityOptionNatDetection(udpEncapsulationRequired, refreshTime);
        }
开发者ID:JackWangCUMT,项目名称:WiFiSpy,代码行数:9,代码来源:IpV6MobilityOptionNatDetection.cs

示例11: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length != OptionDataLength)
                return null;

            ushort priority = data.ReadUShort(Offset.Priority, Endianity.Big);
            uint sessionsInUse = data.ReadUInt(Offset.SessionsInUse, Endianity.Big);
            uint maximumSessions = data.ReadUInt(Offset.MaximumSessions, Endianity.Big);
            uint usedCapacity = data.ReadUInt(Offset.UsedCapacity, Endianity.Big);
            uint maximumCapacity = data.ReadUInt(Offset.MaximumCapacity, Endianity.Big);

            return new IpV6MobilityOptionLoadInformation(priority, sessionsInUse, maximumSessions, usedCapacity, maximumCapacity);
        }
开发者ID:JackWangCUMT,项目名称:WiFiSpy,代码行数:13,代码来源:IpV6MobilityOptionLoadInformation.cs

示例12: CreateInstance

        internal static IpV6ExtensionHeaderAuthentication CreateInstance(DataSegment extensionHeaderData, out int numBytesRead)
        {
            if (extensionHeaderData.Length < MinimumLength)
            {
                numBytesRead = 0;
                return null;
            }
            IpV4Protocol nextHeader = (IpV4Protocol)extensionHeaderData[Offset.NextHeader];
            byte payloadLength = extensionHeaderData[Offset.PayloadLength];
            if (extensionHeaderData.Length < Offset.AuthenticationData + payloadLength)
            {
                numBytesRead = 0;
                return null;
            }

            uint securityParametersIndex = extensionHeaderData.ReadUInt(Offset.SecurityParametersIndex, Endianity.Big);
            uint sequenceNumber = extensionHeaderData.ReadUInt(Offset.SequenceNumber, Endianity.Big);
            DataSegment authenticationData = extensionHeaderData.Subsegment(Offset.AuthenticationData, payloadLength);
            numBytesRead = Offset.AuthenticationData + payloadLength;

            return new IpV6ExtensionHeaderAuthentication(nextHeader, securityParametersIndex, sequenceNumber, authenticationData);
        }
开发者ID:shrknt35,项目名称:sonarlint-vs,代码行数:22,代码来源:IpV6ExtensionHeaderAuthentication.cs

示例13: CreateInstance

        internal override IpV6MobilityOption CreateInstance(DataSegment data)
        {
            if (data.Length < OptionDataMinimumLength)
                return null;

            uint securityParameterIndex = data.ReadUInt(Offset.SecurityParameterIndex, Endianity.Big);
            DataSegment authenticator = data.Subsegment(Offset.Authenticator, data.Length - Offset.Authenticator);
            return new IpV6MobilityOptionBindingAuthorizationDataForFmIpV6(securityParameterIndex, authenticator);
        }
开发者ID:amitla,项目名称:Pcap.Net,代码行数:9,代码来源:IpV6MobilityOptionBindingAuthorizationDataForFmIpV6.cs

示例14: ParseMessageData

        internal static IpV6ExtensionHeaderMobilityHeartbeatMessage ParseMessageData(IpV4Protocol nextHeader, ushort checksum, DataSegment messageData)
        {
            if (messageData.Length < MinimumMessageDataLength)
                return null;

            bool isUnsolicitedHeartbeatResponse = messageData.ReadBool(MessageDataOffset.IsUnsolicitedHeartbeatResponse, MessageDataMask.IsUnsolicitedHeartbeatResponse);
            bool isResponse = messageData.ReadBool(MessageDataOffset.IsResponse, MessageDataMask.IsResponse);
            uint sequenceNumber = messageData.ReadUInt(MessageDataOffset.SequenceNumber, Endianity.Big);
            IpV6MobilityOptions options = new IpV6MobilityOptions(messageData.Subsegment(MessageDataOffset.MobilityOptions, messageData.Length - MessageDataOffset.MobilityOptions));
            return new IpV6ExtensionHeaderMobilityHeartbeatMessage(nextHeader, checksum, isUnsolicitedHeartbeatResponse, isResponse, sequenceNumber, options);
        }
开发者ID:JackWangCUMT,项目名称:WiFiSpy,代码行数:11,代码来源:IpV6ExtensionHeaderMobilityHeartbeatMessage.cs

示例15: CreateInstance

        internal static IpV6ExtensionHeaderEncapsulatingSecurityPayload CreateInstance(DataSegment extensionHeaderData, out int numBytesRead)
        {
            if (extensionHeaderData.Length < MinimumLength)
            {
                numBytesRead = 0;
                return null;
            }
            uint securityParametersIndex = extensionHeaderData.ReadUInt(Offset.SecurityParametersIndex, Endianity.Big);
            uint sequenceNumber = extensionHeaderData.ReadUInt(Offset.SequenceNumber, Endianity.Big);
            DataSegment encryptedDataAndAuthenticationData = extensionHeaderData.Subsegment(Offset.PayloadData, extensionHeaderData.Length - Offset.PayloadData);
            numBytesRead = extensionHeaderData.Length;

            return new IpV6ExtensionHeaderEncapsulatingSecurityPayload(securityParametersIndex, sequenceNumber, encryptedDataAndAuthenticationData);
        }
开发者ID:shrknt35,项目名称:sonarlint-vs,代码行数:14,代码来源:IpV6ExtensionHeaderEncapsulatingSecurityPayload.cs


注:本文中的DataSegment.ReadUInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。