Nut/OS  4.10.3
API Reference
_CONFNET Struct Reference

Network configuration structure. More...

#include <sys/confnet.h>

Collaboration diagram for _CONFNET:

Data Fields

uint8_t cd_size
 Size of this structure.
char cd_name [9]
 Magic cookie.
uint8_t cdn_mac [6]
 Ethernet MAC address.
uint32_t cdn_ip_addr
 Last used IP address.
uint32_t cdn_ip_mask
 IP netmask.
uint32_t cdn_gateway
 Default route.
uint32_t cdn_cip_addr
 Configured IP address.

Detailed Description

Network configuration structure.

Applications may directly access the global variable confnet to read or modify the current network configuration.

Definition at line 108 of file confnet.h.


Field Documentation

Size of this structure.

Used by Nut/Net to verify, that the structure contents is valid after reading it from non-volatile memory.

Definition at line 114 of file confnet.h.

Referenced by AsixInit(), cs8900Init(), CSNicInit(), NicInit(), NutNetLoadConfig(), and NutNetSaveConfig().

Magic cookie.

Contains the device name of the network interface.

Examples:
editconf/editconf.c.

Definition at line 120 of file confnet.h.

Referenced by AsixInit(), main(), NutNetIfSetup(), and NutNetLoadConfig().

Ethernet MAC address.

Unique Ethernet address of the network interface.

Examples:
editconf/editconf.c.

Definition at line 126 of file confnet.h.

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

Last used IP address.

Each time Nut/Net receives an IP address during boot, it will store the address in here.

If no fixed IP address has been configured (cdn_cip_addr contains 0.0.0.0) and if no DHCP server is available, then Nut/Net will use this one, if it is not 0.0.0.0.

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

Definition at line 137 of file confnet.h.

Referenced by DiscoveryResponder(), main(), NutDhcpClient(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutNetIfSetup(), and syslog_header().

IP netmask.

The netmask is used to determine which machines are available in the local network.

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

Definition at line 144 of file confnet.h.

Referenced by DiscoveryResponder(), main(), NutDhcpClient(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutNetIfSetup(), and NutNetLoadConfig().

Default route.

Nut/Net will redirect IP packets to this node, if the target IP is not located in the local network.

Examples:
editconf/editconf.c, and logtime/logtime.c.

Definition at line 151 of file confnet.h.

Referenced by main(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutNetIfSetup(), and NutNetLoadConfig().

Configured IP address.

If this address is set to 0.0.0.0, Nut/Net will try to obtain one from the DHCP server.

Examples:
editconf/editconf.c, and tcps/tcps.c.

Definition at line 158 of file confnet.h.

Referenced by main(), NutDhcpIfConfig(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), NutNetLoadConfig(), and syslog_header().


The documentation for this struct was generated from the following file: