Commit Graph
125 Commits
Author SHA1 Message Date
basil00 cd1bfff998 Bump copyright year. 2016-01-19 11:15:48 +08:00
basil00 7cfc3e2e72 Further integrate the streamdump sample.
Untested.
2016-01-19 10:57:47 +08:00
basil00 bac03085ee Bump version to 1.2.1 2016-01-14 18:36:49 +08:00
basil00 eda0a86589 Add a new sample program: streamdump
Streamdump demonstrates how to handle streams using WinDivert.

This is a WIP.
2016-01-11 10:36:10 +08:00
basil00 657285bef6 CHANGELOG tweaks & remove old .inf file. v1.2.0-rc 2015-07-26 11:06:32 +08:00
basil00 723b0aa8f8 Update the CHANGELOG. 2015-07-25 23:29:49 +08:00
basil00 f0be301f1d Expand tests & bug fixes.
Extend the number of tests to cover some of the new features.
Fix IPv6 address comparison which did not work correctly in some cases.
2015-07-25 23:16:48 +08:00
basil00 609ab63594 Add a NO_REPLACE for WinDivertHelperCalcChecksums
The WINDIVERT_HELPER_NO_REPLACE flag tells WinDivertHelperCalcChecksums not to
recalculate and replace non-zero checksum fields.  This is useful for
reconstructing the checksums for packets returned by WinDivertRecv(), where
all non-zero checksum fields are already valid.  This allows WinDivert1.2
to achieve similar efficiency as WinDivert1.1, where checksums were calculated
by the driver.

Note that for modified packets, the WINDIVERT_HELPER_NO_REPLACE flag should
not be used, as all checksums need to be recalculated from scratch anyway.
2015-07-25 13:24:28 +08:00
basil00 82fb0e704c Update documentation.
Add notes about zero-checksums and known issues.
2015-07-25 12:40:03 +08:00
basil00 3fcb692478 Ensure offloaded checksums are zero.
WinDivert now treats all offloaded checksum fields as zero:
- WinDivertRecv() will zero all offloaded checksum fields.
- Filter matching will treat offloaded fields as zero.
2015-07-25 12:05:23 +08:00
basil00 3bcf1ae7a0 Update samples & test programs to the new version. 2015-07-19 11:40:02 +08:00
basil00 54f8640b89 Build & bug fixes.
- Make WinDivert compile again under WDK/MSVC.
- Fix undiscovered bug where ip.TOS (8-bit field) was passed to ntohs.
2015-07-18 16:46:21 +08:00
basil00 a15df9b886 Update and improve the README file. 2015-07-18 12:41:20 +08:00
basil00 7666386af2 Update the WinDivert documentation for version 1.2 2015-07-18 10:46:20 +08:00
basil00 130e25c05b Bump copyright year. 2015-07-17 19:13:55 +08:00
basil00 fdd5825f5d Bump version to WinDivert 1.2
Bump version and change magic numbers to make the driver incompatible with
older versions.  Also cleanup some driver checksum code missed by previous
commit.
2015-07-17 18:24:30 +08:00
basil00 e247f01c43 Remove automatic checksum calculation & legacy API
- As discussed in #37, the WINDIVERT_FLAG_NO_CHECKSUM behavior has become the
  default.  This means that outbound packets returned by WinDivertRecv() are
  no longer guaranteed to have valid checksums, thanks to TCP checksum
  offloading by the Windows TCP/IP stack.  The checksums can still be
  recovered by calling WinDivertHelperCalcChecksums() manually.
- Remove the old WinDivert1.0 legacy API, as nobody should still be using it.
2015-07-02 21:19:27 +08:00
basil00 e1ea77f1d3 Implement a filter compiler with new features.
Replaces the old filter compiler with a new version that:
- Is a cleaner, more extensible, implementation.
- Can report specific error messages (e.g. bad token vs parse error).
- Supports the new C-style if-then-else expression "(A? B: C)" syntax.

Two new WinDivert helper API functions have been implemented:
- WinDivertHelperCheckFilter() can be used to check a filter string for
  errors.
- WinDivertHelperEvalFilter() evaluates a filter on a given packet.  Will be
  useful for testing.
2015-06-21 12:38:49 +08:00
basil00 90da7a92c7 - Fix documentation; ipv6 extension headers are now supported. 2014-11-29 13:22:52 +08:00
basil00 a3026de69c - Add IPv4 DNS request test cases. v1.1.7 2014-11-18 22:21:18 +08:00
basil00 232459cc11 - Document the WinDivertHelperParseIPvXAddress() byte/word orderings. 2014-11-18 00:02:47 +08:00
basil00 b452e1ce29 - Fix failing test case caused by bad word ordering. 2014-11-17 23:57:49 +08:00
basil00 bf19fdf2f9 - Add an ICMPv6 test packet.
- Fix missing byte-swaps for ICMPv6 fields.
- Todo: 1 test-case fails.
2014-11-17 19:25:17 +08:00
basil00 ecd9ae59d3 - Re-implement WinDivertHelperParseIPv6Address(). Previous version was just
too bug-prone, so re-try from scratch.  New version works for several tests.
- Fix broken WinDivertAToX().
- New test case: IPv6 TCP SYN.
2014-11-16 13:31:07 +08:00
basil00 5eaf312730 - Add new WinDivert testing framework. 2014-11-15 15:11:28 +08:00
basil00 48075e2e5f - Fix broken implementation of WinDivertHelperParseIPv6Address().
- Fix IPv6 address word/byte ordering between DLL and SYS.
2014-11-15 15:06:16 +08:00
basil00 72d83fcb07 - Fix incorrect IPv6 pseudo header definition in the driver. 2014-11-15 13:51:16 +08:00
basil00 8d98da751c - WinDivert driver now skips IPv6 extension headers when filtering packets.
- windivert_filter() now uses Ndis(Advance/Retreat)NetBufferDataStart() to
  find packet headers.
