- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
is there a way of changing IP address of the Nios2 without rebooting the whole Nios? Looking through the sources of iniche I can see there is only a alt_iniche_init() procedure, but nothing for shutting it down or re-starting it... So far I have tried something like
tse_mac_close(0);
delete_network_tasks();
netmain();
create_network_tasks();
but instead of closing and reopening the same interface, it "discovers" a 2nd interface
....................................
prep_tse_mac 0
Your Ethernet MAC address is 00:07:35:04:b2:77
Static IP Address is 172.16.100.81
prepped 1 interface, initializing...
....................................
iniche restart triggered...
Deleting network tasks...DONE
InterNiche Portable TCP/IP, v3.1
Copyright 1996-2008 by InterNiche Technologies. All rights reserved.
prep_tse_mac 1
Your Ethernet MAC address is 00:07:35:04:b2:77
Static IP Address is 172.16.100.64
prepped 2 interfaces, initializing...
....................................
Thanks!
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you're looking for ni_set_config(). See net.h and iface.c in the iniche files.
/* FUNCTION: ni_set_config()
*
* set IP address and subnet for a particular device.
*
* PARAM1: NET ifp
* PARAM2: struct niconfig_0 * cfg
*
* RETURNS: 0
*/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, that worked nicely (and seems safer than this solution (http://www.alteraforum.com/forum/showthread.php?t=24101)).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
I'm reviving this thread with a follow-up question: is it possible to change the mac address on the fly in nichestack? I didn't consider this need at start, but yesterday I configured on a system a MAC address (possibly a reserved group) and subsequently was unable to access it via switched network.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- I believe you're looking for ni_set_config(). See net.h and iface.c in the iniche files.
/* FUNCTION: ni_set_config()
*
* set IP address and subnet for a particular device.
*
* PARAM1: NET ifp
* PARAM2: struct niconfig_0 * cfg
*
* RETURNS: 0
*/
--- Quote End --- the proposed solution worked just fine until I realized I need the possibility to change the gateway as well. Are you aware of any such function to allow me that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You probably need to write your own function to do that, as it doesn't look like there is one around already.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page