Socket address type from recvfrom () with AF_PACKET / PF_PACKET

On two computers, I open the socket AF_PACKET / PF_PACKET, the raw protocol.

sock = socket (AF_PACKET, SOCK_RAW, htons (PROTO_BULK))

(edit: PROTO_BULK is the dummy type I created for this test. I do not expect it to come out with this problem, but I could be wrong.)

The first computer sends a packet to another send () standard, which is received on the other hand:

recvfrom (sock, buffer, 1600, 0, (struct sockaddr *) & from, & fromlen);

Now my problem is: what is the data type in "from"? Here is an example of what I get:

00 00 00 00 00 00 00 00 00 f8 cd a1 00 58 1d a1 00 94 60

From the length and contents, this is not like "struct sockaddr" or "sockaddr_ll". Any ideas?

, . MAC- , .

​​Linux ( !).

: . "fromlen" "", , - , "recvfrom()" . , ! , , , ...

"struct sockaddr_ll", , .

+3
2

, .

recvmsg, , ( ), .

, , . sendto.

+3

. , ...

PROTO_BULK 37984 (0x9460)?

, , , "struct sockaddr_pkt". ( , .) , . , "" , . , , .

+1

All Articles