Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
788 Views

DHCP HostName definition in a socket server eth project

Hi all, 

 

I have developed a Nios FW with MicroC/OS-II and NicheStack TCP/IP, like the "simple socket server". 

Now I have enabled the DHCP option and the system runs correcty because the Router assign to it the IP dinamically. 

The problem is that the Router doesn't recognize the HostName of my system. 

 

How can I implement the hostname in order to have the possibility to connect by the client to the server through the HostName and not the IP address? 

 

Thanks, 

Christian 

 

0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
38 Views

Hi Christian, 

 

this functionality you have to implement within the client user application. After the DHCP server has assigned an IP-address to your Nios Host you can see the matching MAC-address in the rooting table. So you will be able to identify the connected Nios Host by his MAC-address. The lower 3 Bytes of the MAC-adress you can specify in the Nios firmware using get_mac_adddress(). 

 

Jens
Altera_Forum
Honored Contributor I
38 Views

Thank you Jens, 

 

but if I would connect by a client like Telnet without knowing the IP Address, Can I add in the my Nios system some functions that permits to cummunacte an HostName to the Router? 

However I have useg the function get_mac_adddress() in my Nios firmware. 

 

Best Regards, 

Christian
Altera_Forum
Honored Contributor I
38 Views

Christian, 

I think a DNS-server should running at your router. You have to provide its address to the network stack (Interniche). May be there is a function in the NicheStack to tell a DNS-Server the hostname during DHCP. I have never used that so I can not help in detail. 

 

 

Jens
Altera_Forum
Honored Contributor I
38 Views

Thank you very much Jens

Reply