[Qt-interest] QUdpSocket datagram, how to get the whole package
Marco Borm
qt-lists at retrodesignfan.eu
Sun Jun 7 03:32:07 CEST 2009
As already written UDP uses a IP not a MAC to address the communication
peer. It is possible to map a IP with a MAC using the ARP protocol, but
the MAC you will get isn't always the MAC of the PC you talking with.
For example if there is a IP-router between two networks every device on
a side will only see the MAC of the router but never the real MAC of a
device on the other side.
So if you still want the MAC, check if there is some API to access the
arp-table or directly access "/proc/net/arp" on linux.
Marco
Patric wrote:
> Anyone ? :/
>
> ----- Original Message -----
> *From:* Patric <mailto:userqt at gmail.com>
> *To:* qt-interest at trolltech.com <mailto:qt-interest at trolltech.com>
> *Sent:* Saturday, June 06, 2009 5:35 PM
> *Subject:* QUdpSocket datagram, how to get the whole package
>
> Hello,
> I'm sending UDP datagrams using QUdpSocket.
> But now I need to get the MAC address of the device I'm querying.
> Does anyone know how it can be done ?
> If I get all the bytes in the package, I'll be able to extract the
> MAC address. But QUdpSocket is encapsulating only the UDP part as
> viewable.
>
> Patric
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4098 (20090522) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list