using System.Runtime.InteropServices;
namespace Netch
{
public static class NativeMethods
{
///
/// 创建路由规则
///
/// 目标地址
/// 掩码地址
/// 网关地址
/// 适配器索引
/// 跃点数
/// 是否成功
[DllImport("bin\\NetchCore.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "CreateRoute")]
public static extern bool CreateRoute(string address, int netmask, string gateway, int index, int metric = 0);
///
/// 修改路由规则
///
/// 目标地址
/// 掩码地址
/// 网关地址
/// 适配器索引
/// 跃点数
/// 是否成功
[DllImport("bin\\NetchCore.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "ChangeRoute")]
public static extern bool ChangeRoute(string address, int netmask, string gateway, int index, int metric = 0);
///
/// 删除路由规则
///
/// 目标地址
/// 掩码地址
/// 网关地址
/// 适配器索引
/// 跃点数
/// 是否成功
[DllImport("bin\\NetchCore.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "DeleteRoute")]
public static extern bool DeleteRoute(string address, int netmask, string gateway, int index, int metric = 0);
}
}