我在
Windows 7机器上安装了TAP-WIN32适配器V9.我想用
TUN从接口读取IP数据包.我跟着C#样本
http://www.varsanofiev.com/inside/using_tuntap_under_windows.htm
TUN从接口读取IP数据包.我跟着C#样本
http://www.varsanofiev.com/inside/using_tuntap_under_windows.htm
IntPtr ptun = Marshal.AllocHGlobal(8); Marshal.WriteInt32(ptun,0x0a030001); Marshal.WriteInt32(ptun,4,unchecked((int)0x00ffffFF)); bool val = DeviceIoControl (ptr,TAP_CONTROL_CODE (5,METHOD_BUFFERED) /*POINT TO POINT */,ptun,8,out len,IntPtr.Zero);
但是,我似乎仍然没有得到IP数据包.我在另一端运行了tcpdump
它抱怨“错误的链路层封装”.