|
@@ -1,4 +1,5 @@
|
|
|
#include <machineiomanager.hpp>
|
|
|
+#include <useriomanager.hpp>
|
|
|
|
|
|
#include <boost/program_options.hpp>
|
|
|
#include <boost/asio.hpp>
|
|
@@ -12,8 +13,6 @@
|
|
|
#define sizeofarr(a) (sizeof(a) / sizeof(a[0]))
|
|
|
|
|
|
namespace bpo = boost::program_options;
|
|
|
-namespace bai = boost::asio;
|
|
|
-using bai::ip::tcp;
|
|
|
|
|
|
typedef enum {
|
|
|
CMD_HELP,
|
|
@@ -45,10 +44,6 @@ CMD commands[]{{CMD_HELP, "help", "show help"},
|
|
|
{CMD_SETUP, "setup", "configure server at IP"},
|
|
|
{CMD_LOG, "log", "show log from IP"}};
|
|
|
|
|
|
-/* takes a string in str and checks if it is a valid command
|
|
|
- returns the matching COMMANDTYPES or CMD_UNKNOWN
|
|
|
- if isshort is nonzero, only the first character of str will be checked
|
|
|
-*/
|
|
|
COMMANDTYPES getCommand(char *str, unsigned int isshort) {
|
|
|
COMMANDTYPES ret = CMD_UNKNOWN;
|
|
|
char temp[COMMANDLEN + 1] = {0};
|
|
@@ -125,7 +120,7 @@ int main(int argc, char **argv) {
|
|
|
std::printf("ip %s machine mode is %d file is %s\n", argv[1], machine, file?file:"");
|
|
|
//~ std::printf("read line %s\n", readline("fancprompt "));
|
|
|
|
|
|
- ioman = new MachineIoManager(argv[1]);
|
|
|
+ ioman = new UserIoManager(argv[1]);
|
|
|
// ‘MachineIoManager::MachineIoManager(char*&)’
|
|
|
if(ioman->connect()) {
|
|
|
ioman->run();
|