- NOTE: This new code is not yet very well tested.
2014-11-15 00:57:17 +08:00
basil00 0a70d4120d - Remove duplicate code from last commit. 2014-11-13 18:52:16 +08:00
basil00 4edd82f55f - Ignore the checksum info for loopback packets. This info seems to be
unreliable for whatever reason, so better to ignore until a better solution
  is found.
2014-11-13 18:47:46 +08:00
basil00 7235b687b3 - WinDivertHelperParsePacket() now skips IPv6 extension headers. 2014-11-10 19:16:33 +08:00
basil00 7952724127 - Driver now calculates checksums for IPv6 packets (fix issue #28).
- Bump version to 1.1.7
2014-11-09 12:44:21 +08:00
basil00 d46a902c90 - Fix issue #29 found by MarlosChida: the IPv6 pseudo-header definition was
incorrect leading to invalid checksums.
2014-11-08 15:15:54 +08:00
basil00 bbf06c9503 - Fix missing '\'. 2014-09-16 00:04:07 +08:00
basil00 d43aa57014 - Reduce number of work items to 2; 4 was overkill. v1.1.6 2014-09-15 23:48:32 +08:00
basil00 50aecbda75 - Towards version 1.1.6 2014-09-05 12:36:55 +08:00
basil00 6b3fd714c0 - Fix silly bug in last commit, remove the .exe name from the path. 2014-09-05 12:27:25 +08:00
basil00 7bd52aed76 - Use GetModuleFileName instead of GetCurrentDirectory as discussed in issue #24. 2014-08-15 18:15:25 +08:00
basil00 5e706931f0 - New version 1.1.5 v1.1.5 2014-05-25 11:54:13 +08:00
basil00 9a13606030 - Insert WinDivert as the highest weighted sublayer. 2014-05-19 19:18:10 +08:00
basil00 98c4a51fad - Fix issue #18 that causes a BSOD when a NULL pointer is passed as an
address parameter to either WinDivertRecv or WinDivertSend.
- Use better NT_STATUS codes for some errors.
- Bump the version number to WinDivert 1.1.4
v1.1.4
2014-04-02 19:40:54 +08:00
basil00 874d147b9b - Update copyright year.
- Use exact version number in driver binary.
v1.1.3
2014-03-24 18:15:05 +08:00
basil00 d5d8e163e3 - Towards version 1.1.3 2014-03-24 18:07:00 +08:00
basil00 4b708f0c16 - Wrap the sublayer/filter/callout setup in transactions. This appears to
make it less likely to break networking if something goes wrong.  It may
  also solve issue #15.
- Fix bug in last commit.
2014-03-23 22:33:46 +08:00
basil00 7f0e697092 - Fix bug (see issue #14) where some outbound TCP packets were never handled
by the classify function and silently dropped.  This can degrade outbound
  speed significantly, as it forces the Windows TCP/IP stack to re-send the
  missing data.  Thanks to GhalemB who found the bug & fix.
2014-03-23 11:18:05 +08:00
basil00 33f6bec1e5 - Refactor driver unload functions.
- Packet direction fix for netfilter example.
- Bump version to 1.1.2-rc.
v1.1.2-rc
2013-12-25 11:28:01 +08:00
basil00 57934712c6 - Refactor the WFP interface:
* WinDivert sublayers are created and inserted when the driver is loaded.
  * All WinDivert callouts are installed at the same sublayer.
- Clean-up the implementation of priorities.
- Re-introduce deep copying for SNIFF mode.  This avoids referencing the
  sniffed packets.
- Fix-up the netfilter example:
  * Don't send RSTs to RST/FINs, this can start a RST war.
  * Don't inject ICMP outbound - this may not be a problem despite 1233 errors.
2013-12-23 11:03:02 +08:00
basil00 4f81c315d6 - Use FwpsAllocateCloneNetBufferList0 for the packet queue, as opposed to
copying the data.
2013-12-18 16:28:58 +08:00
basil00 76459ac3fe - Use WDF work items instead of threads. Also use multiple work items so
that read_service() can be run in parallel.
2013-12-18 09:54:01 +08:00
basil00 6ac77a644b - Fix some bugs introduced by recent commits. 2013-12-13 17:09:37 +08:00