Share via


VpnService.Builder.AddRoute Method

Definition

Overloads

AddRoute(IpPrefix)
AddRoute(InetAddress, Int32)

Add a network route to the VPN interface.

AddRoute(String, Int32)

Convenience method to add a network route to the VPN interface using a numeric address string.

AddRoute(IpPrefix)

[Android.Runtime.Register("addRoute", "(Landroid/net/IpPrefix;)Landroid/net/VpnService$Builder;", "GetAddRoute_Landroid_net_IpPrefix_Handler", ApiSince=33)]
public virtual Android.Net.VpnService.Builder AddRoute (Android.Net.IpPrefix prefix);
[<Android.Runtime.Register("addRoute", "(Landroid/net/IpPrefix;)Landroid/net/VpnService$Builder;", "GetAddRoute_Landroid_net_IpPrefix_Handler", ApiSince=33)>]
abstract member AddRoute : Android.Net.IpPrefix -> Android.Net.VpnService.Builder
override this.AddRoute : Android.Net.IpPrefix -> Android.Net.VpnService.Builder

Parameters

prefix
IpPrefix

Returns

Attributes

Applies to

AddRoute(InetAddress, Int32)

Add a network route to the VPN interface.

[Android.Runtime.Register("addRoute", "(Ljava/net/InetAddress;I)Landroid/net/VpnService$Builder;", "GetAddRoute_Ljava_net_InetAddress_IHandler")]
public virtual Android.Net.VpnService.Builder AddRoute (Java.Net.InetAddress address, int prefixLength);
[<Android.Runtime.Register("addRoute", "(Ljava/net/InetAddress;I)Landroid/net/VpnService$Builder;", "GetAddRoute_Ljava_net_InetAddress_IHandler")>]
abstract member AddRoute : Java.Net.InetAddress * int -> Android.Net.VpnService.Builder
override this.AddRoute : Java.Net.InetAddress * int -> Android.Net.VpnService.Builder

Parameters

address
InetAddress
prefixLength
Int32

Returns

Attributes

Exceptions

if the route is invalid.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

AddRoute(String, Int32)

Convenience method to add a network route to the VPN interface using a numeric address string.

[Android.Runtime.Register("addRoute", "(Ljava/lang/String;I)Landroid/net/VpnService$Builder;", "GetAddRoute_Ljava_lang_String_IHandler")]
public virtual Android.Net.VpnService.Builder AddRoute (string address, int prefixLength);
[<Android.Runtime.Register("addRoute", "(Ljava/lang/String;I)Landroid/net/VpnService$Builder;", "GetAddRoute_Ljava_lang_String_IHandler")>]
abstract member AddRoute : string * int -> Android.Net.VpnService.Builder
override this.AddRoute : string * int -> Android.Net.VpnService.Builder

Parameters

address
String
prefixLength
Int32

Returns

Attributes

Exceptions

if the route is invalid.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

  • <xref:Android.Net.VpnService.Builder.AddRoute(Java.Net.InetAddress%2c+System.Int32)>

Applies to