private bool EqualsMessageData(IpV6ExtensionHeaderMobilityHandoverInitiateMessage other)
 {
     return(other != null &&
            SequenceNumber == other.SequenceNumber && AssignedAddressConfiguration == other.AssignedAddressConfiguration && Buffer == other.Buffer &&
            Code == other.Code);
 }
        internal static IpV6ExtensionHeaderMobility ParseData(IpV4Protocol nextHeader, DataSegment data)
        {
            if (data.Length < MinimumDataLength)
            {
                return(null);
            }

            IpV6MobilityHeaderType mobilityHeaderType = (IpV6MobilityHeaderType)data[DataOffset.MobilityHeaderType];
            ushort      checksum    = data.ReadUShort(DataOffset.Checksum, Endianity.Big);
            DataSegment messageData = data.Subsegment(DataOffset.MessageData, data.Length - DataOffset.MessageData);

            switch (mobilityHeaderType)
            {
            case IpV6MobilityHeaderType.BindingRefreshRequest:     // 0
                return(IpV6ExtensionHeaderMobilityBindingRefreshRequest.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.HomeTestInit:     // 1
                return(IpV6ExtensionHeaderMobilityHomeTestInit.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.CareOfTestInit:     // 2
                return(IpV6ExtensionHeaderMobilityCareOfTestInit.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.HomeTest:     // 3
                return(IpV6ExtensionHeaderMobilityHomeTest.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.CareOfTest:     // 4
                return(IpV6ExtensionHeaderMobilityCareOfTest.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.BindingUpdate:     // 5
                return(IpV6ExtensionHeaderMobilityBindingUpdate.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.BindingAcknowledgement:     // 6
                return(IpV6ExtensionHeaderMobilityBindingAcknowledgement.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.BindingError:     // 7
                return(IpV6ExtensionHeaderMobilityBindingError.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.FastBindingUpdate:     // 8
                return(IpV6ExtensionHeaderMobilityFastBindingUpdate.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.FastBindingAcknowledgement:     // 9
                return(IpV6ExtensionHeaderMobilityFastBindingAcknowledgement.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.FastNeighborAdvertisement:     // 10
                return(IpV6ExtensionHeaderMobilityFastNeighborAdvertisement.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.Experimental:     // 11
                return(IpV6ExtensionHeaderMobilityExperimental.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.HomeAgentSwitchMessage:     // 12
                return(IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.HeartbeatMessage:     // 13
                return(IpV6ExtensionHeaderMobilityHeartbeatMessage.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.HandoverInitiateMessage:     // 14
                return(IpV6ExtensionHeaderMobilityHandoverInitiateMessage.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.HandoverAcknowledgeMessage:     // 15
                return(IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.BindingRevocationMessage:     // 16
                return(IpV6ExtensionHeaderMobilityBindingRevocationMessage.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.LocalizedRoutingInitiation:     // 17
                return(IpV6ExtensionHeaderMobilityLocalizedRoutingInitiation.ParseMessageData(nextHeader, checksum, messageData));

            case IpV6MobilityHeaderType.LocalizedRoutingAcknowledgement:     // 18
                return(IpV6ExtensionHeaderMobilityLocalizedRoutingAcknowledgement.ParseMessageData(nextHeader, checksum, messageData));

            default:
                return(null);
            }
        }
 private bool EqualsMessageData(IpV6ExtensionHeaderMobilityHandoverInitiateMessage other)
 {
     return other != null &&
            SequenceNumber == other.SequenceNumber && AssignedAddressConfiguration == other.AssignedAddressConfiguration && Buffer == other.Buffer &&
            Code == other.Code;
 }