Ethernet communication

Eric Norum wenorum at lbl.gov
Tue Jun 22 15:27:49 UTC 2010


On Jun 22, 2010, at 7:49 AM, João Rasta wrote:

> Hello,
> 
> I'm somewhat confused about implementing TCP (UDP)/IP communications in RTEMS. This is because i have seen the RTEMS Network Supplement doc and the networkconfig.h. However, i'm used to regular sockets. So:
> 
> 1) Can i use regular TCP or UDP sockets in RTEMS?
Yes.  The RTEMS network stack is taken from FreeBSD and provides a standard socket API.

> If so, do i need to initialize the ethernet driver with RTEMS_BSP_NETWORK_DRIVER_ATTACH? And in this case, why is the networkconfig.h needed?
See below for what's in networkconfig.h

> 
> 2) Is there another way to implement ethernet communications in RTEMS using pre-defined functions?
RTEMS network configuration is handled by setting up a linked list of rtems_bsdnet_ifconfig structures -- one list entry for each network device.  Typically there are at least two of these structures, one for the loopback device and one for the real network interface device.
You then set up a rtems_bsdnet_config structure which includes a  pointer to the linked list of network devices and some network information,  information as to whether or not to use BOOTP/DHCP to set up the network information, the priority of the network tasks, the amount of memory to set aside for mbufs and mbuf clusters, the host name and the DNS domain name, the names or numbers of NTP servers and such.
Then call rtems_bsdnet_initialize_network to get networking goin.



-- 
Eric Norum
wenorum at lbl.gov




More information about the users mailing list