RtEthernetFilter
For each received frame, RtEthernetFilter prints the Ethernet header, and it filters the frame out if it’s an ICMP packet whose Source MAC Address is equal to 00:0e:0c:c2:89:45.
For each transmitted frame, RtEthernetFilter prints the Ethernet header, and it filters the frame out if it's an ICMP packet whose Destination MAC Address is equal to 00:0e:0c:c2:89:45. In that case, it also wakes up a background thread that uses the RTTCPIP API to create and send a dummy IP packet.
Using the Sample
- Prepare a setup with two NICs: one being converted to wRTOS and the other being used by Windows. Connect the two NICs.
- Note the MAC Address of the NIC used by Windows.
- Edit RtEthernetFilter.c and replace the hard coded 00:0e:0c:c2:89:45 MAC Address by the MAC Address of the NIC used by Windows.
- Rebuild RtEthernetFilter.
- Configure the wRTOS NIC to use RtEthernetFilter.rtdll as a filter driver and start the TCP/IP Stack.
- On the Windows side, start a packet sniffer to capture the traffic.
- From the Windows NIC, ping the wRTOS NIC and observe that the ICMP Echo requests are filtered out by RtEthernetFilter.rtdll.
- From the wRTOS NIC, ping the Windows NIC and observe that the ICMP Echo requests are filtered out by RtEthernetFilter.rtdll. Also observe on the packet sniffer that some dummy IP packets are generated instead.
Output
Example of the printout when an incoming frame is filtered:
*************** Receive *****************
(60)
Src 9c 69 b4 65 02 78
Dest 24 5e be 7c 28 60
Type 0x0800
45 00 00 3c 5d c6 00 00 80 01 ca e0 c0 a8 c8 c7 c0 a8 c8 01 08 00 4d 56 00 01 00 05 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 61 62 63 64 65 66 67 68 69
ICMP Receive - Frame getting dropped
Example of the printout when an outgoing frame is filtered:
*************** Xmit *****************
(60)
Src 24 5e be 7c 28 60
Dest 9c 69 b4 65 02 78
Type 0x0800
45 00 00 3c 3d a5 00 00 40 01 2b 02 c0 a8 c8 01 c0 a8 c8 c7 08 00 12 b8 87 b7 00 00 e5 cc 1c b4 5b 0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ICMP Xmit - Frame getting dropped
APIs Referenced
RTAPI
Supported Windows API
RTTCPIP API