Hi, May be it's not solving your issue but I can propose you a sample code that can change the MAC address annd IPv4 address for a specific network interface . This code is working well with the FreeBSP TCP/IP stack ported on eCOS and with ethernet devices/drivers that accept changing their MAC adress trough iotcl calls. The code was originaly written in french, I have translate it quickly without compiling so please forgive my mistakes if any. You could use the API like this : char mac[ETHER_ADDR_LEN]={0xDE,0xAD,0x00,0xBE,0xEF,0x00}; IP_SetMAC("eth0",mac); // Will set MAC adress of eth0 interface to DE:AD:00:BE:EF:00 IP_SetIP("eth0","192.168.0.1"); // Will set the IPv4 adress of eth0 interface to 192.168.0.1 ----------------------------------------------------- Here comes the code : Note: My own defines : #define MACSTRING 18 char* ether_print(const u_char cp[ETHER_ADDR_LEN], char *etheraddr,const unsigned int len) { snprintf(etheraddr,len,"%02x:%02x:%02x:%02x:%02x:%02x",cp[0],cp[1],cp[2],cp[3],cp[4],cp[5]); return(etheraddr); } int IP_SetMAC(const char* interface,unsigned char mac[ETHER_ADDR_LEN]) { int test_sock=0; // Socket PF_INET/SOCK_DGRAM unsigned char i=0; struct ifreq ifr; unsigned char display[MACSTRING]; test_sock = socket( PF_INET, SOCK_DGRAM, 0 ); if( test_sock == -1 ) { diag_printf("Cannot obtain socket"); return (-1); } memset(&ifr,0,sizeof( struct ifreq ) ); strncpy(ifr.ifr_name,interface,IFNAMSIZ); for (i=0;isin_len=sizeof(struct sockaddr_in); addr->sin_family=AF_INET; addr->sin_addr.s_addr=inet_addr(adresse); strncpy(ifr.ifr_name,interface,IFNAMSIZ); if( ioctl( test_sock, SIOCSIFADDR, &ifr ) != 0 ) { diag_printf("Cannot set IP address of '%s' to '%s' because '%s'",interface,adresse,strerror(errno)); close(test_sock); return (-1); } else diag_printf("IP address for '%s' set '%s' ",interface,inet_ntoa(addr->sin_addr)); close(test_sock); return(0); } Note : I have used the following headers files , they are not all necessary as my original file was doing more work like changing routes and ARP entries.Anyway, I hope this helps. #include #include #include #include #include #include #include #include #include #include #ifdef CYGPKG_NET_FREEBSD_SYSCTL #include #endif #include #include #include #include #include #include #include #include #include #include On Mon, 1 Aug 2005 14:07:51 -0700 (PDT) mkhoyila@uci.edu wrote: > can someone guide me on how to assign an IP address to a mac address from > eCos ethernet driver? If so, is there a sample code I can look at. thanks. > > Michael > > > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss > > --