When developing network applications, it's always necessary to capture network traffic. windows CE has built-in sniffer tool, netlog for this purpose. it captures network traffics to a file that can be examined with Wireshark or network monitor.
To enable it, we need to select NDIS Packet Capturing DLL and NDIS user-mode I/O protocol driver in Visual Studio, as shown below.
Then, we can capture network traffic with following commands.
1. Set capture file lacation:Netlogctl file "\ storage card \ net"
2. Start captureNetlogctl start
3. Perform network activities
4. Stop captureNetlogctl stop
5. Copy \ storage card \ net. Cap [I]. Cap to computer and open with Wireshark
netlogctl usage:
netlogctl start-start the loggging.
netlogctl load-start the loggging.
netlogctl stop-stops the loggging.
netlogctl unload-causes networking to unload the netlog component. (may destabilize System)
netlogctl pkt_size XX-sets maximum packet size captured.
netlogctl cap_size XX-sets maximum size of half capture file.
netlogctl file XXX-sets the name of the file to log.
netlogctl usb xxx-1 => log USB, 0 => stop logging USB.
netlogctl state-print state.
netlogctl trace-print trace message State for all modules.
netlogctl trace -print trace message state for specified module.
netlogctl trace -set trace message state for specified module.