Nut/OS  5.0.5
API Reference
Network Configuration

Nut/Nut configuration structure. More...

Collaboration diagram for Network Configuration:

Data Structures

struct  _CONFNET
 Network configuration structure. More...

Defines

#define CONFNET_EE_OFFSET   64
 Non-volatile memory location.
#define CONFNET_MAX_IF   1

Typedefs

typedef struct _CONFNET CONFNET
 Network configuration type.

Functions

int NutNetLoadConfig (const char *name)
 Load network configuration from non-volatile memory.
int NutNetSaveConfig (void)
 Save network configuration in non-volatile memory.

Variables

CONFNET confnet
 Global network configuration structure.
CONFNET confnet
 Global network configuration structure.

Detailed Description

Nut/Nut configuration structure.


Define Documentation

#define CONFNET_EE_OFFSET   64

Non-volatile memory location.

Offset into non-volatile memory, where Nut/Net stores the network configuration. The default may be overridden by the Configurator.

Referenced by NutNetLoadConfig(), and NutNetSaveConfig().

#define CONFNET_MAX_IF   1

Typedef Documentation

typedef struct _CONFNET CONFNET

Network configuration type.


Function Documentation

int NutNetLoadConfig ( const char *  name)

Load network configuration from non-volatile memory.

If no configuration is available in EEPROM, all configuration parameters are cleared to zero. Except the MAC address, which is set to the locally administered address 02-00-00-00-00-00.

Parameters:
nameName of the device.
Returns:
0 if configuration has been read. Otherwise the return value is -1.

References _CONFNET::cd_name, _CONFNET::cd_size, _CONFNET::cdn_cip_addr, _CONFNET::cdn_gateway, _CONFNET::cdn_ip_mask, _CONFNET::cdn_mac, CONFNET_EE_OFFSET, inet_addr(), memcpy(), memset(), NutNvMemLoad(), strcmp(), VIRGIN_MAC, and VIRGIN_NETMASK.

Referenced by cs8900Init(), CSNicInit(), main(), NicInit(), and NutDhcpIfConfig().

Here is the call graph for this function:

int NutNetSaveConfig ( void  )

Save network configuration in non-volatile memory.

Returns:
0 if OK, -1 on failures.

References _CONFNET::cd_size, CONFNET_EE_OFFSET, and NutNvMemSave().

Referenced by main(), NutDiscoveryAppConf(), and NutNetIfSetup().

Here is the call graph for this function:


Variable Documentation

Global network configuration structure.

Contains the current network configuration. Nut/Net will load this structure from non-volatile memory during initialization.

Examples:
editconf/editconf.c, ftpd/ftpserv.c, httpd/httpserv.c, httpd_simple/httpd_simple.c, httpd_upnp/httpserv.c, inetq/inetq.c, logtime/logtime.c, pingnet/pingnet.c, and tcps/tcps.c.

Referenced by AsixInit(), cs8900Init(), CSNicInit(), DiscoveryResponder(), main(), NicInit(), NutDhcpClient(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutNetIfSetup(), and syslog_header().

Global network configuration structure.

Contains the current network configuration. Nut/Net will load this structure from non-volatile memory during initialization.

Referenced by AsixInit(), cs8900Init(), CSNicInit(), DiscoveryResponder(), main(), NicInit(), NutDhcpClient(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutNetIfSetup(), and syslog_header().