Table of Contents

Class NetExtensions

Namespace
VpnHood.Net.Packets.Extensions
Assembly
VpnHood.Net.Packets.dll

Provides conversions between .NET's address families and IpVersion.

public static class NetExtensions
Inheritance
NetExtensions
Inherited Members

Methods

AddressFamily(IpVersion)

Gets the address family of an IP version.

public static AddressFamily AddressFamily(this IpVersion ipVersion)

Parameters

ipVersion IpVersion

The IP version.

Returns

AddressFamily

InterNetwork or InterNetworkV6.

Exceptions

NotSupportedException

ipVersion is neither IPv4 nor IPv6.

IpVersion(IPAddress)

Gets the IP version of an address.

public static IpVersion IpVersion(this IPAddress ipAddress)

Parameters

ipAddress IPAddress

The address.

Returns

IpVersion

IPv4 or IPv6.

Exceptions

NotSupportedException

The address is neither IPv4 nor IPv6.

IpVersion(IPEndPoint)

Gets the IP version of an endpoint's address.

public static IpVersion IpVersion(this IPEndPoint ipEndPoint)

Parameters

ipEndPoint IPEndPoint

The endpoint.

Returns

IpVersion

IPv4 or IPv6.

Exceptions

NotSupportedException

The address is neither IPv4 nor IPv6.

IpVersion(AddressFamily)

Gets the IP version of an address family.

public static IpVersion IpVersion(this AddressFamily addressFamily)

Parameters

addressFamily AddressFamily

The address family.

Returns

IpVersion

IPv4 or IPv6.

Exceptions

NotSupportedException

addressFamily is neither InterNetwork nor InterNetworkV6.