pippin wrote:
> I'll check for the 3-digit thing but it's generally...
> A) it has always been that way :) leading zeroes get stripped. It's
> because internally iPeng uses the binary format (6 single bytes) and
> what you see displayed is what the nota function makes out if that
> B) for the same reason leading zeroes don't matter at all.
This is the code that I use in my windows wol tool:
Code:
--------------------
/*
ether_ntoa: translate a ether_addr struct into a ethernet
string.
*/
//ether_ntoa (const struct ether_addr *addr, char *buf)
#ifdef UNICODE
LPTSTR ether_ntoaW (PETHER_ADDRC addr, LPTSTR buf)
{
StringCbPrintfW (buf, ETH_STRLEN*2,
TEXT("%02x:%02x:%02x:%02x:%02x:%02x"),
addr->ether_addr_octet[0], addr->ether_addr_octet[1],
addr->ether_addr_octet[2], addr->ether_addr_octet[3],
addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
return buf;
}
#endif
//char * ether_ntoaA (const struct ether_addr *addr, char * buf)
char * ether_ntoaA (PETHER_ADDRC addr, char * buf)
{
StringCbPrintfA (buf, ETH_STRLEN, "%02x:%02x:%02x:%02x:%02x:%02x",
addr->ether_addr_octet[0], addr->ether_addr_octet[1],
addr->ether_addr_octet[2], addr->ether_addr_octet[3],
addr->ether_addr_octet[4], addr->ether_addr_octet[5]);
return buf;
}
--------------------
..basically it's just printf and I'd think you could just cast your
binary format to the ETHER_ADDRC.
------------------------------------------------------------------------
gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115
View this thread: http://forums.slimdevices.com/showthread.php?t=51929
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins