Commit 5c5d2b2f authored by Brickner_cp's avatar Brickner_cp

200 warnings left.

Code Coverage 96.13%
parent 46613819
......@@ -18,6 +18,7 @@
<Word>ax</Word>
<Word>axfr</Word>
<Word>bbn</Word> <!-- Probably BBN Technologies (originally Bolt, Beranek and Newman) -->
<Word>calipso</Word>
<Word>cbt</Word>
<Word>ccitt</Word>
<Word>cftp</Word> <!-- maybe Configurable Fault Tolerant Processor -->
......@@ -53,6 +54,7 @@
<Word>ipsilon</Word> <!-- As in Ipsilon Networks -->
<Word>ipx</Word>
<Word>ixfr</Word>
<Word>keygen</Word>
<Word>kryptolan</Word>
<Word>lite</Word>
<Word>llq</Word>
......@@ -62,6 +64,7 @@
<Word>multiprotocol</Word>
<Word>nca</Word>
<Word>netmask</Word>
<Word>nonces</Word>
<Word>nsa</Word>
<Word>osi</Word>
<Word>pcap</Word>
......@@ -87,7 +90,9 @@
<Word>unicast</Word>
<Word>uti</Word>
<Word>vpn</Word>
<Word>wi</Word>
<Word>wiegand</Word>
<Word>wo</Word>
<Word>xtp</Word>
<Word>yx</Word> <!--Yet exists?-->
</Recognized>
......
......@@ -559,7 +559,7 @@ namespace PcapDotNet.Packets.TestUtils
public static IpV6AccessNetworkIdentifierSubOption NextIpV6AccessNetworkIdentifierSubOption(this Random random)
{
IpV6AccessNetworkIdentifierSubOptionType optionType = random.NextEnum<IpV6AccessNetworkIdentifierSubOptionType>();
IpV6AccessNetworkIdentifierSubOptionType optionType = random.NextEnum(IpV6AccessNetworkIdentifierSubOptionType.None);
switch (optionType)
{
case IpV6AccessNetworkIdentifierSubOptionType.NetworkIdentifier:
......@@ -568,8 +568,8 @@ namespace PcapDotNet.Packets.TestUtils
case IpV6AccessNetworkIdentifierSubOptionType.GeoLocation:
double latitude = random.NextDouble() * 180 - 90;
double longtitude = random.NextDouble() * 360 - 180;
return IpV6AccessNetworkIdentifierSubOptionGeoLocation.CreateFromRealValues(latitude, longtitude);
double longitude = random.NextDouble() * 360 - 180;
return IpV6AccessNetworkIdentifierSubOptionGeoLocation.CreateFromRealValues(latitude, longitude);
case IpV6AccessNetworkIdentifierSubOptionType.OperatorIdentifier:
return new IpV6AccessNetworkIdentifierSubOptionOperatorIdentifier(random.NextEnum<IpV6AccessNetworkIdentifierOperatorIdentifierType>(),
......
......@@ -107,12 +107,12 @@ namespace PcapDotNet.Packets.Dns
internal override void WriteDataSimple(byte[] buffer, int offset)
{
byte[] longtitudeBytes = Encoding.ASCII.GetBytes(Longitude);
byte[] longitudeBytes = Encoding.ASCII.GetBytes(Longitude);
byte[] latitudeBytes = Encoding.ASCII.GetBytes(Latitude);
byte[] altitudeBytes = Encoding.ASCII.GetBytes(Altitude);
buffer.Write(ref offset, (byte)longtitudeBytes.Length);
buffer.Write(ref offset, longtitudeBytes);
buffer.Write(ref offset, (byte)longitudeBytes.Length);
buffer.Write(ref offset, longitudeBytes);
buffer.Write(ref offset, (byte)latitudeBytes.Length);
buffer.Write(ref offset, latitudeBytes);
buffer.Write(ref offset, (byte)altitudeBytes.Length);
......@@ -124,11 +124,11 @@ namespace PcapDotNet.Packets.Dns
if (data.Length < 3)
return null;
int longtitudeNumBytes = data[0];
if (data.Length < longtitudeNumBytes + 3)
int longitudeNumBytes = data[0];
if (data.Length < longitudeNumBytes + 3)
return null;
string longtitude = data.Subsegment(1, longtitudeNumBytes).Decode(Encoding.ASCII);
data = data.Subsegment(longtitudeNumBytes + 1, data.Length - longtitudeNumBytes - 1);
string longitude = data.Subsegment(1, longitudeNumBytes).Decode(Encoding.ASCII);
data = data.Subsegment(longitudeNumBytes + 1, data.Length - longitudeNumBytes - 1);
int latitudeNumBytes = data[0];
if (data.Length < latitudeNumBytes + 2)
......@@ -141,7 +141,7 @@ namespace PcapDotNet.Packets.Dns
return null;
string altitude = data.Subsegment(1, altitudeNumBytes).Decode(Encoding.ASCII);
return new DnsResourceDataGeographicalPosition(longtitude, latitude, altitude);
return new DnsResourceDataGeographicalPosition(longitude, latitude, altitude);
}
}
}
\ No newline at end of file
......@@ -63,22 +63,22 @@ namespace PcapDotNet.Packets.IpV4
/// Converts the string representation of an IPv4 address (1.2.3.4) to its IPv4 address equivalent.
/// A return value indicates whether the conversion succeeded.
/// </summary>
/// <param name="ipV6AddressString">A string containing the IPv4 address to convert (1.2.3.4).</param>
/// <param name="value">A string containing the IPv4 address to convert (1.2.3.4).</param>
/// <param name="result">
/// When this method returns, contains the IPv4 address value equivalent of the IPv4 address contained in s, if the conversion succeeded,
/// or zero IPv4 address if the conversion failed.
/// The conversion fails if the s parameter is null or String.Empty or is not of the correct format. This parameter is passed uninitialized.
/// </param>
/// <returns>True iff parsing was successful.</returns>
public static bool TryParse(string ipV6AddressString, out IpV4Address result)
public static bool TryParse(string value, out IpV4Address result)
{
if (ipV6AddressString == null)
if (value == null)
{
result = Zero;
return false;
}
string[] valuesStrings = ipV6AddressString.Split('.');
string[] valuesStrings = value.Split('.');
if (valuesStrings.Length != 4)
{
result = Zero;
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6BindingErrorStatus : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// RFC 6275.
/// </summary>
......@@ -12,7 +17,8 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6275.
/// Unrecognized MH Type value.
/// </summary>
UnrecognizedMhTypeValue = 2,
UnrecognizedMobilityHeaderTypeValue = 2,
}
}
\ No newline at end of file
......@@ -159,7 +159,7 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public string ToString(IFormatProvider provider)
{
return ToString("X4", CultureInfo.InvariantCulture);
return ToString("X4", provider);
}
/// <summary>
......
......@@ -25,22 +25,23 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 5845.
/// </summary>
GreTunnelingButTlvHeaderNotSupported = 3,
GreTunnelingButTypeLengthValueHeaderNotSupported = 3,
/// <summary>
/// RFC 5648.
/// </summary>
McoaNotComplete = 4,
MultipleCareOfAddressesNotComplete = 4,
/// <summary>
/// RFC 5648.
/// </summary>
McoaReturnHomeWoNdp = 5,
MultipleCareOfAddressesReturnHomeWoNeighborDiscoveryProtocol = 5,
/// <summary>
/// RFC 6058.
/// PBU_ACCEPTED_TB_IGNORED_SETTINGSMISMATCH.
/// </summary>
PbuAcceptedTbIgnoredSettingsMistmatch = 6,
ProxyBindingUpdateAcceptedTransientBindingIgnoredSettingsMismatch = 6,
/// <summary>
/// RFCs 5568, 6275.
......@@ -132,7 +133,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 4285.
/// </summary>
MIpV6MesgIdReqd = 145,
MIpV6MessageIdRequired = 145,
/// <summary>
/// RFC 4285.
......@@ -147,7 +148,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 4866.
/// </summary>
CgaAndSignatureVerificationFailed = 148,
CryptographicallyGeneratedAddressAndSignatureVerificationFailed = 148,
/// <summary>
/// RFC 4866.
......@@ -171,13 +172,14 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 5213.
/// NOT_LMA_FOR_THIS_MOBILE_NODE.
/// </summary>
NotLmaForThisMobileNode = 153,
NotLocalMobilityAnchorForThisMobileNode = 153,
/// <summary>
/// RFC 5213.
/// </summary>
MagNotAuthorizedForProxyReg = 154,
MobileAccessGatewayNotAuthorizedForProxyReg = 154,
/// <summary>
/// RFC 5213.
......@@ -191,8 +193,9 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 5213.
/// TIMESTAMP_LOWER_THAN_PREV_ACCEPTED.
/// </summary>
TimestampLowerThanPrevAccepted = 157,
TimestampLowerThanPreviousAccepted = 157,
/// <summary>
/// RFC 5213.
......@@ -202,12 +205,13 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 5213.
/// </summary>
BcePbuPrefixSetDoNotMatch = 159,
BceProxyBindingUpdatePrefixSetDoNotMatch = 159,
/// <summary>
/// RFC 5213.
/// MISSING_MN_IDENTIFIER_OPTION.
/// </summary>
MissingMnIdentifierOption = 160,
MissingMobileNodeIdentifierOption = 160,
/// <summary>
/// RFC 5213.
......@@ -227,32 +231,32 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 5648.
/// </summary>
McoaMalformed = 164,
MultipleCareOfAddressesMalformed = 164,
/// <summary>
/// RFC 5648.
/// </summary>
McoaNonMcoaBindingExists = 165,
MultipleCareOfAddressesNonMultipleCareOfAddressesBindingExists = 165,
/// <summary>
/// RFC 5648.
/// </summary>
McoaProhibited = 166,
MultipleCareOfAddressesProhibited = 166,
/// <summary>
/// RFC 5648.
/// </summary>
McoaUnknownCoa = 167,
MultipleCareOfAddressesUnknownCareOfAddress = 167,
/// <summary>
/// RFC 5648.
/// </summary>
McoaBulkRegistarationProhiited = 168,
MultipleCareOfAddressesBulkRegistrationProhibited = 168,
/// <summary>
/// RFC 5648.
/// </summary>
McoaSimultaneousHomeAndForeignProhibited = 169,
MultipleCareOfAddressesSimultaneousHomeAndForeignProhibited = 169,
/// <summary>
/// RFC 5844.
......@@ -286,7 +290,8 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// RFC 6618.
/// REINIT_SA_WITH_HAC.
/// </summary>
ReinitSaWithHac = 176,
ReinitializeSecurityAssociationWithHomeAgentController = 176,
}
}
\ No newline at end of file
......@@ -39,7 +39,7 @@ namespace PcapDotNet.Packets.IpV6
public const int OptionDataLength = Offset.LongitudeDegrees + UInt24.SizeOf;
/// <summary>
/// Creates an instance from latitude and longtitude degrees using integer numbers encoded as a two's complement, fixed point number with 9 whole bits.
/// Creates an instance from latitude and longitude degrees using integer numbers encoded as a two's complement, fixed point number with 9 whole bits.
/// See <see cref="IpV6AccessNetworkIdentifierSubOptionGeoLocation.CreateFromRealValues"/> for using real numbers for the degrees.
/// </summary>
/// <param name="latitudeDegrees">
......@@ -63,33 +63,37 @@ namespace PcapDotNet.Packets.IpV6
string.Format(CultureInfo.InvariantCulture, "LatitudeDegreesReal is {0} and must be in [-90, 90] range.",
latitudeDegreesReal));
double longtitudeDegreesReal = LongitudeDegreesReal;
if (longtitudeDegreesReal < -180 || longtitudeDegreesReal > 180)
double longitudeDegreesReal = LongitudeDegreesReal;
if (longitudeDegreesReal < -180 || longitudeDegreesReal > 180)
throw new ArgumentOutOfRangeException("longitudeDegrees", longitudeDegrees,
string.Format(CultureInfo.InvariantCulture,
"LongitudeDegreesReal is {0} and must be in [-180, 180] range.", longtitudeDegreesReal));
"LongitudeDegreesReal is {0} and must be in [-180, 180] range.", longitudeDegreesReal));
}
/// <summary>
/// Creates an instance from latitude and longtitude degrees using real numbers.
/// Creates an instance from latitude and longitude degrees using real numbers.
/// </summary>
/// <param name="latitudeDegreesReal">
/// Positive degrees correspond to the Northern Hemisphere and negative degrees correspond to the Southern Hemisphere.
/// The value ranges from -90 to +90 degrees.
/// </param>
/// <param name="longtitudeDegreesReal">
/// <param name="longitudeDegreesReal">
/// The value ranges from -180 to +180 degrees.
/// </param>
/// <returns>An instance created from the given real degrees values.</returns>
public static IpV6AccessNetworkIdentifierSubOptionGeoLocation CreateFromRealValues(double latitudeDegreesReal, double longtitudeDegreesReal)
public static IpV6AccessNetworkIdentifierSubOptionGeoLocation CreateFromRealValues(double latitudeDegreesReal, double longitudeDegreesReal)
{
if (latitudeDegreesReal < -90 || latitudeDegreesReal > 90)
throw new ArgumentOutOfRangeException("latitudeDegreesReal", latitudeDegreesReal, string.Format("LatitudeDegreesReal is {0} and must be in [-90, 90] range.", latitudeDegreesReal));
throw new ArgumentOutOfRangeException("latitudeDegreesReal", latitudeDegreesReal,
string.Format(CultureInfo.InvariantCulture, "LatitudeDegreesReal is {0} and must be in [-90, 90] range.",
latitudeDegreesReal));
if (longtitudeDegreesReal < -180 || longtitudeDegreesReal > 180)
throw new ArgumentOutOfRangeException("longtitudeDegreesReal", longtitudeDegreesReal, string.Format("LongitudeDegreesReal is {0} and must be in [-180, 180] range.", longtitudeDegreesReal));
if (longitudeDegreesReal < -180 || longitudeDegreesReal > 180)
throw new ArgumentOutOfRangeException("longitudeDegreesReal", longitudeDegreesReal,
string.Format(CultureInfo.InvariantCulture,
"LongitudeDegreesReal is {0} and must be in [-180, 180] range.", longitudeDegreesReal));
return new IpV6AccessNetworkIdentifierSubOptionGeoLocation(ToInteger(latitudeDegreesReal), ToInteger(longtitudeDegreesReal));
return new IpV6AccessNetworkIdentifierSubOptionGeoLocation(ToInteger(latitudeDegreesReal), ToInteger(longitudeDegreesReal));
}
/// <summary>
......
......@@ -79,6 +79,11 @@ namespace PcapDotNet.Packets.IpV6
public IpV6AccessNetworkIdentifierSubOptionNetworkIdentifier(bool isNetworkNameUtf8, DataSegment networkName, DataSegment accessPointName)
: base(IpV6AccessNetworkIdentifierSubOptionType.NetworkIdentifier)
{
if (networkName == null)
throw new ArgumentNullException("networkName");
if (accessPointName == null)
throw new ArgumentNullException("accessPointName");
if (networkName.Length > byte.MaxValue)
throw new ArgumentOutOfRangeException("networkName", networkName,
string.Format(CultureInfo.InvariantCulture, "Network Name cannot be longer than {0} bytes.", byte.MaxValue));
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6AccessNetworkIdentifierSubOptionType : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// Network-Identifier sub-option.
/// </summary>
......
......@@ -8,7 +8,7 @@ namespace PcapDotNet.Packets.IpV6
/// <summary>
/// Reserved.
/// </summary>
Reserved = 0,
None = 0,
/// <summary>
/// Virtual.
......
......@@ -5,6 +5,11 @@ namespace PcapDotNet.Packets.IpV6
/// </summary>
public enum IpV6AuthenticationSubtype : byte
{
/// <summary>
/// Invalid value.
/// </summary>
None = 0,
/// <summary>
/// Used to authenticate the Binding Update and Binding Acknowledgement messages based on the shared-key-based security association
/// between the Mobile Node and the Home Agent.
......
......@@ -42,7 +42,7 @@ namespace PcapDotNet.Packets.IpV6
}
private IpV6MobilityOptionAccessTechnologyType()
: this(IpV6AccessTechnologyType.Reserved)
: this(IpV6AccessTechnologyType.None)
{
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment