Skip to content

Commit

Permalink
Chore: Set max ports #1884 & #1926 (#1927)
Browse files Browse the repository at this point in the history
* Chore: Set max ports #1884 & #1926

* Fix: Update default settings values

* Docs: Add #1927
  • Loading branch information
BornToBeRoot authored Feb 16, 2023
1 parent 1918a30 commit 41372a0
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static class GlobalStaticConfiguration

// Application: Port Scanner
public static int PortScanner_HostThreads => 5;
public static int PortScanner_PortThreds => 100;
public static int PortScanner_PortThreads => 100;
public static int PortScanner_Timeout => 4000;
public static ExportManager.ExportFileType PortScanner_ExportFileType => ExportManager.ExportFileType.CSV;

Expand Down
2 changes: 1 addition & 1 deletion Source/NETworkManager.Settings/SettingsInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ public int PortScanner_HostThreads
}
}

private int _portScanner_PortThreads = GlobalStaticConfiguration.PortScanner_PortThreds;
private int _portScanner_PortThreads = GlobalStaticConfiguration.PortScanner_PortThreads;
public int PortScanner_PortThreads
{
get => _portScanner_PortThreads;
Expand Down
27 changes: 23 additions & 4 deletions Source/NETworkManager.Settings/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static void Upgrade(Version fromVersion, Version toVersion)
{
_log.Info("Apply update to 2022.12.22.0");

// AWS Session Manager
// Add AWS Session Manager application
_log.Info("Add new App AWS Session Manager...");
Current.General_ApplicationList.Add(ApplicationManager.GetList().First(x => x.Name == ApplicationName.AWSSessionManager));

Expand All @@ -225,7 +225,7 @@ public static void Upgrade(Version fromVersion, Version toVersion)
_log.Info($"Set AWS Session Manager application file path to \"{powerShellPath}\"...");
Current.AWSSessionManager_ApplicationFilePath = powerShellPath;

// Bit Calculator
// Add Bit Calculator application
_log.Info("Add new App Bit Calculator...");
Current.General_ApplicationList.Add(ApplicationManager.GetList().First(x => x.Name == ApplicationName.BitCalculator));
}
Expand All @@ -235,10 +235,29 @@ public static void Upgrade(Version fromVersion, Version toVersion)
{
_log.Info($"Apply upgrade to {toVersion}...");

// NTP Lookup
// Add NTP Lookup application
_log.Info("Add new App SNTP Lookup...");
Current.General_ApplicationList.Add(ApplicationManager.GetList().First(x => x.Name == ApplicationName.SNTPLookup));
Current.SNTPLookup_SNTPServers = new ObservableCollection<ServerInfoProfile>(SNTPServer.GetDefaultList());
Current.SNTPLookup_SNTPServers = new ObservableCollection<ServerInfoProfile>(SNTPServer.GetDefaultList());

// Update default settings values
if(Current.IPScanner_Threads > 1024)
{
_log.Info("Change IP scanner threads to 1024");
Current.IPScanner_Threads = 1024;
}

if(Current.PortScanner_HostThreads > 256)
{
_log.Info("Change Port scanner host threads to 256");
Current.PortScanner_HostThreads = 256;
}

if (Current.PortScanner_PortThreads > 1024)
{
_log.Info("Change Port scanner port threads to 1024");
Current.PortScanner_PortThreads = 1024;
}
}

// Set to latest version and save
Expand Down
2 changes: 1 addition & 1 deletion Source/NETworkManager/Views/IPScannerSettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<mah:ToggleSwitch Header="{x:Static localization:Strings.ShowScanResultForAllIPAddresses}" IsOn="{Binding ShowScanResultForAllIPAddresses}" Margin="0,0,0,20"/>
<TextBlock Text="{x:Static localization:Strings.Multithreading}" Style="{StaticResource HeaderTextBlock}" />
<TextBlock Text="{x:Static localization:Strings.Threads}" Style="{StaticResource DefaultTextBlock}" Margin="0,0,0,10" />
<mah:NumericUpDown Value="{Binding Threads}" Maximum="15000" Minimum="1" Interval="1" Margin="0,0,0,20" />
<mah:NumericUpDown Value="{Binding Threads}" Maximum="1024" Minimum="1" Interval="1" Margin="0,0,0,20" />
<TextBlock Text="{x:Static localization:Strings.Ping}" Style="{StaticResource HeaderTextBlock}" />
<TextBlock Text="{x:Static localization:Strings.TimeoutMS}" Style="{StaticResource DefaultTextBlock}" Margin="0,0,0,10" />
<mah:NumericUpDown Value="{Binding ICMPTimeout}" Maximum="15000" Minimum="100" Interval="100" Margin="0,0,0,10" />
Expand Down
4 changes: 2 additions & 2 deletions Source/NETworkManager/Views/PortScannerSettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@
</StackPanel>
<TextBlock Text="{x:Static localization:Strings.Multithreading}" Style="{StaticResource HeaderTextBlock}" />
<TextBlock Text="{x:Static localization:Strings.HostThreads}" Style="{StaticResource DefaultTextBlock}" Margin="0,0,0,10" />
<mah:NumericUpDown Value="{Binding HostThreads}" Maximum="15000" Minimum="1" Interval="1" Margin="0,0,0,10" />
<mah:NumericUpDown Value="{Binding HostThreads}" Maximum="256" Minimum="1" Interval="1" Margin="0,0,0,10" />
<TextBlock Text="{x:Static localization:Strings.PortThreads}" Style="{StaticResource DefaultTextBlock}" Margin="0,0,0,10" />
<mah:NumericUpDown Value="{Binding PortThreads}" Maximum="15000" Minimum="1" Interval="1" Margin="0,0,0,20" />
<mah:NumericUpDown Value="{Binding PortThreads}" Maximum="1024" Minimum="1" Interval="1" Margin="0,0,0,20" />
<TextBlock Text="{x:Static localization:Strings.PortScanner}" Style="{StaticResource HeaderTextBlock}" />
<mah:ToggleSwitch Header="{x:Static localization:Strings.ShowClosedPorts}" IsOn="{Binding ShowClosed}" Margin="0,0,0,20"/>
<TextBlock Text="{x:Static localization:Strings.Socket}" Style="{StaticResource HeaderTextBlock}" />
Expand Down
5 changes: 5 additions & 0 deletions docs/Changelog/next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ New Feature
- Reduce the size of the installer, portable and archive build [#1832](https://github.com/BornToBeRoot/NETworkManager/pull/1832){:target="\_blank"}
- DataGrid Column header design improved [#1910](https://github.com/BornToBeRoot/NETworkManager/pull/1910){:target="\_blank"}
- DataGrid Columns can now be resized [#1910](https://github.com/BornToBeRoot/NETworkManager/pull/1910){:target="\_blank"}
- IP Scanner
- Max threads changed to to 1024 [#1927](https://github.com/BornToBeRoot/NETworkManager/pull/1927){:target="\_blank"}
- Port Scanner
- Max host threads changed to to 256 [#1927](https://github.com/BornToBeRoot/NETworkManager/pull/1927){:target="\_blank"}
- Max port threads changed to to 1024 [#1927](https://github.com/BornToBeRoot/NETworkManager/pull/1927){:target="\_blank"}
- Add documentation for: [#265](https://github.com/BornToBeRoot/NETworkManager/pull/265){:target="\_blank"}
- [Dashboard](https://borntoberoot.net/NETworkManager/Documentation/Application/Dashboard){:target="\_blank"}
- [Network Interface](https://borntoberoot.net/NETworkManager/Documentation/Application/NetworkInterface){:target="\_blank"
Expand Down
2 changes: 1 addition & 1 deletion docs/Documentation/01_Application/04_IPScanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Show the scan result for all IP addresses including the ones that are not active

Number of threads to use for scanning.

**Type:** `Integer` [Min `1`, Max `15000`]
**Type:** `Integer` [Min `1`, Max `1024`]

**Default:** `256`

Expand Down

0 comments on commit 41372a0

Please sign in to comment.