NL2FilterDriverSample
NL2FilterDriverSample provides a simple Filter Driver example for the Network Link Layer (NL2).
This sample manages multiple Receive Queues simultaneously. It inspects all the Ethernet frames received from those managed Receive Queues and drops any UDP packet with an odd-numbered destination port.
Building the Sample
Build the sample using the RTSSDebug or RTSSRelease configuration (to build NL2FilterDriverSample.rtdll).
Running the Sample
- Assign the NL2FilterDriverSample.rtdll filter driver to a Rx Queue of the target network interface card (NIC).
- Start the NL2 and network stack on the wRTOS system.
- Launch RtTcpipServer in UDP mode on port 9999 (odd number).
- Restart or launch RtTcpipServer on port 9998 (even number).
- From a separate machine on the network, run RtTcpipClient to send UDP packets to the wRTOS server.
Expected Results
- The driver initializes successfully without errors.
- IPv4 UDP packets received on the managed Rx queues are analyzed.
- Packets whose UDP destination port is an odd number are marked as filtered and thus blocked or discarded. All other packets pass through unfiltered.
Remarks
To maintain simplicity, this Filter Driver has the following limitations:
- It only supports IPv4.
- It doesn't validate the checksums of the received packets.