getting hardwrae address using rtnetlink and printing that address
i am using rtnetlink for getting the network information i.e interface details,ipaddress,hardware address,mask,broadcast address.i am getting problem while printing the hardware address.i am not able to get the full hardware address, i am getting only 4bytes in decimal format.i am using the
inet_ntop(AF_INET, RTA_DATA(rtap), hardware_addr,24);
printf("%sn",hardware_addr);
it will print 0.19.32.58 as hardware address.is the correct way of printing.is ther any other way.
|