private bool EqualsRoutingData(IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks other) { return(other != null && CommonPrefixLengthForNonLastAddresses == other.CommonPrefixLengthForNonLastAddresses && CommonPrefixLengthForLastAddress == other.CommonPrefixLengthForLastAddress && PadSize == other.PadSize && Addresses.SequenceEqual(other.Addresses)); }
internal static IpV6ExtensionHeaderRouting ParseData(IpV4Protocol nextHeader, DataSegment data) { if (data.Length < DataMinimumLength) { return(null); } IpV6RoutingType routingType = (IpV6RoutingType)data[DataOffset.RoutingType]; byte segmentsLeft = data[DataOffset.SegmentsLeft]; DataSegment routingData = data.Subsegment(DataOffset.TypeSpecificData, data.Length - DataOffset.TypeSpecificData); switch (routingType) { case IpV6RoutingType.SourceRoute: return(IpV6ExtensionHeaderRoutingSourceRoute.ParseRoutingData(nextHeader, segmentsLeft, routingData)); case IpV6RoutingType.Nimrod: // Unused. return(null); case IpV6RoutingType.Type2RoutingHeader: return(IpV6ExtensionHeaderRoutingHomeAddress.ParseRoutingData(nextHeader, segmentsLeft, routingData)); case IpV6RoutingType.RoutingProtocolLowPowerAndLossyNetworksSourceRouteHeader: return(IpV6ExtensionHeaderRoutingProtocolLowPowerAndLossyNetworks.ParseRoutingData(nextHeader, segmentsLeft, routingData)); default: return(null); } }