# Layer 2 Raw client-socket program issue



## kumaraparameshwaran (Oct 10, 2015)

Hello Everyone,

I want a Layer 2 Raw client-server program in FreeBSD. If I will to send raw Ethernet frames should I use BPF and not the socket? If I try to use socket with option AF_LINK it is telling that Protocol not supported by Address family? If it is possible what is the protocol I should use?


----------



## kumaraparameshwaran (Oct 10, 2015)

Hello Everyone,

Whenever I define a socket with definition socket(AF_LINK, SOCK_RAW, 0) it fails saying Address family not supported by Protocol Family. I need a Layer 2 Raw socket program..

Reply Pls...


----------



## fnoyanisi (Oct 12, 2015)

Hmmm... Seems like you need to do a bit of reading! 

socket(2)

Also, this thread should be in *Userland Programming and Scripting* section.


----------



## SirDice (Oct 13, 2015)

fnoyanisi said:


> Also, this thread should be in *Userland Programming and Scripting* section.


Agreed, thread is moved.


----------

