4 instantiations of IPNetwork
Microsoft.AspNetCore.HttpOverrides (1)
ForwardedHeadersOptions.cs (1)
95
public IList<IPNetwork> KnownIPNetworks { get; } = new List<IPNetwork>() {
new
(IPAddress.Loopback, 8) };
Microsoft.AspNetCore.HttpOverrides.Tests (1)
ForwardedHeadersMiddlewareTest.cs (1)
1101
options.KnownIPNetworks.Add(new System.Net.
IPNetwork
(networkIp, prefixLength));
System.Net.Primitives (2)
System\Net\IPNetwork.cs (2)
192
result = new
IPNetwork
(address, prefixLength);
220
result = new
IPNetwork
(address, prefixLength);
60 references to IPNetwork
Microsoft.AspNetCore.HttpOverrides (5)
ForwardedHeadersMiddleware.cs (1)
406
foreach (
var
network in _options.KnownIPNetworks)
ForwardedHeadersOptions.cs (3)
7
using IPNetwork = System.Net.
IPNetwork
;
95
public IList<
IPNetwork
> KnownIPNetworks { get; } = new List<
IPNetwork
>() { new(IPAddress.Loopback, 8) };
IPNetwork.cs (1)
12
/// Please use <see cref="System.Net.
IPNetwork
"/> instead
System.Net.Primitives (55)
System\Net\IPNetwork.cs (55)
22
public readonly struct IPNetwork : IEquatable<
IPNetwork
>, ISpanFormattable, ISpanParsable<
IPNetwork
>, IUtf8SpanFormattable, IUtf8SpanParsable<
IPNetwork
>
37
/// Initializes a new instance of the <see cref="
IPNetwork
"/> class with the specified <see cref="IPAddress"/> and prefix length.
112
/// Converts a CIDR <see cref="string"/> to an <see cref="
IPNetwork
"/> instance.
115
/// <returns>An <see cref="
IPNetwork
"/> instance.</returns>
118
public static
IPNetwork
Parse(string s)
125
/// Converts a CIDR character span to an <see cref="
IPNetwork
"/> instance.
128
/// <returns>An <see cref="
IPNetwork
"/> instance.</returns>
130
public static
IPNetwork
Parse(ReadOnlySpan<char> s)
132
if (!TryParse(s, out
IPNetwork
result))
141
/// Converts a UTF-8 CIDR character span to an <see cref="
IPNetwork
"/> instance.
144
/// <returns>An <see cref="
IPNetwork
"/> instance.</returns>
146
public static
IPNetwork
Parse(ReadOnlySpan<byte> utf8Text)
148
if (!TryParse(utf8Text, out
IPNetwork
result))
157
/// Converts the specified CIDR string to an <see cref="
IPNetwork
"/> instance and returns a value indicating whether the conversion succeeded.
160
/// <param name="result">When the method returns, contains an <see cref="
IPNetwork
"/> instance if the conversion succeeds.</param>
162
public static bool TryParse(string? s, out
IPNetwork
result)
174
/// Converts the specified CIDR character span to an <see cref="
IPNetwork
"/> instance and returns a value indicating whether the conversion succeeded.
177
/// <param name="result">When the method returns, contains an <see cref="
IPNetwork
"/> instance if the conversion succeeds.</param>
179
public static bool TryParse(ReadOnlySpan<char> s, out
IPNetwork
result)
202
/// Converts the specified UTF-8 CIDR character span to an <see cref="
IPNetwork
"/> instance and returns a value indicating whether the conversion succeeded.
205
/// <param name="result">When the method returns, contains an <see cref="
IPNetwork
"/> instance if the conversion succeeds.</param>
207
public static bool TryParse(ReadOnlySpan<byte> utf8Text, out
IPNetwork
result)
280
/// Converts the instance to a string containing the <see cref="
IPNetwork
"/>'s CIDR notation.
282
/// <returns>The <see cref="string"/> containing the <see cref="
IPNetwork
"/>'s CIDR notation.</returns>
287
/// Attempts to write the <see cref="
IPNetwork
"/>'s CIDR notation to the given <paramref name="destination"/> span and returns a value indicating whether the operation succeeded.
296
/// Attempts to write the <see cref="
IPNetwork
"/>'s CIDR notation to the given <paramref name="utf8Destination"/> UTF-8 span and returns a value indicating whether the operation succeeded.
305
/// Determines whether two <see cref="
IPNetwork
"/> instances are equal.
307
/// <param name="other">The <see cref="
IPNetwork
"/> instance to compare to this instance.</param>
309
/// <exception cref="InvalidOperationException">Uninitialized <see cref="
IPNetwork
"/> instance.</exception>
310
public bool Equals(
IPNetwork
other) =>
315
/// Determines whether two <see cref="
IPNetwork
"/> instances are equal.
317
/// <param name="obj">The <see cref="
IPNetwork
"/> instance to compare to this instance.</param>
318
/// <returns><see langword="true"/> if <paramref name="obj"/> is an <see cref="
IPNetwork
"/> instance and the networks are equal; otherwise <see langword="false"/>.</returns>
319
/// <exception cref="InvalidOperationException">Uninitialized <see cref="
IPNetwork
"/> instance.</exception>
321
obj is
IPNetwork
other &&
325
/// Determines whether the specified instances of <see cref="
IPNetwork
"/> are equal.
330
public static bool operator ==(
IPNetwork
left,
IPNetwork
right) => left.Equals(right);
333
/// Determines whether the specified instances of <see cref="
IPNetwork
"/> are not equal.
338
public static bool operator !=(
IPNetwork
left,
IPNetwork
right) => !(left == right);
360
static
IPNetwork
IParsable<
IPNetwork
>.Parse([NotNull] string s, IFormatProvider? provider) => Parse(s);
363
static bool IParsable<
IPNetwork
>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, out
IPNetwork
result) => TryParse(s, out result);
366
static
IPNetwork
ISpanParsable<
IPNetwork
>.Parse(ReadOnlySpan<char> s, IFormatProvider? provider) => Parse(s);
369
static
IPNetwork
IUtf8SpanParsable<
IPNetwork
>.Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider) => Parse(utf8Text);
372
static bool ISpanParsable<
IPNetwork
>.TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out
IPNetwork
result) => TryParse(s, out result);
375
static bool IUtf8SpanParsable<
IPNetwork
>.TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out
IPNetwork
result) => TryParse(utf8Text, out result);