Ethernet programming in C?

Question by Wybourn: Ethernet programming in C?
I’m trying to write a C program which sends and receives tcp packets to an ethernet device. I not sure where to start as most tutorials online refer to PC to PC communication. However, I am transmitting to an embedded system with a built in instruction set.

I’ve tried creating programs using the functions socket, bind, listen accept, send, recv etc, however the program does not receive or send any data. I’m not sure whether I should be sending a raw ethernet packet/frame.

I would appreciate if someone could point me in the write direction, and I’m using ubuntu 10.04.
Thanks

Best answer:

Answer by Rus
Hmmm… I’ve never done this specific type of development before, but a search for a low level Linux TCP/IP API gave me this: http://www.tenouk.com/cnlinuxsockettutorials.html

Seems to be pretty descriptive and uses a standard library. That’s where I would look first.

What do you think? Answer below!

Leave a Reply

Your email address will not be published. Required fields are marked *


*