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
ipVersionIpVersionThe IP version.
Returns
Exceptions
- NotSupportedException
ipVersionis neither IPv4 nor IPv6.
IpVersion(IPAddress)
Gets the IP version of an address.
public static IpVersion IpVersion(this IPAddress ipAddress)
Parameters
ipAddressIPAddressThe address.
Returns
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
ipEndPointIPEndPointThe endpoint.
Returns
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
addressFamilyAddressFamilyThe address family.
Returns
Exceptions
- NotSupportedException
addressFamilyis neither InterNetwork nor InterNetworkV6.