NetBurner 3.5.0
PDF Version
 
config_server_serial.h
1#ifndef __CONFIG_SERVER_SERIAL_H
2#define __CONFIG_SERVER_SERIAL_H
3#include <predef.h>
4#include <servlets.h>
5#include <config_server.h>
6#include <config_obj.h>
7#include <nbupdate.h>
8
12class SerialConfigServlet : public servlet
13{
14protected:
15 enum SerialModes
16 {
17 eAlwaysEnabled,
18 eDuringBoot,
19 ePauseAfterBoot,
20 eDisabled,
21 eUpdate
22 };
23 SerialModes mode;
24 AppUpdateRecord *pUpDate;
25 NBString prefix; // The string showing where we are in the hierarchy
26
27 fifo_buffer_storage serial_store{10, 0};
28 char prevEntry[80];
29 int prevEntryLen;
30 bool prevEntryInUse;
31 config_leaf *m_pleaf;
32 bool bUnSaved;
33 bool bReadIn;
34 bool bCommand;
35 bool bTabActive;
36 int bEscaped;
37 int TabNumber;
38 int TabLen;
39 int TabPrefixLen;
40
41 int fd_cfg_serial;
42 uint32_t time_to_yield;
43 int AbortParseState;
44
45 int Match(const char *cp, bool printIfError = true, int prefixLen = -3, int startPos = 0, bool bCaseInsesitve=false);
46 void DoSave();
47 void DoHelp();
48 void DoBoot();
49 void DoFlash();
50 void DoReboot();
51 void DoUpOne();
52 void Prompt();
53 bool CmdOk() { return (prefix.length() == 0) || bCommand; };
54 void DoLS();
55 void ResetTabChoice(char *c);
56
57 int FindTabEntry(int cur_tab);
58 int TabComplete(int cur_tab);
59 int FindNextTabEntry(int cur_tab, int *matchLen, const char **matchStr, NBString *name);
60 void OutputTabEntry(int new_tab, int old_tab);
61 void FinalizeTabentry(int tab);
62 config_leaf *FindTabN(config_leaf *pr, int n);
63
64 config_leaf *FindConfigLeaf(char first_char, int *lastPathRef = NULL);
65
66 void ShowStoreContents();
67
68 public:
71 void init(NBString s, int fd);
72 void Resume(int fd_cfg, bool persist);
73
74 void ProcessReceive();
75
76 virtual int AddToSelectSet(fd_set &read_fds, fd_set &write_fds, fd_set &error_fds);
77 virtual void ProcessSelectResult(fd_set &read_fds, fd_set &write_fds, fd_set &error_fds);
78};
79
80#endif /* ----- #ifndef __CONFIG_SERVER_SERIAL_H ----- */
Lightweight alternative to C++ CString class.
Definition nbstring.h:118
size_t length() const
Returns the length of the string.
Class to run serial configurator.
Definition config_server_serial.h:13
Configuration object header file.
Configuration Server.
void init()
System initialization. Ideally called at the beginning of all applications, since the easiest Recover...
Signed Application Update API.