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 void CommitTestedValue(uint32_t permission_mask){};
204 virtual ~config_leaf();
206 config_leaf(
bool bDetached=
false)
224 config_leaf(config_leaf &&l);
226 static void DiagShow();
227 static void FixTree();
228 void FindUnknownParent();
232 int compare(config_leaf *pl)
234 if (pl == NULL)
return -1;
235 return strcmp(GetSortNameValue(), pl->GetSortNameValue());
239 void GetBranchName(
NBString &s, config_leaf *branchRoot);
240 void RenderToFd(
int fd,
bool pretty =
false, uint32_t mask =
fConfigHidden,
bool bRawValue =
false);
241 void RenderSchemaToFd(
int fd,
bool pretty =
false, uint32_t mask =
fConfigHidden);
242 uint32_t GetFlags() {
return m_Flags; }
243 uint32_t GetFlags(uint32_t mask) {
return m_Flags & mask; }
244 void SetFlag(uint32_t flag) { m_Flags |= flag; };
245 void SetBranchFlag(uint32_t flag,
bool upNotDown =
false);
246 void ClrFlag(uint32_t flag) { m_Flags &= (~flag); };
247 void ClrBranchFlag(uint32_t flag,
bool upNotDown =
false);
248 void ReloadFromFlash();
249 void AssignmentNotify();
252 inline void LogParseError(
const char * err) {
NBString s(err); LogParseError(s); };
255 friend void HtmlLeafRender(
int fd, config_leaf *pl,
int eMode,
int len,
const char *extra);
256 friend ConfigNotificationObject;
322 config_obj(
bool bDetached=
false):config_leaf(bDetached){}
326 virtual void RemoveFromRootList();
328 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
329 void InstallUnderMe(config_leaf <oadd);
330 void RemoveFromChildren(config_leaf <oremove);
349 pMasterObjectLink = pObjList;
373 pMasterObjectLink = pObjList;
379 bool DoIContain(config_leaf *pl);
397 virtual void CommitTestedValue(uint32_t permission_mask)
override;
400 virtual int Missing_ConfigEndMarker(
void *&startp)
override
403 return sizeof(*this);
424 friend class config_leaf;
435 pDescription =
"Root of config tree";
439 virtual int Missing_ConfigEndMarker(
void *&startp)
override
442 return sizeof(*this);
450 { pName =
"detached";
451 pDescription =
"Root of detached tree";
455 virtual int Missing_ConfigEndMarker(
void *&startp)
override
458 return sizeof(*this);
466extern detached_root_obj detached;
492 virtual void GetTextValue(
NBString &s)
override = 0;
511 owner.InstallUnderMe(*
this);
538 virtual int FdPrintValue(
int fd,
bool raw);
541 virtual void RawFdPrintTree(
int fd,
int n,
bool pretty, uint32_t mask,
bool braw_values,
bool valonly)
override;
557 virtual int FdPrintValue(
int fd,
bool raw)
override;
598 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
613 operator uint32_t()
const {
return val; };
635 pend_val = val = ci.val;
642 virtual int Missing_ConfigEndMarker(
void *&startp)
override
645 return sizeof(*this);
664 virtual int FdPrintValue(
int fd,
bool raw)
override;
674 config_hex_uint(
config_obj &owner, uint32_t def_val,
const char *name,
const char *desc = NULL) :
config_uint(owner,def_val, name, desc){}
683 config_hex_uint(uint32_t def_val,
const char *name,
const char *desc = NULL) :
config_uint(def_val,name, desc){}
685 virtual void GetTextValue(
NBString &s)
override { s.siprintf(
"\"0x%X\"", val); };
686 virtual void GetTypeValue(
NBString &s)
override { s =
"string"; };
705 virtual int FdPrintValue(
int fd,
bool raw)
override;
747 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
762 operator int()
const {
return val; };
785 pend_val = val = ci.val;
792 virtual int Missing_ConfigEndMarker(
void *&startp)
override
795 return sizeof(*this);
821 virtual int FdPrintValue(
int fd,
bool raw)
override;
862 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
877 operator int()
const {
return val; };
890 operator float()
const {
return val; };
903 operator double()
const {
return val; };
925 pend_val = val = ci.val;
932 virtual int Missing_ConfigEndMarker(
void *&startp)
override
935 return sizeof(*this);
958 virtual int FdPrintValue(
int fd,
bool raw)
override;
960 config_report(
config_obj &owner,
const char *value,
const char *name,
const char *desc = NULL) :
config_value(owner, name, desc)
965 config_report(
const char *value,
const char *name,
const char *desc = NULL) :
config_value(name, desc)
971 config_report(config_report &&r);
973 virtual void GetTextValue(
NBString &s)
override;
975 virtual void CommitTestedValue(uint32_t permission_mask)
override;
978 virtual int Missing_ConfigEndMarker(
void *&startp)
override
981 return sizeof(*this);
983 virtual void GetTypeValue(
NBString &s)
override { s =
"string"; };
985 const char *c_str() {
return m_value; };
986 void ModifyValue(
const char *nv) { m_value = nv; };
1002 virtual int FdPrintValue(
int fd,
bool raw)
override;
1048 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1063 operator bool()
const {
return val; };
1085 pend_val = val = cb.val;
1098 pend_val = val = (i != 0);
1105 virtual int Missing_ConfigEndMarker(
void *&startp)
1108 return sizeof(*this);
1133 virtual int FdPrintValue(
int fd,
bool raw)
override;
1215 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1267 pend_val = val = ci.val;
1274 virtual int Missing_ConfigEndMarker(
void *&startp)
override
1277 return sizeof(*this);
1301 inline const char &
operator[](
size_t pos)
const {
return val[pos]; };
1312 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty);
1345 virtual int FdPrintValue(
int fd,
bool raw)
override;
1415 virtual void CommitTestedValue(uint32_t permission_mask)
override;
1418 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
1420 config_string::ExtendedSchema(fd, indent, pretty);
1421 DoSchemaLine(fd,
"format",
"password", indent, pretty);
1464 pend_val = val = ci.val;
1477 pend_val = val = ci.val;
1498 virtual int FdPrintValue(
int fd,
bool raw)
override;
1579 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1626 pend_val = val = i4;
1639 pend_val = val = ci.val;
1646 virtual int Missing_ConfigEndMarker(
void *&startp)
1649 return sizeof(*this);
1662 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv4", indent, pretty); };
1680 virtual int FdPrintValue(
int fd,
bool raw)
override;
1760 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
1803 pend_val = val = i6;
1816 pend_val = val = ci.val;
1823 virtual int Missing_ConfigEndMarker(
void *&startp)
1826 return sizeof(*this);
1839 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty) { DoSchemaLine(fd,
"format",
"ipv6", indent, pretty); };
1842#define config_IPADDR config_IPADDR4
1858 virtual int FdPrintValue(
int fd,
bool raw)
override;
1870 s.siprintf(
"\"%02X:%02X:%02X:%02X:%02X:%02X\"", val.phywadr[0] >> 8, val.phywadr[0] & 0xFF, val.phywadr[1] >> 8,
1871 val.phywadr[1] & 0xFF, val.phywadr[2] >> 8, val.phywadr[2] & 0xFF);
1961 pend_val = val = ci.val;
1974 pend_val = val = ci;
1980 MACADR operator+(uint32_t rhs)
1981 {
return val + rhs; }
1983 MACADR operator-(uint32_t rhs)
1984 {
return val - rhs; }
1987 virtual int Missing_ConfigEndMarker(
void *&startp)
1990 return sizeof(*this);
1994 virtual void CommitTestedValue(uint32_t permission_mask)
override { val = pend_val; }
2007#define ConfigEndMarker \
2008 virtual int Missing_ConfigEndMarker(void *&startp) override \
2011 return sizeof(*this); \
2048 choices = in_choices;
2066 choices = in_choices;
2079 bool IsSelected(
const char *choice) {
return (choice == value); };
2106 const char *sChoices = choices.
c_str();
2107 size_t listLen = choices.
length();
2110 if (str ==
nullptr) {
return false; }
2111 if (listLen == 0) {
return false; }
2113 while (index < listLen)
2115 size_t curVarStart = index;
2116 size_t curVarLength;
2119 while (sChoices[index] != 0 && sChoices[index] !=
',')
2124 curVarLength = index - curVarStart;
2126 if (strncmp(str, &sChoices[curVarStart], (curVarLength > strLen) ? curVarLength : strLen) == 0)
2151 const char *sStr = str.c_str();
2152 const char *sChoices = choices.
c_str();
2153 size_t length = choices.
length();
2156 if (sStr ==
nullptr) {
return false; }
2157 if (length == 0) {
return false; }
2159 while (index < length)
2161 size_t curVarStart = index;
2162 size_t curVarLength;
2165 while (sChoices[index] != 0 && sChoices[index] !=
',')
2170 curVarLength = index - curVarStart;
2172 if (strncmp(sStr, &sChoices[curVarStart], curVarLength > strLen ? curVarLength : strLen) == 0)
2198 choices = in_choices;
2212 choices = in_choices;
2305 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)
2312 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2316 if(i>=min_val && max_val<=i)
2334 if((test_v>=min_val) && (test_v<=max_val))
2336 pend_val = val = test_v;
2352 if((test_v>=min_val) && (test_v<=max_val))
2354 pend_val = val = test_v;
2400 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)
2407 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2411 if(i>=min_val && max_val<=i)
2429 if((test_v>=min_val) && (test_v<=max_val))
2431 pend_val = val = test_v;
2446 uint32_t test_v=cil;
2447 if((test_v>=min_val) && (test_v<=max_val))
2449 pend_val = val = test_v;
2501 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)
2509 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2513 if(i>=min_val && max_val<=i)
2531 if((test_v>=min_val) && (test_v<=max_val))
2533 pend_val = val = test_v;
2549 if((test_v>=min_val) && (test_v<=max_val))
2551 pend_val = val = test_v;
2613 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2635 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2637 pend_val = val = test_v;
2653 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2655 pend_val = val = test_v;
2708 virtual void ExtendedSchema(
int fd,
int indent,
bool pretty)
override;
2730 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2732 pend_val = val = test_v;
2748 if((test_v.
length()>=min_len) && (test_v.
length()<=max_len))
2750 pend_val = val = test_v;
2761 virtual const char *GetSortNameValue() {
return "ZZZc"; };
2764 reboot_obj() :
config_bool(root, false,
"Reboot",
"Cause system reboot on save"){};
2772 virtual int Missing_ConfigEndMarker(
void *&startp)
2775 return sizeof(*this);
2782 virtual const char *GetSortNameValue() {
return "ZZZb"; };
2785 version_obj() :
config_int(root, 0,
"Version",
"Version serial number") { bNeverSet =
true; };
2795 virtual int Missing_ConfigEndMarker(
void *&startp)
2798 return sizeof(*this);
2807 empty_config_obj(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2808 empty_config_obj(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2809 empty_config_obj(empty_config_obj &&e);
2824class config_preserver_obj :
public config_obj
2831 config_preserver_obj(
const char *name,
const char *desc = NULL);
2832 config_preserver_obj(
config_obj &owner,
const char *name,
const char *desc = NULL);
2833 config_preserver_obj(config_preserver_obj &&po);
2837 virtual void CommitTestedValue(uint32_t permission_mask)
override;
2838 virtual void GetTextValue(
NBString &s)
override;
2839 virtual void GetRawValue(
NBString &s)
override;
2842extern const char *AppName;
2843extern const char PlatformName[];
2848 config_report system_platform{PlatformName,
"Platform",
"Hardware Platform"};
2849 config_report system_app{AppName,
"Application",
"Application name"};
2852 SysRecord(
const char *name,
const char *desc = NULL) :
config_obj(name, desc){};
2853 SysRecord(
config_obj &owner,
const char *name,
const char *desc = NULL) :
config_obj(owner, name, desc){};
2854 SysRecord(SysRecord &&sr);
2857extern SysRecord sys;
2858extern empty_config_obj netif;
2860extern reboot_obj rebooter;
2861extern version_obj config_cur_version;
2863extern const int plat_def_baud;
2864extern const int plat_def_delay;
2865extern const int plat_def_quiet;
2866extern const int plat_def_watchdog_enabled;
2868#include <plat_cfg_types.h>
2869#ifdef PRESERVE_APP_DATA
2870extern config_preserver_obj appdata;
2872extern empty_config_obj appdata;
2885 config_uart Uart{plat_def_com,
"BootUart"};
2886 config_int BootDelay{plat_def_delay,
"BootDelay"};
2888 config_chooser sercfg_action{
"SerialConfig",
"DuringBoot",
"DuringBoot,AlwaysEnabled,PauseAfterBoot,Disabled"};
2894 MonitorRecord(
const char *name) :
config_obj(name,
"Boot monitor record")
2900 MonitorRecord(
config_obj &owner,
const char *name) :
config_obj(owner, name,
"Boot Monitor Record")
2906 MonitorRecord(MonitorRecord &&mr);
2908extern MonitorRecord monitor_config;
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:1493
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1606
config_IPADDR4(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1570
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1659
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:1553
config_IPADDR4(IPADDR4 def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1535
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:1508
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:1520
config_IPADDR4 & operator=(const config_IPADDR4 &ci)
Copy one config_IPADDR4 object to another.
Definition config_obj.h:1637
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1597
void SetNull()
Set the IP address to null.
Definition config_obj.h:1613
config_IPADDR4 & operator=(const IPADDR4 &i4)
Copy an IPADDR4 object value to a config_IPADDR4 object.
Definition config_obj.h:1624
Configuration Variable for IPADDR (IPv6) object type.
Definition config_obj.h:1675
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1836
config_IPADDR & operator=(const config_IPADDR &ci)
Copy one config_IPADDR object to another.
Definition config_obj.h:1814
config_IPADDR & operator=(const IPADDR &i6)
Copy an IPADDR object value to a config_IPADDR object.
Definition config_obj.h:1801
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:1734
config_IPADDR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1751
void SetNull()
Set the IP address value of an config_IPADDR object to null.
Definition config_obj.h:1790
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:1701
bool NotNull() const
Check if the IP address is not null.
Definition config_obj.h:1785
config_IPADDR(IPADDR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1718
bool IsNull() const
Check if the IP address is null.
Definition config_obj.h:1776
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:1689
Configuration Variable for MACADR object type.
Definition config_obj.h:1853
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:1884
config_MACADR & operator=(const MACADR &ci)
Copy a MACADR object value to a MACADR object.
Definition config_obj.h:1972
config_MACADR(MACADR def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1901
config_MACADR & operator=(const config_MACADR &ci)
Copy one config_MACADR object to another.
Definition config_obj.h:1959
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:1918
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:1868
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:2003
config_MACADR(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1937
Boolean Configuration Variable.
Definition config_obj.h:997
config_bool(bool def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1040
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1116
config_bool & operator=(const config_bool &cb)
Copy one config_bool object to another.
Definition config_obj.h:1083
config_bool & operator=(const int i)
Assign a config_bool object value to the specified integer value.
Definition config_obj.h:1096
config_bool & operator=(const bool v)
Assign the config_bool object value to the specified bool value.
Definition config_obj.h:1070
virtual void GetTextValue(NBString &s) override
Copy the object value as a text string to the specified NBString object.
Definition config_obj.h:1011
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:1027
Chooser Configuration Variable - Select From a List of Items.
Definition config_obj.h:2027
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:2265
const config_string & GetChoices()
Get the list of choices.
Definition config_obj.h:2187
const config_string & SetChoices(const char *in_choices)
Set the list of choices.
Definition config_obj.h:2196
bool IsSelected(const char *choice)
Check if a particular choice option is selected.
Definition config_obj.h:2079
config_chooser & operator=(const char *p)
Assign the selected list item from a const char* value.
Definition config_obj.h:2231
bool IsSelected(const NBString &s)
Check if a particular choice option is selected.
Definition config_obj.h:2089
config_chooser & operator=(const config_chooser &ci)
Copy one config_chooser object to another.
Definition config_obj.h:2257
config_chooser(const char *name, const char *in_value, const char *in_choices, const char *desc=NULL)
Object constructor.
Definition config_obj.h:2063
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:2104
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:2044
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:2149
config_chooser & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:2244
A config_double with minimum and/or maximum values Attempting to set a value lower than the minimum o...
Definition config_obj.h:2466
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:2566
config_double_limit & operator=(const config_double_limit &cil)
Copy one config_double_limit object to another.
Definition config_obj.h:2546
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:2501
config_double_limit & operator=(const config_double &ci)
Copy a config_double object into the config_double_limit.
Definition config_obj.h:2528
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:2484
Double Float Configuration Variable.
Definition config_obj.h:816
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:947
virtual void GetTextValue(NBString &s) override
Copy the object value as a text string to the specified NBString object.
Definition config_obj.h:830
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:840
config_double(double def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:853
config_double & operator=(const double d)
Assign the config_double object value from a double value.
Definition config_obj.h:910
config_double & operator=(const config_double &ci)
Copy one config_double object to another.
Definition config_obj.h:923
A config_int with minimum and/or maximum values Attempting to set a value lower than the minimum or g...
Definition config_obj.h:2274
config_int_limit & operator=(const config_int &ci)
Copy a config_int object into the config_int_limit.
Definition config_obj.h:2331
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:2305
config_int_limit & operator=(const config_int_limit &cil)
Copy one config_int_limit object to another.
Definition config_obj.h:2349
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:2290
Signed 32-bit Integer Configuration Variable.
Definition config_obj.h:700
config_int & operator=(const int i)
Assign the config_int object value to the specified int value.
Definition config_obj.h:769
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:724
virtual void GetTypeValue(NBString &s) override
Copy the object type value in the specified NBString object.
Definition config_obj.h:805
virtual void GetTextValue(NBString &s) override
Copy the object value to the specified NBString object.
Definition config_obj.h:714
config_int(int def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:737
config_int & operator=(const config_int &ci)
Copy one config_int object to another.
Definition config_obj.h:783
Configure device network name.
Definition config_netobj.h:26
Base class used to create configuration objects.
Definition config_obj.h:320
virtual void GetTypeValue(NBString &s) override
Assigns the object type value to the specified NBString object.
Definition config_obj.h:422
config_obj(const char *name, const char *desc)
Object constructor.
Definition config_obj.h:367
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:344
A config_pass with minimum and/or maximum lengths Attempting to set a value shorter than the minimum ...
Definition config_obj.h:2670
config_pass_limit & operator=(const config_pass_limit &cil)
Copy one config_pass_limit object to another.
Definition config_obj.h:2745
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:2686
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:2701
config_pass_limit & operator=(const config_pass &ci)
Copy a config_pass object into the config_pass_limit.
Definition config_obj.h:2727
Password string Configuration Variable.
Definition config_obj.h:1343
config_pass(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1393
config_pass & operator=(const config_string &ci)
Copy a config_string object to a config_pass object.
Definition config_obj.h:1462
config_pass & operator=(const char *p)
Assign the config_pass object value from a const char* value.
Definition config_obj.h:1436
config_pass & operator=(const NBString &s)
Assign the config_pass object value from a NBString object.
Definition config_obj.h:1449
config_pass(NBString def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1369
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:1381
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:1475
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:1357
A config_string with minimum and/or maximum lengths Attempting to set a value shorter than the minimu...
Definition config_obj.h:2575
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:2606
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:2591
config_string_limit & operator=(const config_string &ci)
Copy a config_string object into the config_string_limit.
Definition config_obj.h:2632
config_string_limit & operator=(const config_string_limit &cil)
Copy one config_string_limit object to another.
Definition config_obj.h:2650
String Configuration Variable.
Definition config_obj.h:1127
const char * c_str() const
Returns the object value as a string.
Definition config_obj.h:1285
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:1161
const char & operator[](size_t pos) const
Return the value of a character in the string.
Definition config_obj.h:1301
config_string & operator=(const char *p)
Assign the config_string object value from a const char* string.
Definition config_obj.h:1239
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:1193
config_string & operator=(const NBString &s)
Assign the config_string object value from a NBString object.
Definition config_obj.h:1252
void SetEnumList(NBString s)
Renders the data used to explain the schema/descriptions for the list of choices.
Definition config_obj.h:1223
config_string(NBString def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1176
config_string & operator=(const config_string &ci)
Copy one config_string object to another.
Definition config_obj.h:1265
config_string(const char *def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:1208
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:1310
size_t length() const
Returns the string length in bytes.
Definition config_obj.h:1292
A config_uint with minimum and/or maximum values Attempting to set a value lower than the minimum or ...
Definition config_obj.h:2369
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:2400
config_uint_limit & operator=(const config_uint_limit &cil)
Copy one config_uint_limit object to another.
Definition config_obj.h:2444
config_uint_limit & operator=(const config_uint &ci)
Copy a config_uint object into the config_uint_limit.
Definition config_obj.h:2426
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:2385
Unsigned 32-bit Integer Configuration Variable.
Definition config_obj.h:552
config_uint(uint32_t def_val, const char *name, const char *desc=NULL)
Object constructor.
Definition config_obj.h:589
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:576
config_uint & operator=(const uint32_t i)
Assign the config_uint object value from a uint32_t value.
Definition config_obj.h:620
virtual void GetTextValue(NBString &s) override
Copy the object value to the specified NBString object.
Definition config_obj.h:566
config_uint & operator=(const config_uint &ci)
Copy one config_uint object to another.
Definition config_obj.h:633
virtual void GetTypeValue(NBString &s) override
Copy the object type value to the specified NBString object.
Definition config_obj.h:655
Base class used to create a configuration value.
Definition config_obj.h:490
config_value(config_obj &owner, const char *name, const char *desc)
Object constructor with the parent/owner leaf parameter.
Definition config_obj.h:507
config_value(const char *name, const char *desc)
Object constructor.
Definition config_obj.h:528
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.
IPADDR6 IPADDR
IPADDR Object Type (either v4 or v6)
Definition nettypes.h:568
class MACADR MACADR
Used to store and manipulate MAC addresses.