예제 #1
0
 internal static IpV4OptionTimestampAndAddress Read(IpV4OptionTimestampType timestampType, byte overflow, byte pointedIndex, byte[] buffer, ref int offset, int numValues)
 {
     if (numValues % 2 != 0)
     {
         return((IpV4OptionTimestampAndAddress)null);
     }
     IpV4OptionTimedAddress[] optionTimedAddressArray = new IpV4OptionTimedAddress[numValues / 2];
     for (int index = 0; index != numValues / 2; ++index)
     {
         optionTimedAddressArray[index] = new IpV4OptionTimedAddress(ByteArrayExtensions.ReadIpV4Address(buffer, ref offset, Endianity.Big), ByteArrayExtensions.ReadIpV4TimeOfDay(buffer, ref offset, Endianity.Big));
     }
     return(new IpV4OptionTimestampAndAddress(timestampType, overflow, pointedIndex, optionTimedAddressArray));
 }
예제 #2
0
        internal static IpV4OptionTimestampAndAddress Read(IpV4OptionTimestampType timestampType, byte overflow, byte pointedIndex, byte[] buffer, ref int offset, int numValues)
        {
            if (numValues % 2 != 0)
            {
                return(null);
            }

            IpV4OptionTimedAddress[] addressesAndTimestamps = new IpV4OptionTimedAddress[numValues / 2];
            for (int i = 0; i != numValues / 2; ++i)
            {
                addressesAndTimestamps[i] = new IpV4OptionTimedAddress(buffer.ReadIpV4Address(ref offset, Endianity.Big),
                                                                       buffer.ReadIpV4TimeOfDay(ref offset, Endianity.Big));
            }

            return(new IpV4OptionTimestampAndAddress(timestampType, overflow, pointedIndex, addressesAndTimestamps));
        }