From 2fafeff5f5ff9735b650ccd1ea306f58485f64c4 Mon Sep 17 00:00:00 2001 From: xljiulang <366193849@qq.com> Date: Mon, 17 Oct 2022 19:42:05 +0800 Subject: [PATCH] update readme --- README.md | 73 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 56b3dd7..e8f8ccc 100644 --- a/README.md +++ b/README.md @@ -15,45 +15,48 @@ ### 3 Api表 #### 3.1 WinDivert -| Api | 描述 | -| ------------------------------------------------------------------------------ | ------------------ | -| int Recv(WinDivertPacket, WinDivertAddress) | 同步阻塞读取数据包 | -| int Recv(WinDivertPacket, WinDivertAddress, CancellationToken) | 同步阻塞读取数据包 | -| `ValueTask` RecvAsync(WinDivertPacket, WinDivertAddress) | 异步IO读取数据包 | -| `ValueTask` RecvAsync(WinDivertPacket, WinDivertAddress, CancellationToken) | 异步IO读取数据包 | -| int Send(WinDivertPacket, WinDivertAddress) | 同步阻塞发送数据包 | -| int Send(WinDivertPacket, WinDivertAddress, CancellationToken) | 同步阻塞发送数据包 | -| `ValueTask` SendAsync(WinDivertPacket, WinDivertAddress) | 异步IO发送数据包 | -| `ValueTask` SendAsync(WinDivertPacket, WinDivertAddress, CancellationToken) | 异步IO发送数据包 | +| Api | 描述 | 原Api | +| -------------------------------------------------------------------------------- | ------------------ | ----------------- | +| WinDivert(Filter, WinDivertLayer, short , WinDivertFlag) | 构造器 | WinDivertOpen | +| int Recv(WinDivertPacket, WinDivertAddress) | 同步阻塞读取数据包 | RecvEx | +| int Recv(WinDivertPacket, WinDivertAddress, CancellationToken) | 同步阻塞读取数据包 | RecvEx | +| `ValueTask` RecvAsync(WinDivertPacket, WinDivertAddress) | 异步IO读取数据包 | RecvEx | +| `ValueTask` RecvAsync(WinDivertPacket, WinDivertAddress, CancellationToken) | 异步IO读取数据包 | RecvEx | +| int Send(WinDivertPacket, WinDivertAddress) | 同步阻塞发送数据包 | SendEx | +| int Send(WinDivertPacket, WinDivertAddress, CancellationToken) | 同步阻塞发送数据包 | SendEx | +| `ValueTask` SendAsync(WinDivertPacket, WinDivertAddress) | 异步IO发送数据包 | SendEx | +| `ValueTask` SendAsync(WinDivertPacket, WinDivertAddress, CancellationToken) | 异步IO发送数据包 | SendEx | +| bool Shutdown(WinDivertShutdown) | 关闭 | WinDivertShutdown | +| void Dispose() | 关闭并释放资源 | WinDivertClose | #### 3.2 Filter -| Api | 描述 | -| --------------------------------------------- | ------------------------- | -| static string Format(string, WinDivertLayer) | 格式化filter | -| static string Compile(string, WinDivertLayer) | 编译filter | -| static Filter True { get; } | 获取值为true的filter | -| static Filter False { get; } | 获取值为false的filter | -| Filter And(Expression>) | 使用and逻辑创建新的fitler | -| Filter And(Filter) | 使用and逻辑创建新的fitler | -| Filter Or(Expression>) | 使用or逻辑创建新的fitler | -| Filter Or(Filter) | 使用or逻辑创建新的fitler | +| Api | 描述 | 原Api | +| --------------------------------------------- | ------------------------- | ---------------------------- | +| static string Format(string, WinDivertLayer) | 格式化filter | WinDivertHelperFormatFilter | +| static string Compile(string, WinDivertLayer) | 编译filter | WinDivertHelperCompileFilter | +| static Filter True { get; } | 获取值为true的filter | 无 | +| static Filter False { get; } | 获取值为false的filter | 无 | +| Filter And(Expression>) | 使用and逻辑创建新的fitler | 无 | +| Filter And(Filter) | 使用and逻辑创建新的fitler | 无 | +| Filter Or(Expression>) | 使用or逻辑创建新的fitler | 无 | +| Filter Or(Filter) | 使用or逻辑创建新的fitler | 无 | #### 3.3 WinDivertPacket -| Api | 描述 | -| --------------------------------------------------- | --------------------------------------------------------------- | -| int Capacity { get; } | 获取缓冲区容量 | -| int Length { get; set;} | 获取或设置有效数据的长度 | -| Span Span { get; } | 获取有效数据视图 | -| void Clear() | 将有效数据清0 | -| Span GetSpan(int, int) | 获取缓冲区的Span | -| bool CalcChecksums(WinDivertAddress, ChecksumsFlag) | 重新计算和修改相关的Checksums | -| bool CalcNetworkIfIdx(WinDivertAddress ) | 根据IP地址重新计算和修改addr的Network->IfIdx | -| bool CalcOutboundFlag(WinDivertAddress) | 根据IP地址和addr.Network->IfIdx重新计算和修改addr的Outbound标记 | -| bool CalcLoopbackFlag(WinDivertAddress) | 根据IP地址重新计算和修改addr的Loopback标记 | -| bool DecrementTTL() | ttl减1 | -| int GetHashCode() | 获取包的哈希 | -| int GetHashCode(long) | 获取包的哈希 | -| WinDivertParseResult GetParseResult() | 获取包的解析结果 | +| Api | 描述 | 原Api | +| --------------------------------------------------- | --------------------------------------------------------------- | ---------------------------- | +| int Capacity { get; } | 获取缓冲区容量 | 无 | +| int Length { get; set;} | 获取或设置有效数据的长度 | 无 | +| Span Span { get; } | 获取有效数据视图 | 无 | +| void Clear() | 将有效数据清0 | 无 | +| Span GetSpan(int, int) | 获取缓冲区的Span | 无 | +| bool CalcChecksums(WinDivertAddress, ChecksumsFlag) | 重新计算和修改相关的Checksums | WinDivertHelperCalcChecksums | +| bool CalcNetworkIfIdx(WinDivertAddress ) | 根据IP地址重新计算和修改addr的Network->IfIdx | 无 | +| bool CalcOutboundFlag(WinDivertAddress) | 根据IP地址和addr.Network->IfIdx重新计算和修改addr的Outbound标记 | 无 | +| bool CalcLoopbackFlag(WinDivertAddress) | 根据IP地址重新计算和修改addr的Loopback标记 | 无 | +| bool DecrementTTL() | ttl减1 | WinDivertHelperDecrementTTL | +| int GetHashCode() | 获取包的哈希 | WinDivertHelperHashPacket | +| int GetHashCode(long) | 获取包的哈希 | WinDivertHelperHashPacket | +| WinDivertParseResult GetParseResult() | 获取包的解析结果 | WinDivertHelperParsePacket | #### 3.4 WinDivertRouter | Api | 描述 |