# Socket Program



## kumaraparameshwaran (Oct 1, 2015)

Hello All..

I need a Layer 2 raw socket client-server program. In Linux there is an structure called struct sockaddr_dl and it has source MAC address and destination MAC address as members. Is struct sockaddr_dl the equivalent of it ?  If so then how do I fill in the addresses.

Thank you.


----------



## cpm@ (Oct 1, 2015)

Hi,

Please, take a look to link_addr(3) man page.


----------



## fnoyanisi (Oct 1, 2015)

In addition to cpm's post, ifconfig source includes usage of the data structure.

You may also want to have a look at if_dl.h for the decleration of the sockaddr_dl structure.


----------

