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;
1505 virtual int FdPrintValue(
int fd,
bool raw)
override;
1586 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1633 pend_val = val = i4;
1646 pend_val = val = ci.val;
1653 virtual int Missing_ConfigEndMarker(
void *&startp)
1656 return sizeof(*this);
1669 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv4", indent, pretty); };
1688 virtual int FdPrintValue(
int fd,
bool raw)
override;
1768 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1811 pend_val = val = i6;
1824 pend_val = val = ci.val;
1831 virtual int Missing_ConfigEndMarker(
void *&startp)
1834 return sizeof(*this);
1847 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv6", indent, pretty); };
1850#define config_IPADDR config_IPADDR4
1866 virtual int FdPrintValue(
int fd,
bool raw)
override;
1878 s.siprintf(
"\"%02X:%02X:%02X:%02X:%02X:%02X\"", val.phywadr[0] >> 8, val.phywadr[0] & 0xFF, val.phywadr[1] >> 8,
1879 val.phywadr[1] & 0xFF, val.phywadr[2] >> 8, val.phywadr[2] & 0xFF);
1969 pend_val = val = ci.val;
1982 pend_val = val = ci;
1988 MACADR operator+(uint32_t rhs)
1989 {
return val + rhs; }
1991 MACADR operator-(uint32_t rhs)
1992 {
return val - rhs; }
1995 virtual int Missing_ConfigEndMarker(
void *&startp)
1998 return sizeof(*this);
2002 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
2015#define ConfigEndMarker \
2016 virtual int Missing_ConfigEndMarker(void *&startp) override \
2019 return sizeof(*this); \
2056 choices = in_choices;
2063 const char * GetPendValue() {
return value.pend_val.
c_str();};
2077 choices = in_choices;
2090 bool IsSelected(
const char *choice) {
return (choice == value); };
2117 const char *sChoices = choices.
c_str();
2118 size_t listLen = choices.
length();
2121 if (str ==
nullptr) {
return false; }
2122 if (listLen == 0) {
return false; }
2124 while (index < listLen)
2126 size_t curVarStart = index;
2127 size_t curVarLength;
2130 while (sChoices[index] != 0 && sChoices[index] !=
',')
2135 curVarLength = index - curVarStart;
2137 if (strncmp(str, &sChoices[curVarStart], (curVarLength > strLen) ? curVarLength : strLen) == 0)
2162 const char *sStr = str.c_str();
2163 const char *sChoices = choices.
c_str();
2164 size_t length = choices.
length();
2167 if (sStr ==
nullptr) {
return false; }
2168 if (length == 0) {
return false; }
2170 while (index < length)
2172 size_t curVarStart = index;
2173 size_t curVarLength;
2176 while (sChoices[index] != 0 && sChoices[index] !=
',')
2181 curVarLength = index - curVarStart;
2183 if (strncmp(sStr, &sChoices[curVarStart], curVarLength > strLen ? curVarLength : strLen) == 0)
2209 choices = in_choices;
2223 choices = in_choices;
2316 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)
2323 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2327 if(i>=min_val && max_val<=i)
2345 if((test_v>=min_val) && (test_v<=max_val))
2347 pend_val = val = test_v;
2363 if((test_v>=min_val) && (test_v<=max_val))
2365 pend_val = val = test_v;
2411 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)
2418 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2422 if(i>=min_val && max_val<=i)
2440 if((test_v>=min_val) && (test_v<=max_val))
2442 pend_val = val = test_v;
2457 uint32_t test_v=cil;
2458 if((test_v>=min_val) && (test_v<=max_val))
2460 pend_val = val = test_v;
2512 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)
2520 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2524 if(i>=min_val && max_val<=i)
2542 if((test_v>=min_val) && (test_v<=max_val))
2544 pend_val = val = test_v;
2560 if((test_v>=min_val) && (test_v<=max_val))
2562 pend_val = val = test_v;
2624 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2646 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2648 pend_val = val = test_v;
2664 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2666 pend_val = val = test_v;
2719 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2741 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2743 pend_val = val = test_v;
2759 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2761 pend_val = val = test_v;
2772 virtual const char *GetSortNameValue() {
return "ZZZc"; };
2775 reboot_obj() :
config_bool(root, false,
"Reboot",
"Cause system reboot on save"){};
2783 virtual int Missing_ConfigEndMarker(
void *&startp)
2786 return sizeof(*this);
2793 virtual const char *GetSortNameValue() {
return "ZZZb"; };
2796 version_obj() :
config_int(root, 0,
"Version",
"Version serial number") { bNeverSet =
true; };
2806 virtual int Missing_ConfigEndMarker(
void *&startp)
2809 return sizeof(*this);
2818 empty_config_obj(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2819 empty_config_obj(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2820 empty_config_obj(empty_config_obj &&e);
2835class config_preserver_obj :
public config_obj
2842 config_preserver_obj(
const char *name,
const char *desc = NULL);
2843 config_preserver_obj(
config_obj &owner,
const char *name,
const char *desc = NULL);
2844 config_preserver_obj(config_preserver_obj &&po);
2848 virtual void CommitTestedValue(uint32_t permission_mask)
override;
2849 virtual void GetTextValue(
NBString &s)
override;
2850 virtual void GetRawValue(
NBString &s)
override;
2854extern const char PlatformName[];
2859 config_report system_platform{PlatformName,
"Platform",
"Hardware Platform"};
2860 config_report system_app{
AppName,
"Application",
"Application name"};
2863 SysRecord(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2864 SysRecord(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2865 SysRecord(SysRecord &&sr);
2868extern SysRecord sys;
2869extern empty_config_obj netif;
2871extern reboot_obj rebooter;
2872extern version_obj config_cur_version;
2874extern const int plat_def_baud;
2875extern const int plat_def_delay;
2876extern const int plat_def_quiet;
2877extern const int plat_def_watchdog_enabled;
2879#include <plat_cfg_types.h>
2880#ifdef PRESERVE_APP_DATA
2881extern config_preserver_obj appdata;
2883extern empty_config_obj appdata;
2896 config_uart Uart{plat_def_com,
"BootUart"};
2897 config_int BootDelay{plat_def_delay,
"BootDelay"};
2899 config_chooser sercfg_action{
"SerialConfig",
"DuringBoot",
"DuringBoot,AlwaysEnabled,PauseAfterBoot,Disabled"};
2905 MonitorRecord(
const char *name) :
config_obj(name,
"Boot monitor record")
2911 MonitorRecord(
config_obj &owner,
const char *name) :
config_obj(owner, name,
"Boot Monitor Record")
2917 MonitorRecord(MonitorRecord &&mr);
2919extern 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:1613
config_IPADDR4(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1577
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1666
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:1560
config_IPADDR4(IPADDR4 def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1542
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:1515
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:1527
config_IPADDR4 & operator=(const config_IPADDR4 &ci)
Copy one config_IPADDR4 object to another.
Definition config_obj.h:1644
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1604
void SetNull()
Set the IP address to null.
Definition config_obj.h:1620
config_IPADDR4 & operator=(const IPADDR4 &i4)
Copy an IPADDR4 object value to a config_IPADDR4 object.
Definition config_obj.h:1631
Configuration Variable for IPADDR (IPv6) object type.
Definition config_obj.h:1683
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1844
config_IPADDR & operator=(const config_IPADDR &ci)
Copy one config_IPADDR object to another.
Definition config_obj.h:1822
config_IPADDR & operator=(const IPADDR &i6)
Copy an IPADDR object value to a config_IPADDR object.
Definition config_obj.h:1809
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:1742
config_IPADDR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1759
void SetNull()
Set the IP address value of an config_IPADDR object to null.
Definition config_obj.h:1798
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:1709
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1793
config_IPADDR(IPADDR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1726
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1784
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:1697
Configuration Variable for MACADR object type.
Definition config_obj.h:1861
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:1892
config_MACADR & operator=(const MACADR &ci)
Copy a MACADR object value to a MACADR object.
Definition config_obj.h:1980
config_MACADR(MACADR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1909
config_MACADR & operator=(const config_MACADR &ci)
Copy one config_MACADR object to another.
Definition config_obj.h:1967
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:1926
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:1876
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:2011
config_MACADR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1945
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:2035
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:2276
const config_string & GetChoices()
Get the list of choices.
Definition config_obj.h:2198
const config_string & SetChoices(const char *in_choices)
Set the list of choices.
Definition config_obj.h:2207
bool IsSelected(const char *choice)
Check if a particular choice option is selected.
Definition config_obj.h:2090
config_chooser & operator=(const char *p)
Assign the selected list item from a const char* value.
Definition config_obj.h:2242
bool IsSelected(const NBString &s)
Check if a particular choice option is selected.
Definition config_obj.h:2100
config_chooser & operator=(const config_chooser &ci)
Copy one config_chooser object to another.
Definition config_obj.h:2268
config_chooser(const char *name, const char *in_value, const char *in_choices, const char *desc=NULL)
Object constructor.
Definition config_obj.h:2074
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:2115
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:2052
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:2160
config_chooser & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:2255
A config_double with minimum and/or maximum values Attempting to set a value lower than the minimum o...
Definition config_obj.h:2477
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:2577
config_double_limit & operator=(const config_double_limit &cil)
Copy one config_double_limit object to another.
Definition config_obj.h:2557
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:2512
config_double_limit & operator=(const config_double &ci)
Copy a config_double object into the config_double_limit.
Definition config_obj.h:2539
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:2495
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:2285
config_int_limit & operator=(const config_int &ci)
Copy a config_int object into the config_int_limit.
Definition config_obj.h:2342
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:2316
config_int_limit & operator=(const config_int_limit &cil)
Copy one config_int_limit object to another.
Definition config_obj.h:2360
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:2301
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:2681
config_pass_limit & operator=(const config_pass_limit &cil)
Copy one config_pass_limit object to another.
Definition config_obj.h:2756
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:2697
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:2712
config_pass_limit & operator=(const config_pass &ci)
Copy a config_pass object into the config_pass_limit.
Definition config_obj.h:2738
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:2586
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:2617
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:2602
config_string_limit & operator=(const config_string &ci)
Copy a config_string object into the config_string_limit.
Definition config_obj.h:2643
config_string_limit & operator=(const config_string_limit &cil)
Copy one config_string_limit object to another.
Definition config_obj.h:2661
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:2380
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:2411
config_uint_limit & operator=(const config_uint_limit &cil)
Copy one config_uint_limit object to another.
Definition config_obj.h:2455
config_uint_limit & operator=(const config_uint &ci)
Copy a config_uint object into the config_uint_limit.
Definition config_obj.h:2437
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:2396
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.