Any piece of internet software, such as a web browser, directs data to a. Then get the data from socket and using sprintf save mac address into buffer. IP addresses by learning how a MAC address identifies network devices locally. First we open file descriptor and select network family ( AF_NET) in case of IPv6 we use AF_NET6. To get MAC address we need to use some socket related stuffs, also need to use ioctl commands. # include # include # include # include # include # include # include # include # include # include # include # include using namespace std void getMacAddress ( char * uc_Mac )