题目就是问题

解决方案 »

  1.   

    raw socket can't receive mac address information ,so i suggest you use "winpcap",it can receive mac header.
      

  2.   

    there is an example using winpcap in codeproject.
    http://www.codeproject.com/internet/trafficwatcher.asp?target=winpcap
    for more details, see
    http://winpcap.polito.it/misc/links.htm
      

  3.   


    如果只用VC来写,那一般要在win2k下,监听的时候用 RCV_ALL 选项。
      

  4.   

    但是我用rev_all,编译通过不了!!!!!
      

  5.   

    建议先去了解MSTCPIP.h,iphlpapi.h相关内容。
      

  6.   

    rawsocket是收不到MAC头的,只能收到IP头,TCP头这些,打包后再由网卡发送时,报文再加上MAC头。你可以去找个协议分析器分析一下报文。例如NAI公司的snifferpro.
    基本上你要写个sniffer,将winpcap的testapp例子改写即可。
      

  7.   

    套接字是TCP/IP的,没有办法收到更底下的东东
      

  8.   

    现在数据格式不是问题,基本上TCP/IP协议里的所有的协议的数据格式,我凑知道,但是,我不知道怎么接收到带有MAC地址的网络数据,我想做个PPPOE的客户程序,但是如果不能收到带MAC的数据,就不能分析出PPPOE的报文.snifferpro我这里也有,能不能介绍给例子程序,或者说给点详细的资料.
      

  9.   

    基本上采用winpcap做一个sniffer自己抓包是最简单的了。使用的方法如下:
    http://winpcap.polito.it/
      

  10.   

    to kingzai(studying C#) :
    :-(
    The page cannot be displayed 
    The page you are looking for cannot be displayed because the page address is incorrect.  --------------------------------------------------------------------------------Please try the following:If you typed the page address in the Address bar, check that it is entered correctly.Open the winpcap.polito.it home page and then look for links to the information you want. 
    HTTP 405 - Resource not allowed
    Internet Information Services--------------------------------------------------------------------------------Technical Information (for support personnel)More information:
    Microsoft Support 
     看你的勋章,知道你的等级很高,能不能给我做的Demo
      

  11.   

    ok, i will post you a domo on Monday.
      

  12.   

    kingzai(studying C#) :谢谢,先,[email protected],90分给你,剩下的给其他几个参与的朋友,你等级这么高,不会有什么意见吧,呵呵.
      

  13.   

    http://61.129.74.207:8080/zhgc/Lib.zip ( 有什么事情可以联系我 msn [email protected])
      

  14.   

    anyiflyer:
      i have posted my example to you.sorry ,i am busy in yestoday and before.if any question,mail to me.
      

  15.   

    kingzai(感悟中) ,我收到了,谢谢,暂时不结帐,我分有很多,到时候给你200分都没问题!
      

  16.   

    通过socket根本不可能达到你的目的!!!socket只能收到IP层以上的数据(包括IP层)。