internal static IpV6ExtensionHeader CreateInstanceStandard(IpV4Protocol nextHeader, DataSegment extensionHeaderData, out int numBytesRead)
        {
            numBytesRead = 0;
            if (extensionHeaderData.Length < MinimumLength)
            {
                return(null);
            }
            IpV4Protocol nextNextHeader = (IpV4Protocol)extensionHeaderData[Offset.NextHeader];
            int          length         = (extensionHeaderData[Offset.HeaderExtensionLength] + 1) * 8;

            if (extensionHeaderData.Length < length)
            {
                return(null);
            }

            DataSegment data = extensionHeaderData.Subsegment(Offset.Data, length - Offset.Data);

            numBytesRead = length;

            // TODO: Implement Shim6.
            switch (nextHeader)
            {
            case IpV4Protocol.IpV6HopByHopOption:     // 0
                return(IpV6ExtensionHeaderHopByHopOptions.ParseData(nextNextHeader, data));

            case IpV4Protocol.IpV6Route:     // 43
                return(IpV6ExtensionHeaderRouting.ParseData(nextNextHeader, data));

            case IpV4Protocol.FragmentHeaderForIpV6:     // 44
                return(IpV6ExtensionHeaderFragmentData.ParseData(nextNextHeader, data));

            case IpV4Protocol.IpV6Opts:                         // 60
                return(IpV6ExtensionHeaderDestinationOptions.ParseData(nextNextHeader, data));

            case IpV4Protocol.MobilityHeader:            // 135
                return(IpV6ExtensionHeaderMobility.ParseData(nextNextHeader, data));

            default:
                throw new InvalidOperationException("Invalid next header value" + nextHeader);
            }
        }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return other != null;
 }
 internal sealed override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityLocalizedRouting);
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityExperimental));
 }
Ejemplo n.º 5
0
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityBindingAcknowledgementBase));
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityExperimental);
 }
 internal override sealed bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityBindingUpdateBase);
 }
Ejemplo n.º 8
0
 internal abstract bool EqualsMessageData(IpV6ExtensionHeaderMobility other);
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(other != null);
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityHeartbeatMessage));
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityHandoverInitiateMessage));
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityHandoverAcknowledgeMessage);
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityHomeAgentSwitchMessage));
 }
Ejemplo n.º 14
0
 internal abstract bool EqualsMessageData(IpV6ExtensionHeaderMobility other);
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityBindingRevocationMessage));
 }
Ejemplo n.º 16
0
 private bool EqualsData(IpV6ExtensionHeaderMobility other)
 {
     return(other != null &&
            MobilityHeaderType == other.MobilityHeaderType && Checksum == other.Checksum && MobilityOptions.Equals(other.MobilityOptions) &&
            EqualsMessageData(other));
 }
Ejemplo n.º 17
0
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityCareOfTestInit));
 }
Ejemplo n.º 18
0
 private bool EqualsData(IpV6ExtensionHeaderMobility other)
 {
     return other != null &&
            MobilityHeaderType == other.MobilityHeaderType && Checksum == other.Checksum && MobilityOptions.Equals(other.MobilityOptions) &&
            EqualsMessageData(other);
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityBindingAcknowledgementBase);
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityBindingError);
 }
 internal sealed override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityLocalizedRouting));
 }
 internal override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return EqualsMessageData(other as IpV6ExtensionHeaderMobilityHomeTest);
 }
 internal sealed override bool EqualsMessageData(IpV6ExtensionHeaderMobility other)
 {
     return(EqualsMessageData(other as IpV6ExtensionHeaderMobilityBindingUpdateBase));
 }