Network Configuration
[Nut/Net API]

Collaboration diagram for Network Configuration:

Detailed Description

Nut/Nut configuration structure.


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.


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.

Definition at line 86 of file confnet.h.

Referenced by NutNetLoadConfig(), and NutNetSaveConfig().

#define CONFNET_MAX_IF   1

Definition at line 90 of file confnet.h.


Typedef Documentation

typedef struct _CONFNET CONFNET

Network configuration type.

Definition at line 96 of file confnet.h.


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 Ethernet broadcast address.

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

Definition at line 99 of file confnet.c.

References _CONFNET::cd_name, _CONFNET::cd_size, _CONFNET::cdn_mac, CONFNET_EE_OFFSET, memset(), NutNvMemLoad(), and strcmp().

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

int NutNetSaveConfig ( void   ) 

Save network configuration in non-volatile memory.

Returns:
0 if OK, -1 on failures.

Definition at line 126 of file confnet.c.

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

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


Variable Documentation

Global network configuration structure.

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

Examples:
ftpd/ftpserv.c, httpd/httpserv.c, inetq/inetq.c, logtime/logtime.c, and tcps/tcps.c.

Definition at line 85 of file confnet.c.

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

Global network configuration structure.

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

Definition at line 85 of file confnet.c.

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


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/