NetBurner 3.5.0
PDF Version
 
system.h
Go to the documentation of this file.
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
15// The system maintains a configuration record for initialization
16
17#ifndef _SYSTEM_STORAGE_H
18#define _SYSTEM_STORAGE_H
19#include <nettypes.h>
20
21// Exceptions
22#define EXCPT_REBOOT (0) /* Reboot after an exception */
23#define EXCPT_HALT (1) /* Halt after an exception */
24#define EXCPT_QUIET (2) /* Reboot quietly after an exception */
25#define EXCPT_RESET (3) /* Reboot quietly after an exception */
26#define EXCPT_REBOOT_TO_MON (4) /* Reboot to (Alt)monitor after an exception */
27
28// MAC-48 Media Access Control address in bytes (nettypes.h)
29#ifndef MACADDRESS_OCTETS_48
30#define MACADDRESS_OCTETS_48 (6)
31#endif
32
33/*
34 IEEE 802.11 identifier and key parameters
35
36 m_FileName member is used to save service set identity (SSID) and
37 either Wired Equivalent Privacy, Wi-Fi Protected Access (WPA) or WPA2
38 Pre Shared Key (PSK) on platforms that support the interface.
39
40 SSID is restricted to printable ASCII characters, 1 to 32 in length.
41
42 WEP Key is 10 or 26 hexadecimal ASCII characters.
43 WPA(2) PSK is printable ASCII 8 to 63 characters in length.
44
45 The total length of SSID and the key must not exceed 68 characters.
46
47 It is stored as a concatenated null terminate string for example:
48 "SSID:NetBurner,WPA:XJrLy4GbZe1/3wORx5ja4bBC74284OqbhWwVa3+-"
49
50*/
51#define SYSTEM_CONFIG_RECORD_SSID_SIZE_MIN (1)
52#define SYSTEM_CONFIG_RECORD_SSID_SIZE_MAX (32)
53#define SYSTEM_CONFIG_RECORD_SSID_TAG ("SSID:")
54#define SYSTEM_CONFIG_RECORD_SSID_TAG_LENGTH (5)
55
56#define SYSTEM_CONFIC_RECORD_SEPERATOR (",")
57#define SYSTEM_CONFIC_RECORD_SEPERATOR_LENGTH (1)
58
59#define SYSTEM_CONFIG_RECORD_WEP_KEY_SIZE_64 (10)
60#define SYSTEM_CONFIG_RECORD_WEP_KEY_SIZE_104 (26)
61#define SYSTEM_CONFIG_RECORD_WPA_PSK_SIZE_MIN (8)
62#define SYSTEM_CONFIG_RECORD_WPA_PSK_SIZE_MAX (63)
63#define SYSTEM_CONFIG_RECORD_WEP_KEY_TAG ("WEP:")
64#define SYSTEM_CONFIG_RECORD_WPA_PSK_TAG ("WPA:")
65#define SYSTEM_CONFIG_RECORD_WPA2_PSK_TAG ("WP2:")
66#define SYSTEM_CONFIG_RECORD_KEY_TAG_LENGTH (4)
67
68#define SYSTEM_CONFIG_RECORD_M_FILENAME_SIZE (80)
69
70#define SYSTEM_CONFIG_RECORD_SSID_KEY_LENGTH_MAX \
71 (SYSTEM_CONFIG_RECORD_M_FILENAME_SIZE - \
72 (SYSTEM_CONFIG_RECORD_SSID_TAG_LENGTH + SYSTEM_CONFIC_RECORD_SEPERATOR_LENGTH + SYSTEM_CONFIG_RECORD_KEY_TAG_LENGTH + 1))
73
74// These functions replace the system config record with the one that is passed
75// in. It calculates a new checksum, and it ignores the MAC address.
76
77class UDPPacket; // Forward declaration
78extern int (*pLegacyUdp)(UDPPacket &p, int ifn);
79
97int SaveUserParameters(void *pCopyFrom, int len);
98
115
121const char *GetReleaseTag();
122
123// Get starting memory pointer into config record.
124uint8_t *GetConfigRecordStart();
125
126// Get ending config record storage
127uint8_t *GetConfigRecordEnd();
128
129// Erase the config record and fixup any legacy records as required....
130void EraseWholeConfigRecord();
131
132uint32_t GetDefaultBaud();
133uint32_t GetDefaultSerialPort();
134bool ShowBootMessages();
135
136#endif /* _SYSTEM_STORAGE_H */
137
UDP Packet Class.
Definition udp.h:81
void * GetUserParameters(void)
Returns a void pointer to the user parameter area.
int SaveUserParameters(void *pCopyFrom, int len)
Save data to the on-chip flash memory User Parameter area.
const char * GetReleaseTag()
Returns the NNDK release tag information.
NetBurner IPADDR4 Class. See the IPADDR4 Class page for complete documentation.