From 4af3cf07617ca8eb06a18290c1a03b7a82171a41 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Mon, 31 Dec 2018 20:48:34 -0500 Subject: [PATCH] untested win32 mac code. --- src/rawnet/rawnetarch_win32.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rawnet/rawnetarch_win32.c b/src/rawnet/rawnetarch_win32.c index e6527d1..b4b1883 100644 --- a/src/rawnet/rawnetarch_win32.c +++ b/src/rawnet/rawnetarch_win32.c @@ -574,6 +574,19 @@ extern int rawnet_arch_get_mtu(void) { } extern int rawnet_arch_get_mac(uint8_t mac[6]) { + + char buffer[sizeof(PACKET_OID_DATA) + 6]; + PPACKET_OID_DATA data = (PPACKET_OID_DATA)data; + + /* 802.5 = token ring, 802.3 = wired ethernet */ + data->Oid = OID_802_3_CURRENT_ADDRESS; // OID_802_3_CURRENT_ADDRESS ? OID_802_3_PERMANENT_ADDRESS ? + data->Length = 6; + + if (PacketRequest(EthernetPcapFP, FALSE, data)) { + memcpy(mac, data->Data, 6); + return 0; + } + return -1; }