Skip to content

Commit 0e868ba

Browse files
authored
version 2.1.4 (#80)
* turning up version number * added integration tests for firewall api and updated gitignire * added ipV6 support * added ipv6_task (thank you ozaroth) * released binary
1 parent 21229b5 commit 0e868ba

14 files changed

Lines changed: 442 additions & 238 deletions

File tree

.gitignore

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@
44

55
/.vs
66
*.suo
7-
/Source/EvlWatcher/.vs
8-
/Source/EvlWatcher/EvlWatcher/obj/x86
9-
/Source/EvlWatcherConsole/EvlWatcherConsole/obj/x86
10-
/Source/EvlWatcher/EvlWatcher/bin/Debug
117
*.user
12-
/Source/EvlWatcherConsole/EvlWatcherConsole/bin/Debug
13-
/Source/EvlWatcher/EvlWatcher/bin/Release
14-
/Source/EvlWatcher/EvlWatcher.WCF/bin/Debug
15-
/Source/EvlWatcher/EvlWatcher.WCF/obj
16-
/Source/EvlWatcherConsole/EvlWatcherConsole/bin/Release
17-
/Source/EvlWatcher/EvlWatcher.WCF/bin/Release
8+
9+
/Source/EvlWatcher/.vs
1810
/Source/EvlWatcherConsole/.vs
11+
12+
/Source/EvlWatcher/EvlWatcher/obj/
13+
/Source/EvlWatcher/EvlWatcher/bin/
14+
15+
/Source/EvlWatcher/EvlWatcher.Tests.Integration/bin/
16+
/Source/EvlWatcher/EvlWatcher.Tests.Integration/obj/
17+
18+
/Source/EvlWatcherConsole/EvlWatcherConsole/bin/
19+
/Source/EvlWatcherConsole/EvlWatcherConsole/obj/
20+
21+
/Source/EvlWatcher/EvlWatcher.WCF/bin/
22+
/Source/EvlWatcher/EvlWatcher.WCF/obj
23+
24+
25+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
7+
<IsPackable>false</IsPackable>
8+
9+
<PlatformTarget>x86</PlatformTarget>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
14+
<PackageReference Include="MSTest.TestAdapter" Version="2.2.7" />
15+
<PackageReference Include="MSTest.TestFramework" Version="2.2.7" />
16+
<PackageReference Include="coverlet.collector" Version="3.1.0" />
17+
</ItemGroup>
18+
19+
<ItemGroup>
20+
<ProjectReference Include="..\EvlWatcher\EvlWatcher.csproj" />
21+
</ItemGroup>
22+
23+
</Project>
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
using EvlWatcher.SystemAPI;
2+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
4+
namespace EvlWatcher.Tests.Integration
5+
{
6+
[TestClass]
7+
public class FirewallApiTests
8+
{
9+
[TestMethod]
10+
public void GetBannedIPs()
11+
{
12+
//given we have a firewall API
13+
var api = new FirewallAPI();
14+
15+
//when we get the bannes IPs, we want a result
16+
var ips = api.GetBannedIPs();
17+
18+
Assert.IsNotNull(ips);
19+
}
20+
21+
[TestMethod]
22+
public void AddV4IP()
23+
{
24+
//given we have a firewall API, and an empty rule
25+
var api = new FirewallAPI();
26+
var list = new System.Collections.Generic.List<System.Net.IPAddress>();
27+
api.AdjustIPBanList(list);
28+
var ips = api.GetBannedIPs();
29+
Assert.IsNotNull(ips);
30+
Assert.IsTrue(ips.Count == 0);
31+
32+
//when we add a some ipv4 addresses
33+
list.Add(System.Net.IPAddress.Parse("192.192.182.15"));
34+
list.Add(System.Net.IPAddress.Parse("192.192.182.16"));
35+
list.Add(System.Net.IPAddress.Parse("192.192.182.21"));
36+
api.AdjustIPBanList(list);
37+
38+
//then we want that address to be in there
39+
ips = api.GetBannedIPs();
40+
Assert.IsTrue(ips.Contains("192.192.182.15/255.255.255.255"));
41+
Assert.IsTrue(ips.Contains("192.192.182.16/255.255.255.255"));
42+
Assert.IsTrue(ips.Contains("192.192.182.21/255.255.255.255"));
43+
44+
45+
}
46+
47+
[TestMethod]
48+
public void AddV6IP()
49+
{
50+
//given we have a firewall API, and an empty rule
51+
var api = new FirewallAPI();
52+
var list = new System.Collections.Generic.List<System.Net.IPAddress>();
53+
api.AdjustIPBanList(list);
54+
var ips = api.GetBannedIPs();
55+
Assert.IsNotNull(ips);
56+
Assert.IsTrue(ips.Count == 0);
57+
58+
//when we add a some ipv6 addresses
59+
list.Add(System.Net.IPAddress.Parse("48a2:ca86:e35:977c:d2dc:1276:1754:f5e6"));
60+
list.Add(System.Net.IPAddress.Parse("2b9c:5213:2df6:9866:5073:45c4:291:d82f"));
61+
list.Add(System.Net.IPAddress.Parse("692d:22df:cd31:d65b:ba37:ba83:fc5b:3d40"));
62+
api.AdjustIPBanList(list);
63+
64+
//then we want that address to be in there
65+
ips = api.GetBannedIPs();
66+
Assert.IsTrue(ips.Contains("48a2:ca86:e35:977c:d2dc:1276:1754:f5e6"));
67+
Assert.IsTrue(ips.Contains("2b9c:5213:2df6:9866:5073:45c4:291:d82f"));
68+
Assert.IsTrue(ips.Contains("692d:22df:cd31:d65b:ba37:ba83:fc5b:3d40"));
69+
70+
71+
}
72+
73+
[TestMethod]
74+
public void AddCombinedV4V6()
75+
{
76+
//given we have a firewall API, and an empty rule
77+
var api = new FirewallAPI();
78+
var list = new System.Collections.Generic.List<System.Net.IPAddress>();
79+
api.AdjustIPBanList(list);
80+
var ips = api.GetBannedIPs();
81+
Assert.IsNotNull(ips);
82+
Assert.IsTrue(ips.Count == 0);
83+
84+
//when we add a some ipv6 addresses
85+
list.Add(System.Net.IPAddress.Parse("48a2:ca86:e35:977c:d2dc:1276:1754:f5e6"));
86+
list.Add(System.Net.IPAddress.Parse("192.192.182.15"));
87+
list.Add(System.Net.IPAddress.Parse("192.192.182.16"));
88+
list.Add(System.Net.IPAddress.Parse("2b9c:5213:2df6:9866:5073:45c4:291:d82f"));
89+
list.Add(System.Net.IPAddress.Parse("192.192.182.21"));
90+
list.Add(System.Net.IPAddress.Parse("692d:22df:cd31:d65b:ba37:ba83:fc5b:3d40"));
91+
92+
api.AdjustIPBanList(list);
93+
94+
//then we want that address to be in there
95+
ips = api.GetBannedIPs();
96+
Assert.IsTrue(ips.Contains("48a2:ca86:e35:977c:d2dc:1276:1754:f5e6"));
97+
Assert.IsTrue(ips.Contains("2b9c:5213:2df6:9866:5073:45c4:291:d82f"));
98+
Assert.IsTrue(ips.Contains("692d:22df:cd31:d65b:ba37:ba83:fc5b:3d40"));
99+
Assert.IsTrue(ips.Contains("192.192.182.15/255.255.255.255"));
100+
Assert.IsTrue(ips.Contains("192.192.182.16/255.255.255.255"));
101+
Assert.IsTrue(ips.Contains("192.192.182.21/255.255.255.255"));
102+
103+
104+
}
105+
106+
}
107+
}

Source/EvlWatcher/EvlWatcher.WCF/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("")]
1212
[assembly: AssemblyProduct("EvlWatcher.WCF")]
13-
[assembly: AssemblyCopyright("Copyright © 2020")]
13+
[assembly: AssemblyCopyright("Copyright © 2021 Michael Schönbauer")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.1.3.0")]
36-
[assembly: AssemblyFileVersion("2.1.3.0")]
35+
[assembly: AssemblyVersion("2.1.4.0")]
36+
[assembly: AssemblyFileVersion("2.1.4.0")]

Source/EvlWatcher/EvlWatcher.sln

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30621.155
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.32112.339
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvlWatcher", "EvlWatcher\EvlWatcher.csproj", "{90F8BC2A-B0FC-4960-8290-3FFADBDE85AC}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvlWatcher.WCF", "EvlWatcher.WCF\EvlWatcher.WCF.csproj", "{AB65EA0D-F9E8-4AEE-B1BC-1691A2BF9E13}"
99
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EvlWatcher.Tests.Integration", "EvlWatcher.Tests.Integration\EvlWatcher.Tests.Integration.csproj", "{40304822-224A-4926-B0C6-64D7324EA77C}"
11+
EndProject
1012
Global
1113
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1214
Debug|Any CPU = Debug|Any CPU
@@ -40,6 +42,18 @@ Global
4042
{AB65EA0D-F9E8-4AEE-B1BC-1691A2BF9E13}.Release|Mixed Platforms.Build.0 = Release|Any CPU
4143
{AB65EA0D-F9E8-4AEE-B1BC-1691A2BF9E13}.Release|x86.ActiveCfg = Release|Any CPU
4244
{AB65EA0D-F9E8-4AEE-B1BC-1691A2BF9E13}.Release|x86.Build.0 = Release|Any CPU
45+
{40304822-224A-4926-B0C6-64D7324EA77C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46+
{40304822-224A-4926-B0C6-64D7324EA77C}.Debug|Any CPU.Build.0 = Debug|Any CPU
47+
{40304822-224A-4926-B0C6-64D7324EA77C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
48+
{40304822-224A-4926-B0C6-64D7324EA77C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
49+
{40304822-224A-4926-B0C6-64D7324EA77C}.Debug|x86.ActiveCfg = Debug|Any CPU
50+
{40304822-224A-4926-B0C6-64D7324EA77C}.Debug|x86.Build.0 = Debug|Any CPU
51+
{40304822-224A-4926-B0C6-64D7324EA77C}.Release|Any CPU.ActiveCfg = Release|Any CPU
52+
{40304822-224A-4926-B0C6-64D7324EA77C}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{40304822-224A-4926-B0C6-64D7324EA77C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
54+
{40304822-224A-4926-B0C6-64D7324EA77C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
55+
{40304822-224A-4926-B0C6-64D7324EA77C}.Release|x86.ActiveCfg = Release|Any CPU
56+
{40304822-224A-4926-B0C6-64D7324EA77C}.Release|x86.Build.0 = Release|Any CPU
4357
EndGlobalSection
4458
GlobalSection(SolutionProperties) = preSolution
4559
HideSolutionNode = FALSE

Source/EvlWatcher/EvlWatcher/EvlWatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ private void SetPermanentBanInternal(IPAddress[] addressList)
583583

584584
#region public static operations
585585

586-
public static void Main(string[] args)
586+
public static void Main()
587587
{
588588
//build dependencies
589589
ILogger logger = new DefaultLogger();

Source/EvlWatcher/EvlWatcher/NSIS/make.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Name "EvlWatcher"
22

33
; The file to write
44
Icon EvlWatcher.ico
5-
OutFile "EvlWatcher-v2.1.3-setup.exe"
5+
OutFile "EvlWatcher-v2.1.4-setup.exe"
66

77
; The default installation directory
88
InstallDir $PROGRAMFILES\EvlWatcher

Source/EvlWatcher/EvlWatcher/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[assembly: AssemblyConfiguration("")]
1010
[assembly: AssemblyCompany("Michael Schönbauer")]
1111
[assembly: AssemblyProduct("EvlWatcher")]
12-
[assembly: AssemblyCopyright("2020 Michael Schönbauer")]
12+
[assembly: AssemblyCopyright("2021 Michael Schönbauer")]
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

@@ -28,5 +28,5 @@
2828
// Build Number
2929
// Revision
3030
//
31-
[assembly: AssemblyVersion("2.1.3.0")]
32-
[assembly: AssemblyFileVersion("2.1.3.0")]
31+
[assembly: AssemblyVersion("2.1.4.0")]
32+
[assembly: AssemblyFileVersion("2.1.4.0")]

0 commit comments

Comments
 (0)