Wireshark mailing list archives

Getting data out of 'address' struct


From: Beth <beth.tridium () gmail com>
Date: Thu, 4 Feb 2010 11:54:02 -0500

If I populate an address with the following syntax:
    SET_ADDRESS(&pinfo->dl_dst, AT_EUI64, sizeof(guint64), jn_dst64);

and then later I need to get that address back out as a uint64, what is the
proper way to do it?
I don't see any predefined macro for this operation, at least not in
address.h.

The following works, but it makes the assumption that the data buffer is
8-byte aligned, which I assume is not guaranteed.

    guint64 dst_eui64 = *(guint64*)(pinfo->dl_dst.data);

Is there a function or macro somewhere for this, or should I just create a
little loop to copy the bytes?

Thanks,
b.
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: