Forum Discussion
53 Replies
- Altera_Forum
Honored Contributor
What's up?
I'm looking forward to receiving any the question. And In the meantime, I tried to review this problem. But there're so numerous for my doing. In summary, The most of different to me that's I cannot define IP address on DEVELOPMENT KIT(CYCLONE III). I wish that anybody will help me!! thanks for your helping. - Altera_Forum
Honored Contributor
Did you read my last answer?
- Altera_Forum
Honored Contributor
Yes, I did. and Here this code I found.
* get_ip_addr() * * This routine is called by InterNiche to obtain an IP address for the * specified network adapter. Like the MAC address, obtaining an IP address is * very system-dependant and therefore this function is exported for the * developer to control. * * In our system, we are either attempting DHCP auto-negotiation of IP address, * or we are setting our own static IP, Gateway, and Subnet Mask addresses our * self. This routine is where that happens. */ int get_ip_addr(alt_iniche_dev *p_dev, ip_addr* ipaddr, ip_addr* netmask, ip_addr* gw, int* use_dhcp) { IP4_ADDR(*ipaddr, IPADDR0, IPADDR1, IPADDR2, IPADDR3); IP4_ADDR(*gw, GWADDR0, GWADDR1, GWADDR2, GWADDR3); IP4_ADDR(*netmask, MSKADDR0, MSKADDR1, MSKADDR2, MSKADDR3); # ifdef DHCP_CLIENT *use_dhcp = 1; # else /* not DHCP_CLIENT */ *use_dhcp = 0; printf("Static IP Address is %d.%d.%d.%d\n", ip4_addr1(*ipaddr), ip4_addr2(*ipaddr), ip4_addr3(*ipaddr), ip4_addr4(*ipaddr)); # endif /* not DHCP_CLIENT */ /* Non-standard API: return 1 for success */ return 1; } So, Dynamic IP or static IP? And I'm really understand clearly how to create code from this program. - Altera_Forum
Honored Contributor
It depends on define.
Use# undef DHCP_CLIENT in the beginning of the file for static IP or# define DHCP_CLIENT for DHCP. - Altera_Forum
Honored Contributor
those defines are in a header file, just as I said in my post on top of this page. You can enable or disable DHCP with the DHCP_CLIENT definition, and if you want a static IP, change the defines for IPADDR0..3 in that same header file.
- Altera_Forum
Honored Contributor
Daixiwen!
I had done! I use DHCP for this problem. But How to know IP_address, Mean that, I want to ping "IP_address" from computer on Terminal window and then at the moment the signal relay and display on the Terminal Terminal? How ? - Altera_Forum
Honored Contributor
The Interniche stack says in the console what IP address it is using. Just ping that one.
- Altera_Forum
Honored Contributor
How to ping? You talk too general. I cannot be images!? more clearly? about ping IP?
- Altera_Forum
Honored Contributor
I don't understand what you are saying... You just said you wanted to ping the card from a terminal window. Don't you know how to do that?
The embedded application will say its IP address in the console. You can just recopy it when you type the ping command in the terminal. - Altera_Forum
Honored Contributor
Of course, That's I want to interface between on Board(Development kit) Cyclone III's Ethernet and a the other computer via Cable. And To solve this problem. I must have programmed to create a IP address and then from a computer(is connected with Ethernet via the cable). Then, I open the Terminal(DOS). typing "cmd" command and then "ping" IP_address(this address had programmed) and if the system rely ....... and display on the terminal is ok?????????????????????????
Thanks for your many helping:(