Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot get mac direction #30

Closed
ericsuarez opened this issue Jun 22, 2017 · 2 comments
Closed

cannot get mac direction #30

ericsuarez opened this issue Jun 22, 2017 · 2 comments

Comments

@ericsuarez
Copy link

There are some method to get the mac direction?. When I received the buffer, start in internet layer, avoiding the link layer(where is the mac direction).

Ex:
socketIcmp.on ("message", function (buffer, address) {
console.log ("ICMP received " + buffer.length + " bytes from " + address
+ ": " + buffer.toString ("hex"));
});

RESULT =
ICMP received 84 bytes from 127.0.0.1:
45 00 00 54 2f 79 40 00 40 01 0d 2e 7f 00 00 01 7f 00 00 01 08 00 2b 8e 28 9e 00 01 b5 fa 4b 59 00 00 00 00 db ab 08 00 00 00 00 00 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37

IN WHIRESHARK
00 00 00 00 00 00 00 00 00 00 00 00 08 00 45 00 00 54 33 62 40 00 40 01 09 45 7f 00 00 01 7f 00
00 01 08 00 3f 09 28 fd 00 01 f4 fa 4b 59 00 00 00 00 8b d1 05 00 00 00 00 00 10 11 12 13 14 15
16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35
36 37

As I see. In Whireshark, start with 00.00.00.00 (source mac) and 00.00.00.00(destination mac). And in the raw socket, this ethernet protocol is avoid. Are some method to rescue it?

@stephenwvickers
Copy link
Collaborator

I don't believe you can get a raw socket to return the Ethernet header details, raw sockets return network layer and down not link layer down. You may need to use something like WinPCAP/libpcap.

@ericsuarez
Copy link
Author

@stephenwvickers thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants