mirror of
https://github.com/2dust/v2rayN.git
synced 2026-08-01 21:02:05 +03:00
Rename TunIp to TunIP
This commit is contained in:
@@ -745,7 +745,7 @@ public class Global
|
||||
MozillaRootProvider,
|
||||
];
|
||||
|
||||
public static readonly IReadOnlyList<string> TunIpv4Address =
|
||||
public static readonly IReadOnlyList<string> TunIPv4Address =
|
||||
[
|
||||
"172.18.0.1/30",
|
||||
"172.31.0.1/30",
|
||||
@@ -759,7 +759,7 @@ public class Global
|
||||
|
||||
// Prefixes must leave room for a peer address (max /126); the sing-box system
|
||||
// stack derives a gateway from the first prefix and rejects single-address prefixes.
|
||||
public static readonly IReadOnlyList<string> TunIpv6Address =
|
||||
public static readonly IReadOnlyList<string> TunIPv6Address =
|
||||
[
|
||||
"fc00::172:18:0:1/126",
|
||||
"fc00::172:31:0:1/126",
|
||||
|
||||
@@ -149,8 +149,8 @@ public class TunModeItem
|
||||
public string IcmpRouting { get; set; }
|
||||
public bool EnableLegacyProtect { get; set; } = true;
|
||||
public List<string>? RouteExcludeAddress { get; set; }
|
||||
public string Ipv4Address { get; set; }
|
||||
public string Ipv6Address { get; set; }
|
||||
public string IPv4Address { get; set; }
|
||||
public string IPv6Address { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
@@ -68,11 +68,11 @@ public partial class CoreConfigSingboxService
|
||||
tunInbound.strict_route = _config.TunModeItem.StrictRoute;
|
||||
tunInbound.stack = _config.TunModeItem.Stack;
|
||||
|
||||
var address = _config.TunModeItem.Ipv4Address.NullIfEmpty() ?? Global.TunIpv4Address.First();
|
||||
var address = _config.TunModeItem.IPv4Address.NullIfEmpty() ?? Global.TunIPv4Address.First();
|
||||
tunInbound.address = [address];
|
||||
if (_config.TunModeItem.EnableIPv6Address == true)
|
||||
{
|
||||
var address6 = _config.TunModeItem.Ipv6Address.NullIfEmpty() ?? Global.TunIpv6Address.First();
|
||||
var address6 = _config.TunModeItem.IPv6Address.NullIfEmpty() ?? Global.TunIPv6Address.First();
|
||||
tunInbound.address.Add(address6);
|
||||
}
|
||||
tunInbound.route_exclude_address = _config.TunModeItem.RouteExcludeAddress;
|
||||
|
||||
@@ -64,11 +64,11 @@ public partial class CoreConfigV2rayService
|
||||
tunInbound.settings.name = context.IsMacOS ? $"utun{new Random().Next(99)}" : "xray_tun";
|
||||
tunInbound.settings.MTU = _config.TunModeItem.Mtu;
|
||||
|
||||
var address = _config.TunModeItem.Ipv4Address.NullIfEmpty() ?? Global.TunIpv4Address.First();
|
||||
var address = _config.TunModeItem.IPv4Address.NullIfEmpty() ?? Global.TunIPv4Address.First();
|
||||
tunInbound.settings.gateway = [address];
|
||||
if (_config.TunModeItem.EnableIPv6Address == true)
|
||||
{
|
||||
var address6 = _config.TunModeItem.Ipv6Address.NullIfEmpty() ?? Global.TunIpv6Address.First();
|
||||
var address6 = _config.TunModeItem.IPv6Address.NullIfEmpty() ?? Global.TunIPv6Address.First();
|
||||
tunInbound.settings.gateway.Add(address6);
|
||||
}
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable
|
||||
[Reactive] public string TunIcmpRouting { get; set; }
|
||||
[Reactive] public bool TunEnableLegacyProtect { get; set; }
|
||||
[Reactive] public string TunRouteExcludeAddress { get; set; }
|
||||
[Reactive] public string TunIpv4Address { get; set; }
|
||||
[Reactive] public string TunIpv6Address { get; set; }
|
||||
[Reactive] public string TunIPv4Address { get; set; }
|
||||
[Reactive] public string TunIPv6Address { get; set; }
|
||||
|
||||
#endregion Tun mode
|
||||
|
||||
@@ -216,8 +216,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable
|
||||
TunIcmpRouting = _config.TunModeItem.IcmpRouting;
|
||||
TunEnableLegacyProtect = _config.TunModeItem.EnableLegacyProtect;
|
||||
TunRouteExcludeAddress = Utils.List2String(_config.TunModeItem.RouteExcludeAddress, true);
|
||||
TunIpv4Address = _config.TunModeItem.Ipv4Address;
|
||||
TunIpv6Address = _config.TunModeItem.Ipv6Address;
|
||||
TunIPv4Address = _config.TunModeItem.IPv4Address;
|
||||
TunIPv6Address = _config.TunModeItem.IPv6Address;
|
||||
|
||||
#endregion Tun mode
|
||||
|
||||
@@ -382,8 +382,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable
|
||||
_config.TunModeItem.IcmpRouting = TunIcmpRouting;
|
||||
_config.TunModeItem.EnableLegacyProtect = TunEnableLegacyProtect;
|
||||
_config.TunModeItem.RouteExcludeAddress = Utils.String2List(TunRouteExcludeAddress);
|
||||
_config.TunModeItem.Ipv4Address = TunIpv4Address;
|
||||
_config.TunModeItem.Ipv6Address = TunIpv6Address;
|
||||
_config.TunModeItem.IPv4Address = TunIPv4Address;
|
||||
_config.TunModeItem.IPv6Address = TunIPv6Address;
|
||||
|
||||
//coreType
|
||||
await SaveCoreType();
|
||||
|
||||
@@ -33,8 +33,8 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
||||
cmbMtu.ItemsSource = Global.TunMtus;
|
||||
cmbStack.ItemsSource = Global.TunStacks;
|
||||
cmbIcmpRoutingPolicy.ItemsSource = Global.TunIcmpRoutingPolicies;
|
||||
cmbIpv4Address.ItemsSource = Global.TunIpv4Address;
|
||||
cmbIpv6Address.ItemsSource = Global.TunIpv6Address;
|
||||
cmbIpv4Address.ItemsSource = Global.TunIPv4Address;
|
||||
cmbIpv6Address.ItemsSource = Global.TunIPv6Address;
|
||||
cmbFragmentPackets.ItemsSource = Global.FragmentPacketsOptions;
|
||||
|
||||
cmbCoreType1.ItemsSource = Global.CoreTypes;
|
||||
@@ -131,8 +131,8 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
||||
this.Bind(ViewModel, vm => vm.TunIcmpRouting, v => v.cmbIcmpRoutingPolicy.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunEnableLegacyProtect, v => v.togEnableLegacyProtect.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunRouteExcludeAddress, v => v.txtRouteExcludeAddress.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIpv4Address, v => v.cmbIpv4Address.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIpv6Address, v => v.cmbIpv6Address.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIPv4Address, v => v.cmbIpv4Address.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIPv6Address, v => v.cmbIpv6Address.SelectedValue).DisposeWith(disposables);
|
||||
|
||||
this.Bind(ViewModel, vm => vm.CoreType1, v => v.cmbCoreType1.SelectedValue).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.CoreType2, v => v.cmbCoreType2.SelectedValue).DisposeWith(disposables);
|
||||
|
||||
@@ -29,8 +29,8 @@ public partial class OptionSettingWindow
|
||||
cmbMtu.ItemsSource = Global.TunMtus;
|
||||
cmbStack.ItemsSource = Global.TunStacks;
|
||||
cmbIcmpRoutingPolicy.ItemsSource = Global.TunIcmpRoutingPolicies;
|
||||
cmbIpv4Address.ItemsSource = Global.TunIpv4Address;
|
||||
cmbIpv6Address.ItemsSource = Global.TunIpv6Address;
|
||||
cmbIpv4Address.ItemsSource = Global.TunIPv4Address;
|
||||
cmbIpv6Address.ItemsSource = Global.TunIPv6Address;
|
||||
cmbFragmentPackets.ItemsSource = Global.FragmentPacketsOptions;
|
||||
|
||||
cmbCoreType1.ItemsSource = Global.CoreTypes;
|
||||
@@ -126,8 +126,8 @@ public partial class OptionSettingWindow
|
||||
this.Bind(ViewModel, vm => vm.TunIcmpRouting, v => v.cmbIcmpRoutingPolicy.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunEnableLegacyProtect, v => v.togEnableLegacyProtect.IsChecked).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunRouteExcludeAddress, v => v.txtRouteExcludeAddress.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIpv4Address, v => v.cmbIpv4Address.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIpv6Address, v => v.cmbIpv6Address.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIPv4Address, v => v.cmbIpv4Address.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.TunIPv6Address, v => v.cmbIpv6Address.Text).DisposeWith(disposables);
|
||||
|
||||
this.Bind(ViewModel, vm => vm.CoreType1, v => v.cmbCoreType1.Text).DisposeWith(disposables);
|
||||
this.Bind(ViewModel, vm => vm.CoreType2, v => v.cmbCoreType2.Text).DisposeWith(disposables);
|
||||
|
||||
Reference in New Issue
Block a user