hello,
I am creating a socket connection to receive ethernet SAP frames. I am correctly receiving the frame, but it starts at the 802.2 header (DSAP/SSAP/Control.) I a receiving ethernet multicast packets. When i use the recvfrom() call, i get the destination mac address, but i want the source mac address.
Short socket code:
so = socket(PF_NDRV, SOCK_RAW, 0);
...
struct sockaddr sa;
memset(&sa, 0, sizeof(sa));
sa.sa_family = AF_NDRV;
strcpy(sa.sa_data, interfacename);
// Bind socket to interface
int res = bind(so, (struct sockaddr *)&sa, sizeof(sa));
...
if (setsockopt(so, SOL_NDRVPROTO, NDRV_SETDMXSPEC, &pdesc, sizeof(struct ndrv_protocol_desc)) == -1) {
...
if (setsockopt(so, SOL_NDRVPROTO, NDRV_ADDMULTICAST, dlp, sizeof(struct sockaddr_dl)) == -1) {
...
recvfrom(so, buf, 65535, 0, addr_dl, sizeof(struct sockaddr_dl));
...
The data in the addr_dl contains the destination mac address, but no where can i find the source mac address.
Thanks
Peter
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden