• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Source Mac address on PF_NDRV
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Source Mac address on PF_NDRV


  • Subject: Source Mac address on PF_NDRV
  • From: Peter Schoenmaker <email@hidden>
  • Date: Thu, 30 Oct 2014 15:48:53 -0700

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

  • Follow-Ups:
    • Re: Source Mac address on PF_NDRV
      • From: Dieter Siegmund <email@hidden>
  • Prev by Date: Re: What's the best way to run an NSURLProtocol session?
  • Next by Date: Re: Source Mac address on PF_NDRV
  • Previous by thread: Re: PeerToPeer Replications using bonjour not working with IPV6 addresses
  • Next by thread: Re: Source Mac address on PF_NDRV
  • Index(es):
    • Date
    • Thread