89const uint32_t PermitFlashFromStorage = (0x80000000);
94class RootParseStateInfo;
95class ConfigNotificationObject;
100 volatile uint32_t bits;
103 void set(
const notify_list & nl)
volatile;
104 void set(
int set_num)
volatile;
105 void clr(
int clr_num)
volatile;
106 notify_list() {bits=0;}
107 notify_list(
const notify_list &l) {bits=l.bits;}
109 uint32_t gethigh()
volatile;
110 inline uint32_t get_high_and_clear()
volatile {uint32_t h = gethigh(); clr(h);
return h;}
111 inline bool AnySet()
volatile const {
return (bits!=0);};
112 inline uint32_t getmask()
volatile {
return bits; };
118typedef void(LeafCallBack)(config_leaf *p,
void *pextra);
128 config_leaf(config_leaf &rhs) =
delete;
131 config_leaf *FindChild(
const char *&cp);
132 void RootParse(RootParseStateInfo &rpsi);
133 static void FixTree(config_leaf* root);
134 static void ClearNonParentRelations(config_leaf* root);
137 virtual void RemoveFromRootList();
139 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly) = 0;
141 inline void FdPrintValTree(
int fd,
int n,
bool pretty, uint32_t inhibit_mask =
fConfigHidden,
bool bRawValue =
false)
143 RawFdPrintTree(fd,n,pretty,inhibit_mask,bRawValue,
true);
145 inline void FdPrintTree(
int fd,
int n,
bool pretty, uint32_t inhibit_mask =
fConfigHidden,
bool bRawValue =
false)
147 RawFdPrintTree(fd,n,pretty,inhibit_mask,bRawValue,
false);
150 virtual void FdPrintSchema(
int fd, config_leaf *pl,
int n,
bool pretty, uint32_t inhibit_mask =
fConfigHidden);
151 void SchemaOptions(
int fd,
int indent,
bool pretty);
152 void ForEachLeaf(LeafCallBack *pc,
void *pextra,
bool siblings =
false);
155 bool ParseBlob(uint8_t *pdata,
int len, uint32_t permissions);
156 bool FlatParseBlob(uint8_t *pdata,
int len, uint32_t permissions);
157 bool ParseFd(
int fd, uint32_t permissions, config_leaf * pParseRoot = NULL);
159 static config_leaf *FindConfigLeaf(
const unsigned char *name, config_leaf *pBranch = NULL);
161 void AddNotification(ConfigNotificationObject & noteobj);
165 void FixNonStaticObject();
167 void RemoveFromConfigTree();
170 const char *pDescription;
171 config_leaf *pNextSibling;
173 config_leaf *pChildren;
175 notify_list NotifyListMask;
178 static config_leaf *pRootList;
179 static config_leaf *pDetachList;
182 void DoSchemaLine(
int fd,
const char *name,
const char *value,
int indent,
bool pretty,
bool quoted =
true);
183 void DoSchemaLine(
int fd,
const char *name,
int value,
int indent,
bool pretty,
bool quoted =
true);
184 void DoSchemaLine(
int fd,
const char *name,
double value,
int indent,
bool pretty,
bool quoted =
true);
187 bool NameMatch(
const char *cp);
188 virtual const char *GetSortNameValue() {
return pName; };
189 virtual void GetDescriptionValue(
NBString &s) { s = pDescription; };
190 virtual void GetNameValue(
NBString &s) { s = pName; };
191 virtual void GetTextValue(
NBString &s) { s = pName; };
192 virtual void GetRawValue(
NBString &s) {
return GetTextValue(s); };
193 virtual void GetTypeValue(
NBString &s) { s =
"unknown"; };
194 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty){};
198 virtual int Missing_ConfigEndMarker(
void *&startp) = 0;
200 void ClearModified();
204 virtual bool CheckGroupValues() {
return true;}
205 virtual void CommitTestedValue(uint32_t permission_mask){};
207 virtual ~config_leaf();
209 config_leaf(
bool bDetached=
false)
227 config_leaf(config_leaf &&l);
229 static void DiagShow();
230 static void FixTree();
231 void FindUnknownParent();
235 int compare(config_leaf *pl)
237 if (pl == NULL)
return -1;
238 return strcmp(GetSortNameValue(), pl->GetSortNameValue());
242 void GetBranchName(
NBString &s, config_leaf *branchRoot);
243 void RenderToFd(
int fd,
bool pretty =
false, uint32_t mask =
fConfigHidden,
bool bRawValue =
false);
244 void RenderSchemaToFd(
int fd,
bool pretty =
false, uint32_t mask =
fConfigHidden);
245 uint32_t GetFlags() {
return m_Flags; }
246 uint32_t GetFlags(uint32_t mask) {
return m_Flags & mask; }
247 void SetFlag(uint32_t flag) { m_Flags |= flag; };
248 void SetBranchFlag(uint32_t flag,
bool upNotDown =
false);
249 void ClrFlag(uint32_t flag) { m_Flags &= (~flag); };
250 void ClrBranchFlag(uint32_t flag,
bool upNotDown =
false);
251 void ReloadFromFlash();
252 void AssignmentNotify();
255 inline void LogParseError(
const char * err) {
NBString s(err); LogParseError(s); };
258 friend void HtmlLeafRender(
int fd, config_leaf *pl,
int eMode,
int len,
const char *extra);
259 friend ConfigNotificationObject;
325 config_obj(
bool bDetached=
false):config_leaf(bDetached){}
329 virtual void RemoveFromRootList();
331 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
332 void InstallUnderMe(config_leaf <oadd);
333 void RemoveFromChildren(config_leaf <oremove);
352 pMasterObjectLink = pObjList;
376 pMasterObjectLink = pObjList;
382 bool DoIContain(config_leaf *pl);
400 virtual void CommitTestedValue(uint32_t permission_mask)
override;
403 virtual int Missing_ConfigEndMarker(
void *&startp)
override
406 return sizeof(*this);
427 friend class config_leaf;
438 pDescription =
"Root of config tree";
442 virtual int Missing_ConfigEndMarker(
void *&startp)
override
445 return sizeof(*this);
453 { pName =
"detached";
454 pDescription =
"Root of detached tree";
458 virtual int Missing_ConfigEndMarker(
void *&startp)
override
461 return sizeof(*this);
469extern detached_root_obj detached;
495 virtual void GetTextValue(
NBString &s)
override = 0;
514 owner.InstallUnderMe(*
this);
541 virtual int FdPrintValue(
int fd,
bool raw);
544 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
560 virtual int FdPrintValue(
int fd,
bool raw)
override;
601 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
616 operator uint32_t()
const {
return val; };
638 pend_val = val = ci.val;
645 virtual int Missing_ConfigEndMarker(
void *&startp)
override
648 return sizeof(*this);
667 virtual int FdPrintValue(
int fd,
bool raw)
override;
677 config_hex_uint(
config_obj &owner, uint32_t def_val,
const char *name,
const char *desc = NULL) :
config_uint(owner,def_val, name, desc){}
686 config_hex_uint(uint32_t def_val,
const char *name,
const char *desc = NULL) :
config_uint(def_val,name, desc){}
688 virtual void GetTextValue(
NBString &s)
override { s.siprintf(
"\"0x%X\"", val); };
689 virtual void GetTypeValue(
NBString &s)
override { s =
"string"; };
708 virtual int FdPrintValue(
int fd,
bool raw)
override;
750 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
765 operator int()
const {
return val; };
788 pend_val = val = ci.val;
795 virtual int Missing_ConfigEndMarker(
void *&startp)
override
798 return sizeof(*this);
824 virtual int FdPrintValue(
int fd,
bool raw)
override;
865 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
880 operator int()
const {
return val; };
893 operator float()
const {
return val; };
906 operator double()
const {
return val; };
928 pend_val = val = ci.val;
935 virtual int Missing_ConfigEndMarker(
void *&startp)
override
938 return sizeof(*this);
961 virtual int FdPrintValue(
int fd,
bool raw)
override;
963 config_report(
config_obj &owner,
const char *value,
const char *name,
const char *desc = NULL) :
config_value(owner, name, desc)
968 config_report(
const char *value,
const char *name,
const char *desc = NULL) :
config_value(name, desc)
974 config_report(config_report &&r);
976 virtual void GetTextValue(
NBString &s)
override;
978 virtual void CommitTestedValue(uint32_t permission_mask)
override;
981 virtual int Missing_ConfigEndMarker(
void *&startp)
override
984 return sizeof(*this);
986 virtual void GetTypeValue(
NBString &s)
override { s =
"string"; };
988 const char *c_str() {
return m_value; };
989 void ModifyValue(
const char *nv) { m_value = nv; };
1005 virtual int FdPrintValue(
int fd,
bool raw)
override;
1051 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1066 operator bool()
const {
return val; };
1088 pend_val = val = cb.val;
1101 pend_val = val = (i != 0);
1108 virtual int Missing_ConfigEndMarker(
void *&startp)
1111 return sizeof(*this);
1136 virtual int FdPrintValue(
int fd,
bool raw)
override;
1154 const char * GetPendValue() {
return pend_val.
c_str();};
1220 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1272 pend_val = val = ci.val;
1279 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1282 return sizeof(*this);
1306 inline const char &
operator[](
size_t pos)
const {
return val[pos]; };
1317 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty);
1350 virtual int FdPrintValue(
int fd,
bool raw)
override;
1420 virtual void CommitTestedValue(uint32_t permission_mask)
override;
1423 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
1425 config_string::ExtendedSchema(fd, indent, pretty);
1426 DoSchemaLine(fd,
"format",
"password", indent, pretty);
1469 pend_val = val = ci.val;
1482 pend_val = val = ci.val;
1507 virtual int FdPrintValue(
int fd,
bool raw)
override;
1588 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1635 pend_val = val = i4;
1648 pend_val = val = ci.val;
1655 virtual int Missing_ConfigEndMarker(
void *&startp)
1658 return sizeof(*this);
1671 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv4", indent, pretty); };
1690 virtual int FdPrintValue(
int fd,
bool raw)
override;
1770 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1813 pend_val = val = i6;
1826 pend_val = val = ci.val;
1833 virtual int Missing_ConfigEndMarker(
void *&startp)
1836 return sizeof(*this);
1849 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv6", indent, pretty); };
1852#define config_IPADDR config_IPADDR4
1868 virtual int FdPrintValue(
int fd,
bool raw)
override;
1880 s.siprintf(
"\"%02X:%02X:%02X:%02X:%02X:%02X\"", val.phywadr[0] >> 8, val.phywadr[0] & 0xFF, val.phywadr[1] >> 8,
1881 val.phywadr[1] & 0xFF, val.phywadr[2] >> 8, val.phywadr[2] & 0xFF);
1971 pend_val = val = ci.val;
1984 pend_val = val = ci;
1990 MACADR operator+(uint32_t rhs)
1991 {
return val + rhs; }
1993 MACADR operator-(uint32_t rhs)
1994 {
return val - rhs; }
1997 virtual int Missing_ConfigEndMarker(
void *&startp)
2000 return sizeof(*this);
2004 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
2017#define ConfigEndMarker \
2018 virtual int Missing_ConfigEndMarker(void *&startp) override \
2021 return sizeof(*this); \
2058 choices = in_choices;
2065 const char * GetPendValue() {
return value.pend_val.
c_str();};
2079 choices = in_choices;
2092 bool IsSelected(
const char *choice) {
return (choice == value); };
2119 const char *sChoices = choices.
c_str();
2120 size_t listLen = choices.
length();
2123 if (str ==
nullptr) {
return false; }
2124 if (listLen == 0) {
return false; }
2126 while (index < listLen)
2128 size_t curVarStart = index;
2129 size_t curVarLength;
2132 while (sChoices[index] != 0 && sChoices[index] !=
',')
2137 curVarLength = index - curVarStart;
2139 if (strncmp(str, &sChoices[curVarStart], (curVarLength > strLen) ? curVarLength : strLen) == 0)
2164 const char *sStr = str.c_str();
2165 const char *sChoices = choices.
c_str();
2166 size_t length = choices.
length();
2169 if (sStr ==
nullptr) {
return false; }
2170 if (length == 0) {
return false; }
2172 while (index < length)
2174 size_t curVarStart = index;
2175 size_t curVarLength;
2178 while (sChoices[index] != 0 && sChoices[index] !=
',')
2183 curVarLength = index - curVarStart;
2185 if (strncmp(sStr, &sChoices[curVarStart], curVarLength > strLen ? curVarLength : strLen) == 0)
2211 choices = in_choices;
2225 choices = in_choices;
2318 config_int_limit(
int def_val,
int minv=INT_MIN,
int maxv=INT_MAX,
const char *name = NULL,
const char *desc = NULL) :
config_int(def_val,name, desc)
2325 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2329 if(i>=min_val && max_val<=i)
2347 if((test_v>=min_val) && (test_v<=max_val))
2349 pend_val = val = test_v;
2365 if((test_v>=min_val) && (test_v<=max_val))
2367 pend_val = val = test_v;
2413 config_uint_limit(uint32_t def_val, uint32_t minv=0,uint32_t maxv=UINT_MAX,
const char *name = NULL,
const char *desc = NULL) :
config_uint(def_val,name, desc)
2420 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2424 if(i>=min_val && max_val<=i)
2442 if((test_v>=min_val) && (test_v<=max_val))
2444 pend_val = val = test_v;
2459 uint32_t test_v=cil;
2460 if((test_v>=min_val) && (test_v<=max_val))
2462 pend_val = val = test_v;
2514 config_double_limit(
double def_val,
double minv=-DBL_MAX,
double maxv=DBL_MAX,
double stepv=0.01,
const char *name = NULL,
const char *desc = NULL) :
config_double(def_val,name, desc)
2522 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2526 if(i>=min_val && max_val<=i)
2544 if((test_v>=min_val) && (test_v<=max_val))
2546 pend_val = val = test_v;
2562 if((test_v>=min_val) && (test_v<=max_val))
2564 pend_val = val = test_v;
2626 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2648 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2650 pend_val = val = test_v;
2666 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2668 pend_val = val = test_v;
2721 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2743 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2745 pend_val = val = test_v;
2761 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2763 pend_val = val = test_v;
2774 virtual const char *GetSortNameValue() {
return "ZZZc"; };
2777 reboot_obj() :
config_bool(root, false,
"Reboot",
"Cause system reboot on save"){};
2785 virtual int Missing_ConfigEndMarker(
void *&startp)
2788 return sizeof(*this);
2795 virtual const char *GetSortNameValue() {
return "ZZZb"; };
2798 version_obj() :
config_int(root, 0,
"Version",
"Version serial number") { bNeverSet =
true; };
2808 virtual int Missing_ConfigEndMarker(
void *&startp)
2811 return sizeof(*this);
2820 empty_config_obj(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2821 empty_config_obj(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2822 empty_config_obj(empty_config_obj &&e);
2837class config_preserver_obj :
public config_obj
2844 config_preserver_obj(
const char *name,
const char *desc = NULL);
2845 config_preserver_obj(
config_obj &owner,
const char *name,
const char *desc = NULL);
2846 config_preserver_obj(config_preserver_obj &&po);
2850 virtual void CommitTestedValue(uint32_t permission_mask)
override;
2851 virtual void GetTextValue(
NBString &s)
override;
2852 virtual void GetRawValue(
NBString &s)
override;
2856extern const char PlatformName[];
2861 config_report system_platform{PlatformName,
"Platform",
"Hardware Platform"};
2862 config_report system_app{
AppName,
"Application",
"Application name"};
2865 SysRecord(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2866 SysRecord(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2867 SysRecord(SysRecord &&sr);
2870extern SysRecord sys;
2871extern empty_config_obj netif;
2873extern reboot_obj rebooter;
2874extern version_obj config_cur_version;
2876extern const int plat_def_baud;
2877extern const int plat_def_delay;
2878extern const int plat_def_quiet;
2879extern const int plat_def_watchdog_enabled;
2881#include <plat_cfg_types.h>
2882#ifdef PRESERVE_APP_DATA
2883extern config_preserver_obj appdata;
2885extern empty_config_obj appdata;
2898 config_uart Uart{plat_def_com,
"BootUart"};
2899 config_int BootDelay{plat_def_delay,
"BootDelay"};
2901 config_chooser sercfg_action{
"SerialConfig",
"DuringBoot",
"DuringBoot,AlwaysEnabled,PauseAfterBoot,Disabled"};
2907 MonitorRecord(
const char *name) :
config_obj(name,
"Boot monitor record")
2913 MonitorRecord(
config_obj &owner,
const char *name) :
config_obj(owner, name,
"Boot Monitor Record")
2919 MonitorRecord(MonitorRecord &&mr);
2921extern MonitorRecord monitor_config;
Definition config_netobj.h:302
Used to store and manipulate IPv4 addresses in dual stack mode.
Definition nettypes.h:225
bool IsNull() const
Check if the IP address is null.
Definition nettypes.h:279
void SetFromAscii(const char *cp)
Set the IPv4 address from a character string.
void SetNull()
Set the IP address to null.
Definition nettypes.h:295
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
void SetFromAscii(const char *cp, bool bembed_v4addresses=true)
Set the IP address value of an IPADDR6 object.
void SetNull()
Set the IP address value of an IPADDR6 object to null.
Definition ipv6_addr.h:320
bool IsNull() const
Check if the IP address is null.
Definition ipv6_addr.h:133
Used to store and manipulate MAC addresses.
Definition nettypes.h:69
Lightweight alternative to C++ CString class.
Definition nbstring.h:118
const char * c_str() const
Method to pass a NBString as a constant char *.
bool Interpolate(NBString &dest)
Perform a string interpolation and place the finished interpolation in the Destination string....
size_t length() const
Returns the length of the string.
A class to create, read, and modify a JSON object.
Definition json_lexer.h:535
Configuration Variable for IPADDR4 (IPv4) object types.
Definition config_obj.h:1500
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1615
config_IPADDR4(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1579
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1668
config_IPADDR4(config_obj &owner, const char *def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1562
config_IPADDR4(IPADDR4 def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1544
virtual void GetTextValue(NBString &s) override
Get the object value as a text string with quotations to the specified NBString object.
Definition config_obj.h:1517
config_IPADDR4(config_obj &owner, IPADDR4 def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1529
config_IPADDR4 & operator=(const config_IPADDR4 &ci)
Copy one config_IPADDR4 object to another.
Definition config_obj.h:1646
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1606
void SetNull()
Set the IP address to null.
Definition config_obj.h:1622
config_IPADDR4 & operator=(const IPADDR4 &i4)
Copy an IPADDR4 object value to a config_IPADDR4 object.
Definition config_obj.h:1633
Configuration Variable for IPADDR (IPv6) object type.
Definition config_obj.h:1685
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1846
config_IPADDR & operator=(const config_IPADDR &ci)
Copy one config_IPADDR object to another.
Definition config_obj.h:1824
config_IPADDR & operator=(const IPADDR &i6)
Copy an IPADDR object value to a config_IPADDR object.
Definition config_obj.h:1811
config_IPADDR(config_obj &owner, const char *def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1744
config_IPADDR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1761
void SetNull()
Set the IP address value of an config_IPADDR object to null.
Definition config_obj.h:1800
config_IPADDR(config_obj &owner, IPADDR def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1711
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1795
config_IPADDR(IPADDR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1728
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1786
virtual void GetTextValue(NBString &s) override
Get the object value as a text string with quotations to the specified NBString object.
Definition config_obj.h:1699
Configuration Variable for MACADR object type.
Definition config_obj.h:1863
config_MACADR(config_obj &owner, MACADR def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1894
config_MACADR & operator=(const MACADR &ci)
Copy a MACADR object value to a MACADR object.
Definition config_obj.h:1982
config_MACADR(MACADR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1911
config_MACADR & operator=(const config_MACADR &ci)
Copy one config_MACADR object to another.
Definition config_obj.h:1969
config_MACADR(config_obj &owner, const char *def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1928
virtual void GetTextValue(NBString &s) override
Get the object value as a text string with quotations to the specified NBString object.
Definition config_obj.h:1878
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:2013
config_MACADR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1947
Boolean Configuration Variable.
Definition config_obj.h:1000
config_bool(bool def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1043
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1119
config_bool & operator=(const config_bool &cb)
Copy one config_bool object to another.
Definition config_obj.h:1086
config_bool & operator=(const int i)
Assign a config_bool object value to the specified integer value.
Definition config_obj.h:1099
config_bool & operator=(const bool v)
Assign the config_bool object value to the specified bool value.
Definition config_obj.h:1073
virtual void GetTextValue(NBString &s) override
Copy the object value as a text string to the specified NBString object.
Definition config_obj.h:1014
config_bool(config_obj &owner, bool def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1030
Chooser Configuration Variable - Select From a List of Items.
Definition config_obj.h:2037
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:2278
const config_string & GetChoices()
Get the list of choices.
Definition config_obj.h:2200
const config_string & SetChoices(const char *in_choices)
Set the list of choices.
Definition config_obj.h:2209
bool IsSelected(const char *choice)
Check if a particular choice option is selected.
Definition config_obj.h:2092
config_chooser & operator=(const char *p)
Assign the selected list item from a const char* value.
Definition config_obj.h:2244
bool IsSelected(const NBString &s)
Check if a particular choice option is selected.
Definition config_obj.h:2102
config_chooser & operator=(const config_chooser &ci)
Copy one config_chooser object to another.
Definition config_obj.h:2270
config_chooser(const char *name, const char *in_value, const char *in_choices, const char *desc=NULL)
Object constructor.
Definition config_obj.h:2076
bool IsInChoices(const char *str, size_t strLen)
Check if a string is in the list of possible choices. A comparison will continue until a null charact...
Definition config_obj.h:2117
config_chooser(config_obj &owner, const char *name, const char *in_value, const char *in_choices, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:2054
bool IsInChoices(const NBString &str, size_t strLen)
Check if a string is in the list of possible choices. A comparison will continue until a null charact...
Definition config_obj.h:2162
config_chooser & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:2257
A config_double with minimum and/or maximum values Attempting to set a value lower than the minimum o...
Definition config_obj.h:2479
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:2579
config_double_limit & operator=(const config_double_limit &cil)
Copy one config_double_limit object to another.
Definition config_obj.h:2559
config_double_limit(double def_val, double minv=-DBL_MAX, double maxv=DBL_MAX, double stepv=0.01, const char *name=NULL, const char *desc=NULL)
Object constructor with limits.
Definition config_obj.h:2514
config_double_limit & operator=(const config_double &ci)
Copy a config_double object into the config_double_limit.
Definition config_obj.h:2541
config_double_limit(config_obj &owner, double def_val, double minv=-DBL_MAX, double maxv=DBL_MAX, double stepv=0.01, const char *name=NULL, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter and limits.
Definition config_obj.h:2497
Double Float Configuration Variable.
Definition config_obj.h:819
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:950
virtual void GetTextValue(NBString &s) override
Copy the object value as a text string to the specified NBString object.
Definition config_obj.h:833
config_double(config_obj &owner, double def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:843
config_double(double def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:856
config_double & operator=(const double d)
Assign the config_double object value from a double value.
Definition config_obj.h:913
config_double & operator=(const config_double &ci)
Copy one config_double object to another.
Definition config_obj.h:926
A config_int with minimum and/or maximum values Attempting to set a value lower than the minimum or g...
Definition config_obj.h:2287
config_int_limit & operator=(const config_int &ci)
Copy a config_int object into the config_int_limit.
Definition config_obj.h:2344
config_int_limit(int def_val, int minv=INT_MIN, int maxv=INT_MAX, const char *name=NULL, const char *desc=NULL)
Object constructor with limits.
Definition config_obj.h:2318
config_int_limit & operator=(const config_int_limit &cil)
Copy one config_int_limit object to another.
Definition config_obj.h:2362
config_int_limit(config_obj &owner, int def_val, int minv=INT_MIN, int maxv=INT_MAX, const char *name=NULL, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter and limits.
Definition config_obj.h:2303
Signed 32-bit Integer Configuration Variable.
Definition config_obj.h:703
config_int & operator=(const int i)
Assign the config_int object value to the specified int value.
Definition config_obj.h:772
config_int(config_obj &owner, int def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:727
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:808
virtual void GetTextValue(NBString &s) override
Copy the object value to the specified NBString object.
Definition config_obj.h:717
config_int(int def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:740
config_int & operator=(const config_int &ci)
Copy one config_int object to another.
Definition config_obj.h:786
Configure device network name.
Definition config_netobj.h:26
Base class used to create configuration objects.
Definition config_obj.h:323
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:425
config_obj(const char *name, const char *desc)
Object constructor.
Definition config_obj.h:370
virtual void GetTextValue(NBString &s) override
Get the object value as a text string to the specified NBString object.
config_obj(config_obj &owner, const char *name, const char *desc)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:347
A config_pass with minimum and/or maximum lengths Attempting to set a value shorter than the minimum ...
Definition config_obj.h:2683
config_pass_limit & operator=(const config_pass_limit &cil)
Copy one config_pass_limit object to another.
Definition config_obj.h:2758
config_pass_limit(config_obj &owner, NBString def_val, size_t minl=0, size_t maxl=0, const char *name=NULL, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter and limits.
Definition config_obj.h:2699
config_pass_limit(NBString def_val, size_t minl=0, size_t maxl=0, const char *name=NULL, const char *desc=NULL)
Object constructor with limits.
Definition config_obj.h:2714
config_pass_limit & operator=(const config_pass &ci)
Copy a config_pass object into the config_pass_limit.
Definition config_obj.h:2740
Password string Configuration Variable.
Definition config_obj.h:1348
config_pass(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1398
config_pass & operator=(const config_string &ci)
Copy a config_string object to a config_pass object.
Definition config_obj.h:1467
config_pass & operator=(const char *p)
Assign the config_pass object value from a const char* value.
Definition config_obj.h:1441
config_pass & operator=(const NBString &s)
Assign the config_pass object value from a NBString object.
Definition config_obj.h:1454
config_pass(NBString def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1374
virtual void GetRawValue(NBString &s) override
Copy the raw config_string object value to the NBString object.
config_pass(config_obj &owner, const char *def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1386
virtual void GetTextValue(NBString &s) override
Get the config_pass object value as a text string.
config_pass & operator=(const config_pass &ci)
Copy one config_pass object to another.
Definition config_obj.h:1480
config_pass(config_obj &owner, NBString def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1362
A config_string with minimum and/or maximum lengths Attempting to set a value shorter than the minimu...
Definition config_obj.h:2588
config_string_limit(NBString def_val, size_t minl=0, size_t maxl=0, const char *name=NULL, const char *desc=NULL)
Object constructor with limits.
Definition config_obj.h:2619
config_string_limit(config_obj &owner, NBString def_val, size_t minl=0, size_t maxl=0, const char *name=NULL, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter and limits.
Definition config_obj.h:2604
config_string_limit & operator=(const config_string &ci)
Copy a config_string object into the config_string_limit.
Definition config_obj.h:2645
config_string_limit & operator=(const config_string_limit &cil)
Copy one config_string_limit object to another.
Definition config_obj.h:2663
String Configuration Variable.
Definition config_obj.h:1130
const char * c_str() const
Returns the object value as a string.
Definition config_obj.h:1290
virtual void GetTextValue(NBString &s) override
Get the object value (as a text string with quotations) to the specified NBString object.
config_string(config_obj &owner, NBString def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1166
const char & operator[](size_t pos) const
Return the value of a character in the string.
Definition config_obj.h:1306
config_string & operator=(const char *p)
Assign the config_string object value from a const char* string.
Definition config_obj.h:1244
config_string(config_obj &owner, const char *def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:1198
config_string & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:1257
void SetEnumList(NBString s)
Renders the data used to explain the schema/descriptions for the list of choices.
Definition config_obj.h:1228
config_string(NBString def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1181
config_string & operator=(const config_string &ci)
Copy one config_string object to another.
Definition config_obj.h:1270
config_string(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1213
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1315
size_t length() const
Returns the string length in bytes.
Definition config_obj.h:1297
A config_uint with minimum and/or maximum values Attempting to set a value lower than the minimum or ...
Definition config_obj.h:2382
config_uint_limit(uint32_t def_val, uint32_t minv=0, uint32_t maxv=UINT_MAX, const char *name=NULL, const char *desc=NULL)
Object constructor with limits.
Definition config_obj.h:2413
config_uint_limit & operator=(const config_uint_limit &cil)
Copy one config_uint_limit object to another.
Definition config_obj.h:2457
config_uint_limit & operator=(const config_uint &ci)
Copy a config_uint object into the config_uint_limit.
Definition config_obj.h:2439
config_uint_limit(config_obj &owner, uint32_t def_val, uint32_t minv=0, uint32_t maxv=UINT_MAX, const char *name=NULL, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter and limits.
Definition config_obj.h:2398
Unsigned 32-bit Integer Configuration Variable.
Definition config_obj.h:555
config_uint(uint32_t def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:592
config_uint(config_obj &owner, uint32_t def_val, const char *name, const char *desc=NULL)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:579
config_uint & operator=(const uint32_t i)
Assign the config_uint object value from a uint32_t value.
Definition config_obj.h:623
virtual void GetTextValue(NBString &s) override
Copy the object value to the specified NBString object.
Definition config_obj.h:569
config_uint & operator=(const config_uint &ci)
Copy one config_uint object to another.
Definition config_obj.h:636
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:658
Base class used to create a configuration value.
Definition config_obj.h:493
config_value(config_obj &owner, const char *name, const char *desc)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:510
config_value(const char *name, const char *desc)
Object constructor.
Definition config_obj.h:531
FIFO buffer storage using linked pool buffers.
Definition buffers.h:443
MACADR AsciiToMac(const char *p)
Convert an ASCII MAC address string to a MAC address.
const uint32_t fConfigModified
Variable has been modified, but not yet saved.
Definition config_obj.h:77
const uint32_t fConfigNeedReboot
System reboot required for changes to take effect.
Definition config_obj.h:81
const uint32_t fConfigNoObscure
Do not obscure the value.
Definition config_obj.h:80
const uint32_t fConfigValueLeaf
Value is a leaf.
Definition config_obj.h:75
const uint32_t fMaskDoingSave
We're currently executing a config save to non-volatile storage.
Definition config_obj.h:85
const uint32_t fConfigHidden
Not visible to configuration web server display.
Definition config_obj.h:78
const uint32_t fConfigNoSave
Do not save to flash memory when save functions are called.
Definition config_obj.h:79
const uint32_t fConfigNoReload
Disable reloading value from flash during a call to ReloadFromFlash.
Definition config_obj.h:82
const uint32_t fConfigDetached
Disable reloading value from flash during a call to ReloadFromFlash.
Definition config_obj.h:83
const uint32_t fConfigIsDefault
Value is unchanged from the default, i.e. wes never set.
Definition config_obj.h:84
const uint32_t fConfigReadOnly
Variable is read-only.
Definition config_obj.h:76
void OverrideConfig()
Create this function to override config settings.
void SaveConfigToStorage()
Save configuration to flash storage.
const char * AppName
EFFS Multiple Partitions Example.
Definition aes/src/main.cpp:10
IPADDR6 IPADDR
IPADDR Object Type (either v4 or v6)
Definition nettypes.h:568
class MACADR MACADR
Used to store and manipulate MAC addresses.