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;
130 config_leaf *FindChild(
const char *&cp);
131 void RootParse(RootParseStateInfo &rpsi);
132 static void FixTree(config_leaf* root);
135 virtual void RemoveFromRootList();
137 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly) = 0;
139 inline void FdPrintValTree(
int fd,
int n,
bool pretty, uint32_t inhibit_mask =
fConfigHidden,
bool bRawValue =
false)
141 RawFdPrintTree(fd,n,pretty,inhibit_mask,bRawValue,
true);
143 inline void FdPrintTree(
int fd,
int n,
bool pretty, uint32_t inhibit_mask =
fConfigHidden,
bool bRawValue =
false)
145 RawFdPrintTree(fd,n,pretty,inhibit_mask,bRawValue,
false);
148 virtual void FdPrintSchema(
int fd, config_leaf *pl,
int n,
bool pretty, uint32_t inhibit_mask =
fConfigHidden);
149 void SchemaOptions(
int fd,
int indent,
bool pretty);
150 void ForEachLeaf(LeafCallBack *pc,
void *pextra,
bool siblings =
false);
153 bool ParseBlob(uint8_t *pdata,
int len, uint32_t permissions);
154 bool FlatParseBlob(uint8_t *pdata,
int len, uint32_t permissions);
155 bool ParseFd(
int fd, uint32_t permissions, config_leaf * pParseRoot = NULL);
157 static config_leaf *FindConfigLeaf(
const unsigned char *name, config_leaf *pBranch = NULL);
159 void AddNotification(ConfigNotificationObject & noteobj);
163 void FixNonStaticObject();
165 void RemoveFromConfigTree();
168 const char *pDescription;
169 config_leaf *pNextSibling;
171 config_leaf *pChildren;
173 notify_list NotifyListMask;
176 static config_leaf *pRootList;
177 static config_leaf *pDetachList;
180 void DoSchemaLine(
int fd,
const char *name,
const char *value,
int indent,
bool pretty,
bool quoted =
true);
181 void DoSchemaLine(
int fd,
const char *name,
int value,
int indent,
bool pretty,
bool quoted =
true);
182 void DoSchemaLine(
int fd,
const char *name,
double value,
int indent,
bool pretty,
bool quoted =
true);
185 bool NameMatch(
const char *cp);
186 virtual const char *GetSortNameValue() {
return pName; };
187 virtual void GetDescriptionValue(
NBString &s) { s = pDescription; };
188 virtual void GetNameValue(
NBString &s) { s = pName; };
189 virtual void GetTextValue(
NBString &s) { s = pName; };
190 virtual void GetRawValue(
NBString &s) {
return GetTextValue(s); };
191 virtual void GetTypeValue(
NBString &s) { s =
"unknown"; };
192 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty){};
196 virtual int Missing_ConfigEndMarker(
void *&startp) = 0;
198 void ClearModified();
202 virtual bool CheckGroupValues() {
return true;}
203 virtual void CommitTestedValue(uint32_t permission_mask){};
205 virtual ~config_leaf();
207 config_leaf(
bool bDetached=
false)
225 config_leaf(config_leaf &&l);
227 static void DiagShow();
228 static void FixTree();
229 void FindUnknownParent();
233 int compare(config_leaf *pl)
235 if (pl == NULL)
return -1;
236 return strcmp(GetSortNameValue(), pl->GetSortNameValue());
240 void GetBranchName(
NBString &s, config_leaf *branchRoot);
241 void RenderToFd(
int fd,
bool pretty =
false, uint32_t mask =
fConfigHidden,
bool bRawValue =
false);
242 void RenderSchemaToFd(
int fd,
bool pretty =
false, uint32_t mask =
fConfigHidden);
243 uint32_t GetFlags() {
return m_Flags; }
244 uint32_t GetFlags(uint32_t mask) {
return m_Flags & mask; }
245 void SetFlag(uint32_t flag) { m_Flags |= flag; };
246 void SetBranchFlag(uint32_t flag,
bool upNotDown =
false);
247 void ClrFlag(uint32_t flag) { m_Flags &= (~flag); };
248 void ClrBranchFlag(uint32_t flag,
bool upNotDown =
false);
249 void ReloadFromFlash();
250 void AssignmentNotify();
253 inline void LogParseError(
const char * err) {
NBString s(err); LogParseError(s); };
256 friend void HtmlLeafRender(
int fd, config_leaf *pl,
int eMode,
int len,
const char *extra);
257 friend ConfigNotificationObject;
323 config_obj(
bool bDetached=
false):config_leaf(bDetached){}
327 virtual void RemoveFromRootList();
329 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
330 void InstallUnderMe(config_leaf <oadd);
331 void RemoveFromChildren(config_leaf <oremove);
350 pMasterObjectLink = pObjList;
374 pMasterObjectLink = pObjList;
380 bool DoIContain(config_leaf *pl);
398 virtual void CommitTestedValue(uint32_t permission_mask)
override;
401 virtual int Missing_ConfigEndMarker(
void *&startp)
override
404 return sizeof(*this);
425 friend class config_leaf;
436 pDescription =
"Root of config tree";
440 virtual int Missing_ConfigEndMarker(
void *&startp)
override
443 return sizeof(*this);
451 { pName =
"detached";
452 pDescription =
"Root of detached tree";
456 virtual int Missing_ConfigEndMarker(
void *&startp)
override
459 return sizeof(*this);
467extern detached_root_obj detached;
493 virtual void GetTextValue(
NBString &s)
override = 0;
512 owner.InstallUnderMe(*
this);
539 virtual int FdPrintValue(
int fd,
bool raw);
542 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
558 virtual int FdPrintValue(
int fd,
bool raw)
override;
599 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
614 operator uint32_t()
const {
return val; };
636 pend_val = val = ci.val;
643 virtual int Missing_ConfigEndMarker(
void *&startp)
override
646 return sizeof(*this);
665 virtual int FdPrintValue(
int fd,
bool raw)
override;
675 config_hex_uint(
config_obj &owner, uint32_t def_val,
const char *name,
const char *desc = NULL) :
config_uint(owner,def_val, name, desc){}
684 config_hex_uint(uint32_t def_val,
const char *name,
const char *desc = NULL) :
config_uint(def_val,name, desc){}
686 virtual void GetTextValue(
NBString &s)
override { s.siprintf(
"\"0x%X\"", val); };
687 virtual void GetTypeValue(
NBString &s)
override { s =
"string"; };
706 virtual int FdPrintValue(
int fd,
bool raw)
override;
748 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
763 operator int()
const {
return val; };
786 pend_val = val = ci.val;
793 virtual int Missing_ConfigEndMarker(
void *&startp)
override
796 return sizeof(*this);
822 virtual int FdPrintValue(
int fd,
bool raw)
override;
863 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
878 operator int()
const {
return val; };
891 operator float()
const {
return val; };
904 operator double()
const {
return val; };
926 pend_val = val = ci.val;
933 virtual int Missing_ConfigEndMarker(
void *&startp)
override
936 return sizeof(*this);
959 virtual int FdPrintValue(
int fd,
bool raw)
override;
961 config_report(
config_obj &owner,
const char *value,
const char *name,
const char *desc = NULL) :
config_value(owner, name, desc)
966 config_report(
const char *value,
const char *name,
const char *desc = NULL) :
config_value(name, desc)
972 config_report(config_report &&r);
974 virtual void GetTextValue(
NBString &s)
override;
976 virtual void CommitTestedValue(uint32_t permission_mask)
override;
979 virtual int Missing_ConfigEndMarker(
void *&startp)
override
982 return sizeof(*this);
984 virtual void GetTypeValue(
NBString &s)
override { s =
"string"; };
986 const char *c_str() {
return m_value; };
987 void ModifyValue(
const char *nv) { m_value = nv; };
1003 virtual int FdPrintValue(
int fd,
bool raw)
override;
1049 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1064 operator bool()
const {
return val; };
1086 pend_val = val = cb.val;
1099 pend_val = val = (i != 0);
1106 virtual int Missing_ConfigEndMarker(
void *&startp)
1109 return sizeof(*this);
1134 virtual int FdPrintValue(
int fd,
bool raw)
override;
1152 const char * GetPendValue() {
return pend_val.
c_str();};
1218 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1270 pend_val = val = ci.val;
1277 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1280 return sizeof(*this);
1304 inline const char &
operator[](
size_t pos)
const {
return val[pos]; };
1315 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty);
1348 virtual int FdPrintValue(
int fd,
bool raw)
override;
1418 virtual void CommitTestedValue(uint32_t permission_mask)
override;
1421 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
1423 config_string::ExtendedSchema(fd, indent, pretty);
1424 DoSchemaLine(fd,
"format",
"password", indent, pretty);
1467 pend_val = val = ci.val;
1480 pend_val = val = ci.val;
1503 virtual int FdPrintValue(
int fd,
bool raw)
override;
1584 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1631 pend_val = val = i4;
1644 pend_val = val = ci.val;
1651 virtual int Missing_ConfigEndMarker(
void *&startp)
1654 return sizeof(*this);
1667 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv4", indent, pretty); };
1686 virtual int FdPrintValue(
int fd,
bool raw)
override;
1766 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1809 pend_val = val = i6;
1822 pend_val = val = ci.val;
1829 virtual int Missing_ConfigEndMarker(
void *&startp)
1832 return sizeof(*this);
1845 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv6", indent, pretty); };
1848#define config_IPADDR config_IPADDR4
1864 virtual int FdPrintValue(
int fd,
bool raw)
override;
1876 s.siprintf(
"\"%02X:%02X:%02X:%02X:%02X:%02X\"", val.phywadr[0] >> 8, val.phywadr[0] & 0xFF, val.phywadr[1] >> 8,
1877 val.phywadr[1] & 0xFF, val.phywadr[2] >> 8, val.phywadr[2] & 0xFF);
1967 pend_val = val = ci.val;
1980 pend_val = val = ci;
1986 MACADR operator+(uint32_t rhs)
1987 {
return val + rhs; }
1989 MACADR operator-(uint32_t rhs)
1990 {
return val - rhs; }
1993 virtual int Missing_ConfigEndMarker(
void *&startp)
1996 return sizeof(*this);
2000 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
2013#define ConfigEndMarker \
2014 virtual int Missing_ConfigEndMarker(void *&startp) override \
2017 return sizeof(*this); \
2054 choices = in_choices;
2061 const char * GetPendValue() {
return value.pend_val.
c_str();};
2075 choices = in_choices;
2088 bool IsSelected(
const char *choice) {
return (choice == value); };
2115 const char *sChoices = choices.
c_str();
2116 size_t listLen = choices.
length();
2119 if (str ==
nullptr) {
return false; }
2120 if (listLen == 0) {
return false; }
2122 while (index < listLen)
2124 size_t curVarStart = index;
2125 size_t curVarLength;
2128 while (sChoices[index] != 0 && sChoices[index] !=
',')
2133 curVarLength = index - curVarStart;
2135 if (strncmp(str, &sChoices[curVarStart], (curVarLength > strLen) ? curVarLength : strLen) == 0)
2160 const char *sStr = str.c_str();
2161 const char *sChoices = choices.
c_str();
2162 size_t length = choices.
length();
2165 if (sStr ==
nullptr) {
return false; }
2166 if (length == 0) {
return false; }
2168 while (index < length)
2170 size_t curVarStart = index;
2171 size_t curVarLength;
2174 while (sChoices[index] != 0 && sChoices[index] !=
',')
2179 curVarLength = index - curVarStart;
2181 if (strncmp(sStr, &sChoices[curVarStart], curVarLength > strLen ? curVarLength : strLen) == 0)
2207 choices = in_choices;
2221 choices = in_choices;
2314 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)
2321 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2325 if(i>=min_val && max_val<=i)
2343 if((test_v>=min_val) && (test_v<=max_val))
2345 pend_val = val = test_v;
2361 if((test_v>=min_val) && (test_v<=max_val))
2363 pend_val = val = test_v;
2409 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)
2416 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2420 if(i>=min_val && max_val<=i)
2438 if((test_v>=min_val) && (test_v<=max_val))
2440 pend_val = val = test_v;
2455 uint32_t test_v=cil;
2456 if((test_v>=min_val) && (test_v<=max_val))
2458 pend_val = val = test_v;
2510 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)
2518 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2522 if(i>=min_val && max_val<=i)
2540 if((test_v>=min_val) && (test_v<=max_val))
2542 pend_val = val = test_v;
2558 if((test_v>=min_val) && (test_v<=max_val))
2560 pend_val = val = test_v;
2622 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2644 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2646 pend_val = val = test_v;
2662 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2664 pend_val = val = test_v;
2717 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2739 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2741 pend_val = val = test_v;
2757 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2759 pend_val = val = test_v;
2770 virtual const char *GetSortNameValue() {
return "ZZZc"; };
2773 reboot_obj() :
config_bool(root, false,
"Reboot",
"Cause system reboot on save"){};
2781 virtual int Missing_ConfigEndMarker(
void *&startp)
2784 return sizeof(*this);
2791 virtual const char *GetSortNameValue() {
return "ZZZb"; };
2794 version_obj() :
config_int(root, 0,
"Version",
"Version serial number") { bNeverSet =
true; };
2804 virtual int Missing_ConfigEndMarker(
void *&startp)
2807 return sizeof(*this);
2816 empty_config_obj(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2817 empty_config_obj(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2818 empty_config_obj(empty_config_obj &&e);
2833class config_preserver_obj :
public config_obj
2840 config_preserver_obj(
const char *name,
const char *desc = NULL);
2841 config_preserver_obj(
config_obj &owner,
const char *name,
const char *desc = NULL);
2842 config_preserver_obj(config_preserver_obj &&po);
2846 virtual void CommitTestedValue(uint32_t permission_mask)
override;
2847 virtual void GetTextValue(
NBString &s)
override;
2848 virtual void GetRawValue(
NBString &s)
override;
2852extern const char PlatformName[];
2857 config_report system_platform{PlatformName,
"Platform",
"Hardware Platform"};
2858 config_report system_app{
AppName,
"Application",
"Application name"};
2861 SysRecord(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2862 SysRecord(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2863 SysRecord(SysRecord &&sr);
2866extern SysRecord sys;
2867extern empty_config_obj netif;
2869extern reboot_obj rebooter;
2870extern version_obj config_cur_version;
2872extern const int plat_def_baud;
2873extern const int plat_def_delay;
2874extern const int plat_def_quiet;
2875extern const int plat_def_watchdog_enabled;
2877#include <plat_cfg_types.h>
2878#ifdef PRESERVE_APP_DATA
2879extern config_preserver_obj appdata;
2881extern empty_config_obj appdata;
2894 config_uart Uart{plat_def_com,
"BootUart"};
2895 config_int BootDelay{plat_def_delay,
"BootDelay"};
2897 config_chooser sercfg_action{
"SerialConfig",
"DuringBoot",
"DuringBoot,AlwaysEnabled,PauseAfterBoot,Disabled"};
2903 MonitorRecord(
const char *name) :
config_obj(name,
"Boot monitor record")
2909 MonitorRecord(
config_obj &owner,
const char *name) :
config_obj(owner, name,
"Boot Monitor Record")
2915 MonitorRecord(MonitorRecord &&mr);
2917extern 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:1498
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1611
config_IPADDR4(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1575
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1664
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:1558
config_IPADDR4(IPADDR4 def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1540
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:1513
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:1525
config_IPADDR4 & operator=(const config_IPADDR4 &ci)
Copy one config_IPADDR4 object to another.
Definition config_obj.h:1642
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1602
void SetNull()
Set the IP address to null.
Definition config_obj.h:1618
config_IPADDR4 & operator=(const IPADDR4 &i4)
Copy an IPADDR4 object value to a config_IPADDR4 object.
Definition config_obj.h:1629
Configuration Variable for IPADDR (IPv6) object type.
Definition config_obj.h:1681
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1842
config_IPADDR & operator=(const config_IPADDR &ci)
Copy one config_IPADDR object to another.
Definition config_obj.h:1820
config_IPADDR & operator=(const IPADDR &i6)
Copy an IPADDR object value to a config_IPADDR object.
Definition config_obj.h:1807
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:1740
config_IPADDR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1757
void SetNull()
Set the IP address value of an config_IPADDR object to null.
Definition config_obj.h:1796
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:1707
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1791
config_IPADDR(IPADDR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1724
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1782
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:1695
Configuration Variable for MACADR object type.
Definition config_obj.h:1859
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:1890
config_MACADR & operator=(const MACADR &ci)
Copy a MACADR object value to a MACADR object.
Definition config_obj.h:1978
config_MACADR(MACADR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1907
config_MACADR & operator=(const config_MACADR &ci)
Copy one config_MACADR object to another.
Definition config_obj.h:1965
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:1924
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:1874
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:2009
config_MACADR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1943
Boolean Configuration Variable.
Definition config_obj.h:998
config_bool(bool def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1041
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1117
config_bool & operator=(const config_bool &cb)
Copy one config_bool object to another.
Definition config_obj.h:1084
config_bool & operator=(const int i)
Assign a config_bool object value to the specified integer value.
Definition config_obj.h:1097
config_bool & operator=(const bool v)
Assign the config_bool object value to the specified bool value.
Definition config_obj.h:1071
virtual void GetTextValue(NBString &s) override
Copy the object value as a text string to the specified NBString object.
Definition config_obj.h:1012
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:1028
Chooser Configuration Variable - Select From a List of Items.
Definition config_obj.h:2033
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:2274
const config_string & GetChoices()
Get the list of choices.
Definition config_obj.h:2196
const config_string & SetChoices(const char *in_choices)
Set the list of choices.
Definition config_obj.h:2205
bool IsSelected(const char *choice)
Check if a particular choice option is selected.
Definition config_obj.h:2088
config_chooser & operator=(const char *p)
Assign the selected list item from a const char* value.
Definition config_obj.h:2240
bool IsSelected(const NBString &s)
Check if a particular choice option is selected.
Definition config_obj.h:2098
config_chooser & operator=(const config_chooser &ci)
Copy one config_chooser object to another.
Definition config_obj.h:2266
config_chooser(const char *name, const char *in_value, const char *in_choices, const char *desc=NULL)
Object constructor.
Definition config_obj.h:2072
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:2113
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:2050
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:2158
config_chooser & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:2253
A config_double with minimum and/or maximum values Attempting to set a value lower than the minimum o...
Definition config_obj.h:2475
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:2575
config_double_limit & operator=(const config_double_limit &cil)
Copy one config_double_limit object to another.
Definition config_obj.h:2555
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:2510
config_double_limit & operator=(const config_double &ci)
Copy a config_double object into the config_double_limit.
Definition config_obj.h:2537
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:2493
Double Float Configuration Variable.
Definition config_obj.h:817
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:948
virtual void GetTextValue(NBString &s) override
Copy the object value as a text string to the specified NBString object.
Definition config_obj.h:831
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:841
config_double(double def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:854
config_double & operator=(const double d)
Assign the config_double object value from a double value.
Definition config_obj.h:911
config_double & operator=(const config_double &ci)
Copy one config_double object to another.
Definition config_obj.h:924
A config_int with minimum and/or maximum values Attempting to set a value lower than the minimum or g...
Definition config_obj.h:2283
config_int_limit & operator=(const config_int &ci)
Copy a config_int object into the config_int_limit.
Definition config_obj.h:2340
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:2314
config_int_limit & operator=(const config_int_limit &cil)
Copy one config_int_limit object to another.
Definition config_obj.h:2358
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:2299
Signed 32-bit Integer Configuration Variable.
Definition config_obj.h:701
config_int & operator=(const int i)
Assign the config_int object value to the specified int value.
Definition config_obj.h:770
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:725
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:806
virtual void GetTextValue(NBString &s) override
Copy the object value to the specified NBString object.
Definition config_obj.h:715
config_int(int def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:738
config_int & operator=(const config_int &ci)
Copy one config_int object to another.
Definition config_obj.h:784
Configure device network name.
Definition config_netobj.h:26
Base class used to create configuration objects.
Definition config_obj.h:321
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:423
config_obj(const char *name, const char *desc)
Object constructor.
Definition config_obj.h:368
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:345
A config_pass with minimum and/or maximum lengths Attempting to set a value shorter than the minimum ...
Definition config_obj.h:2679
config_pass_limit & operator=(const config_pass_limit &cil)
Copy one config_pass_limit object to another.
Definition config_obj.h:2754
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:2695
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:2710
config_pass_limit & operator=(const config_pass &ci)
Copy a config_pass object into the config_pass_limit.
Definition config_obj.h:2736
Password string Configuration Variable.
Definition config_obj.h:1346
config_pass(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1396
config_pass & operator=(const config_string &ci)
Copy a config_string object to a config_pass object.
Definition config_obj.h:1465
config_pass & operator=(const char *p)
Assign the config_pass object value from a const char* value.
Definition config_obj.h:1439
config_pass & operator=(const NBString &s)
Assign the config_pass object value from a NBString object.
Definition config_obj.h:1452
config_pass(NBString def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1372
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:1384
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:1478
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:1360
A config_string with minimum and/or maximum lengths Attempting to set a value shorter than the minimu...
Definition config_obj.h:2584
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:2615
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:2600
config_string_limit & operator=(const config_string &ci)
Copy a config_string object into the config_string_limit.
Definition config_obj.h:2641
config_string_limit & operator=(const config_string_limit &cil)
Copy one config_string_limit object to another.
Definition config_obj.h:2659
String Configuration Variable.
Definition config_obj.h:1128
const char * c_str() const
Returns the object value as a string.
Definition config_obj.h:1288
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:1164
const char & operator[](size_t pos) const
Return the value of a character in the string.
Definition config_obj.h:1304
config_string & operator=(const char *p)
Assign the config_string object value from a const char* string.
Definition config_obj.h:1242
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:1196
config_string & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:1255
void SetEnumList(NBString s)
Renders the data used to explain the schema/descriptions for the list of choices.
Definition config_obj.h:1226
config_string(NBString def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1179
config_string & operator=(const config_string &ci)
Copy one config_string object to another.
Definition config_obj.h:1268
config_string(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1211
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1313
size_t length() const
Returns the string length in bytes.
Definition config_obj.h:1295
A config_uint with minimum and/or maximum values Attempting to set a value lower than the minimum or ...
Definition config_obj.h:2378
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:2409
config_uint_limit & operator=(const config_uint_limit &cil)
Copy one config_uint_limit object to another.
Definition config_obj.h:2453
config_uint_limit & operator=(const config_uint &ci)
Copy a config_uint object into the config_uint_limit.
Definition config_obj.h:2435
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:2394
Unsigned 32-bit Integer Configuration Variable.
Definition config_obj.h:553
config_uint(uint32_t def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:590
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:577
config_uint & operator=(const uint32_t i)
Assign the config_uint object value from a uint32_t value.
Definition config_obj.h:621
virtual void GetTextValue(NBString &s) override
Copy the object value to the specified NBString object.
Definition config_obj.h:567
config_uint & operator=(const config_uint &ci)
Copy one config_uint object to another.
Definition config_obj.h:634
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:656
Base class used to create a configuration value.
Definition config_obj.h:491
config_value(config_obj &owner, const char *name, const char *desc)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:508
config_value(const char *name, const char *desc)
Object constructor.
Definition config_obj.h:529
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
Application name displayed in web interface and console output.
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.