[Winpcap-users] MAC Address

Vasily Borovyak vbor at isd.dp.ua
Thu Jun 23 07:21:15 GMT 2005


Hello Alessandro,

A> Hi!
A> There is a way(function, struct) in winpcap in order to get MAC Address
A> from an ethernet interface, just like I can read IP Address,NetMask
A> Address etc... ? (Now I look at Ethernet Header in packets....)


  PPACKET_OID_DATA    pOidData;
  CHAR *pStr;
  pStr = new CHAR[sizeof(PACKET_OID_DATA)+128];
  ZeroMemory(pStr, sizeof(PACKET_OID_DATA)+128);
  pOidData = (PPACKET_OID_DATA) pStr;
  pOidData->Oid = OID_802_3_CURRENT_ADDRESS;
  pOidData->Length = 6;
  result = PacketRequest(lpAdapter, FALSE, pOidData);
  /* pOidData->Data[0], pOidData->Data[1], ...- this is MAC */


-- 
Best regards, vbor at isd.dp.ua

И пожалуйста, выражайтесь яснее, телепаты уволились и уехали.




More information about the Winpcap-users mailing list