use BB-xM to send raw ethernet packet

Hello,
I have not used beagleboard or embedded system before, and I want to build a raw ethernet to send packets, here are some questions:

  1. If I wrote a socket-building code in C language on Ubuntu, can it work on beagleboard ? (such as header files <sys/socket.h> <linux/if.h> <linux/if_ether.h> <linux/if_packet.h>, can they be read correctly?)

2.do I need to set hardware configuration? or API on Ubuntu will handle this for me?

I am afraid of that I cannot get the privilege to send raw ethernet packet through beagleboard ethernet socket.
One example is Windows OS, which takes off the right to send packets through data link layer except using special method.

Thanks!