raw socket can't receive mac address information ,so i suggest you use "winpcap",it can receive mac header.
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
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
http://www.codeproject.com/internet/trafficwatcher.asp?target=winpcap
for more details, see
http://winpcap.polito.it/misc/links.htm
如果只用VC来写,那一般要在win2k下,监听的时候用 RCV_ALL 选项。
基本上你要写个sniffer,将winpcap的testapp例子改写即可。
http://winpcap.polito.it/
:-(
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
i have posted my example to you.sorry ,i am busy in yestoday and before.if any question,mail to me.