forked from netchx/netch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
133 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Netch/Controllers/IController.cs → Netch/Interfaces/IController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace Netch.Controllers | ||
namespace Netch.Interfaces | ||
{ | ||
public interface IController | ||
{ | ||
|
2 changes: 1 addition & 1 deletion
2
Netch/Controllers/IModeController.cs → Netch/Interfaces/IModeController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Netch/Controllers/IServerController.cs → Netch/Interfaces/IServerController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
Netch/Models/IServerUtil.cs → Netch/Interfaces/IServerUtil.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Net.Sockets; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Netch.Interops | ||
{ | ||
public static class RouteHelper | ||
{ | ||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern ulong ConvertLuidToIndex(ulong id); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool CreateIPv4(string address, string netmask, ulong index); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool CreateUnicastIP(AddressFamily inet, string address, byte cidr, ulong index); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool RefreshIPTable(AddressFamily inet, ulong index); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool CreateRoute(AddressFamily inet, string address, byte cidr, string gateway, ulong index, int metric); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool DeleteRoute(AddressFamily inet, string address, byte cidr, string gateway, ulong index, int metric); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
Netch/Models/TunAdapter.cs → Netch/Models/Adapter/TunAdapter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,10 @@ | ||
using System.Net.Sockets; | ||
using System.Runtime.InteropServices; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Netch | ||
{ | ||
public static class NativeMethods | ||
{ | ||
[DllImport("dnsapi", EntryPoint = "DnsFlushResolverCache")] | ||
public static extern uint RefreshDNSCache(); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern ulong ConvertLuidToIndex(ulong id); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool CreateIPv4(string address, string netmask, ulong index); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool CreateUnicastIP(AddressFamily inet, string address, byte cidr, ulong index); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool RefreshIPTable(AddressFamily inet, ulong index); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool CreateRoute(AddressFamily inet, string address, byte cidr, string gateway, ulong index, int metric); | ||
|
||
[DllImport("RouteHelper.bin", CallingConvention = CallingConvention.Cdecl)] | ||
public static extern bool DeleteRoute(AddressFamily inet, string address, byte cidr, string gateway, ulong index, int metric); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.