String and EtherAddress

xiaophong xiaophong2002 at yahoo.com
Wed Mar 19 11:53:44 EST 2003


Dear all,

I want to transfer a String which contain 2 or more
Ethernet address to EtherAddress. I have to get every
single etheraddress and store it into a array whose
type is EtherAddress. But I got some problem.

Code:
EtherAddress leaf[i];
memcpy(leaf[t].data(),leaves.data()+t*ETHLEN, ETHLEN);
click_chatter("data is %s\n", leaf[t].data());
lick_chatter("Ethernet address%d =
%s\n",t,EtherAddress(leaf[t]).s().mutable_c_str());

The output of .data() is very well, but the output of
the Ethernet address is very wrong. 

output:
String is 00:70:hA:3d:37:EB00:70:hA:3C:36:00

data is 00:70:hA:3d:37:EB
Ethernet address 0 =30:30:3a:37:30:3a
data is 00:70:hA:3C:36:00
Ethernet address 1 =30:30:3a:37:30:3a

Thanks for your time and further help!

Xiao

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com




More information about the click mailing list