pippin wrote: 
> Yes, but I _want_ to use the binary format internally. It's not _my_
> format, it's the network format, it's how I get the MAC address from the
> ARP cache and it's quite handy to handle and compare... no string
> interpretations over encodings, no upper/lowercase mismatches and in the
> end it's what you have to send in the WOL packet, too...
> So anything else is just for displaying things and the display code if
> different for the label and the entry field because I used the standard
> entry field I use in other places as well and it had to maintain a
> certain format to automatically encode the right thing while I didn't
> care as much for the label....No, no.  I'm not questioning any of that.  I'm 
> saying keep the network
format and with a simple cast you should be able to use sprintf to
output a standard hex mac string for display.  

#define ETH_ALEN                 6              //Octets in one ethernet addr
typedef unsigned char u_int8_t;
#pragma pack(1)
typedef struct ether_addr {
u_int8_t ether_addr_octet[ETH_ALEN];
} ETHER_ADDR, *PETHER_ADDR;

..so, if your binary is arpmac, then

PETHER_ADDRC pMac;

pMac = (PETHER_ADDR) &arpmac;

Then you can easily feed the individual octets to sprintf via
pMac->ether_addr_octet[0], pMac->ether_addr_octet[1], etc., to end up
with a well formed hex string for display.

Sorry.  It's not my place to tell you how to do things.  iPeng is a
wonderful piece of software and my life is definitely enriched by using
it.  Thanks.


------------------------------------------------------------------------
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

Reply via email to