[BACK] Return to admin_service.cpp CVS log [TXT][DIR] Up to Nevrax / code / nelns / admin_service

Diff for /code/nelns/admin_service/admin_service.cpp between version 1.5 and 1.14

version 1.5, 2001/05/31 16:44:54 version 1.14, 2002/03/19 17:42:48
Line 24 
Line 24 
  * MA 02111-1307, USA.  * MA 02111-1307, USA.
  */  */
  
  #ifdef HAVE_CONFIG_H
  #include "config.h"
  #endif // HAVE_CONFIG_H
  
  #ifndef NELNS_CONFIG
  #define NELNS_CONFIG ""
  #endif // NELNS_CONFIG
  
  #ifndef NELNS_LOGS
  #define NELNS_LOGS ""
  #endif // NELNS_LOGS
  
 #include <string> #include <string>
 #include <list> #include <list>
  
 #include "nel/net/service.h" #include "nel/net/service.h"
 #include "nel/misc/debug.h" #include "nel/misc/debug.h"
 #include "nel/misc/config_file.h" #include "nel/misc/config_file.h"
  #include "nel/misc/command.h"
  
 #include "nel/net/net_manager.h" #include "nel/net/net_manager.h"
  
Line 51 
Line 64 
         bool        Ready;                        /// true if the service is ready         bool        Ready;                        /// true if the service is ready
         bool        Connected;                /// true if the service is connected to the AES         bool        Connected;                /// true if the service is connected to the AES
         bool        InConfig;                /// true if the service is in the configuration         bool        InConfig;                /// true if the service is in the configuration
          std::vector<NLMISC::CSerialCommand>        Commands;
  
          void setValues (const CService &t)
          {
                  // copy all except gtk stuffs
                  Id = t.Id;
                  AliasName = t.AliasName;
                  ShortName = t.ShortName;
                  LongName = t.LongName;
                  Ready = t.Ready;
                  Connected = t.Connected;
                  //InConfig = t.InConfig; never change the inconfig value
          }
 }; };
  
 typedef list<CService> TServices; typedef list<CService> TServices;
Line 136 
Line 162 
 { {
         for (AESIT aesit = AdminExecutorServices.begin(); aesit != AdminExecutorServices.end(); aesit++)         for (AESIT aesit = AdminExecutorServices.begin(); aesit != AdminExecutorServices.end(); aesit++)
         {         {
                  nlinfo ("> Admin");
                 for (SIT sit = (*aesit).Services.begin(); sit != (*aesit).Services.end(); sit++)                 for (SIT sit = (*aesit).Services.begin(); sit != (*aesit).Services.end(); sit++)
                 {                 {
                         nlinfo ("> %s %s %s %d %d", (*aesit).SockId->asString().c_str(), (*sit).ShortName.c_str(), (*sit).LongName.c_str(), (*aesit).Id, (*sit).Id);                         nlinfo ("  > '%s' '%s' '%s' '%s' %d %d", (*aesit).SockId->asString().c_str(), (*sit).AliasName.c_str(), (*sit).ShortName.c_str(), (*sit).LongName.c_str(), (*aesit).Id, (*sit).Id);
                 }                 }
         }         }
 } }
  
  
  // send a message to a client. if ok is 0 it s an error or it s a normal
  void messageToClient (uint8 ok, string msg, TSockId from = NULL)
  {
          CMessage msgout (CNetManager::getSIDA ("AS"), "MESSAGE");
          msgout.serial (ok, msg);
          CNetManager::send ("AS", msgout, from);
  }
  
  
 //////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
 /////////////////// SCRIPT MANAGER ///////////////////////////////////////////////////////////////////// /////////////////// SCRIPT MANAGER /////////////////////////////////////////////////////////////////////
Line 167 
Line 203 
                 if (StartAllServicesPos*2 >= (uint32)script.size())                 if (StartAllServicesPos*2 >= (uint32)script.size())
                 {                 {
                         StartAllServices = false;                         StartAllServices = false;
  
                         nlinfo("end of the script");                         nlinfo("end of the script");
                         // todo send that the script is finish to the admin                         messageToClient (1, "Start All Service finnished correctly");
                         return;                         return;
                 }                 }
  
Line 184 
Line 221 
                 }                 }
                 catch(EBadSize &)                 catch(EBadSize &)
                 {                 {
                          messageToClient (1, "'Services' variable does not contains a good number of entries (must be a multiple of 2)");
                         nlwarning ("'Services' variable does not contains a good number of entries (must be a multiple of 2)");                         nlwarning ("'Services' variable does not contains a good number of entries (must be a multiple of 2)");
                         StartAllServices = false;                         StartAllServices = false;
                         return;                         return;
Line 192 
Line 230 
                 AESIT aesit = findAdminExecutorService (serverAlias, false);                 AESIT aesit = findAdminExecutorService (serverAlias, false);
                 if (aesit == AdminExecutorServices.end())                 if (aesit == AdminExecutorServices.end())
                 {                 {
                         StartAllServices = false;                         messageToClient (1, "don't find the server");
                         nlwarning("don't find the server");                         nlwarning("don't find the server");
                          StartAllServices = false;
                         return;                         return;
                 }                 }
  
Line 218 
Line 257 
         }         }
         catch(EUnknownVar&)         catch(EUnknownVar&)
         {         {
                  messageToClient (1, "'Services' variable is not found");
                 nlwarning ("'Services' variable is not found");                 nlwarning ("'Services' variable is not found");
                 StartAllServices = false;                 StartAllServices = false;
                 return;                 return;
Line 228 
Line 268 
 { {
         if (StartAllServices)         if (StartAllServices)
         {         {
                  messageToClient (1, "already running a script, reset it");
                 nlwarning("already running a script, reset it");                 nlwarning("already running a script, reset it");
                 StartAllServices = false;                 StartAllServices = false;
         }         }
Line 242 
Line 283 
                         AESIT aesit = findAdminExecutorService (serverAlias, false);                         AESIT aesit = findAdminExecutorService (serverAlias, false);
                         if (aesit == AdminExecutorServices.end())                         if (aesit == AdminExecutorServices.end())
                         {                         {
                                 nlwarning("aes '%s' not running, can't run the script", serverAlias.c_str());                                 messageToClient (1, "an aes is not running, can't run the script");
                                  nlwarning("aes '%s' isn't running, can't run the script", serverAlias.c_str());
                                 return;                                 return;
                         }                         }
                 }                 }
         }         }
         catch(EConfigFile &)         catch(EConfigFile &)
         {         {
                  messageToClient (1, "bad config file");
                 nlwarning ("bad config file");                 nlwarning ("bad config file");
                 return;                 return;
         }         }
Line 280 
Line 323 
         nlinfo("end of command result");         nlinfo("end of command result");
 } }
  
  // get the service list from the admin exec and send the list to all admin client
 static void cbServiceList (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) static void cbServiceList (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
 { {
 /*      // get the service list from the admin exec and send the list to all admin client         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId(); 
         aes->Services.clear(); 
  
         CMessage msgout (CNetManager::getSIDA ("AS"), "SL"); 
  
         uint32 nbaes = 1;         //
         msgout.serial (nbaes);         // Get the list of service from aes
         msgout.serial (aes->Id);         //
  
         uint32 nbs;         uint32 nbs;
         msgin.serial (nbs);         msgin.serial (nbs);
         msgout.serial (nbs); 
  
         for (uint32 i = 0; i < nbs; i++)         for (uint32 i = 0; i < nbs; i++)
         {         {
                 uint32 sid;                 // find the service
                 msgin.serial(sid);                 CService s;
  
                 aes->Services.push_back (CService(sid)); 
                 CService *s = &(aes->Services.back()); 
  
                 msgin.serial(s->ShortName, s->LongName, s->Ready);                 msgin.serial (s.Id, s.AliasName, s.ShortName, s.LongName, s.Ready);
                  msgin.serialCont (s.Commands);
                  s.Connected = true;
  
                 msgout.serial (s->Id, s->ShortName, s->LongName, s->Ready);                 if (!s.AliasName.empty())
                  {
                          SIT sit = aes->findService (s.AliasName, false);
                          if (sit == aes->Services.end ())
                          {
                                  aes->Services.push_back (s);
                          }
                          else
                          {
                                  nlassert ("the service already exists with alias, update it");
                                  (*sit).setValues (s);
                          }
                  }
                  else
                  {
                          SIT sit = aes->findService (s.Id, false);
                          if (sit == aes->Services.end ())
                          {
                                  aes->Services.push_back (s);
                          }
                          else
                          {
                                  nlassert ("the service already exists with id, update it");
                                  (*sit).setValues (s);
                          }
                  }
         }         }
         CNetManager::send ("AS", msgout, 0); 
                  
         displayServices ();         displayServices ();
 */} 
          //
          // Send the new list to all admin
          //
  
          CMessage msgout (CNetManager::getSIDA ("AS"), "SERVICE_LIST");
          uint32 nbaes = 1;
          msgout.serial (nbaes);
          msgout.serial (aes->Id);
          uint32 ss = aes->Services.size();
          msgout.serial (ss);
  
          for (SIT sit = aes->Services.begin(); sit != aes->Services.end(); sit++)
          {
                  msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName);
                  msgout.serial ((*sit).Ready, (*sit).Connected, (*sit).InConfig);
                  msgout.serialCont ((*sit).Commands);
          }
          CNetManager::send ("AS", msgout, 0);
  }
  
 static void cbServiceAliasList (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) static void cbServiceAliasList (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
 { {
         // get the service list from the admin exec and send the list to all admin client         // get the service list from the admin exec and send the list to all admin client
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId();         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         aes->ServiceAliasList.clear ();         aes->ServiceAliasList.clear ();
         msgin.serialCont (aes->ServiceAliasList);         msgin.serialCont (aes->ServiceAliasList);
  
          nlinfo("send SAL to admin callback from aes");
  
         CMessage msgout (CNetManager::getSIDA ("AS"), "SAL");         CMessage msgout (CNetManager::getSIDA ("AS"), "SAL");
         msgout.serial (aes->Id);         msgout.serial (aes->Id);
         msgout.serialCont (aes->ServiceAliasList);         msgout.serialCont (aes->ServiceAliasList);
Line 332 
Line 415 
  
 static void cbServiceIdentification (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) static void cbServiceIdentification (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
 { {
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId();         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         uint32 sid;         uint32 sid;
         string alias;         string alias;
Line 365 
Line 448 
                 if (sit == aes->Services.end ())                 if (sit == aes->Services.end ())
                 {                 {
                         // normal case for unknown services                         // normal case for unknown services
                         nlwarning ("new service with alias (%s) but not in my list", alias.c_str());                         nlwarning ("new service without alias and not in my list, add it");
                 }                 }
                 else                 else
                 {                 {
                         nlwarning ("new service without alias is already in my list with id %d", sid);                         nlwarning ("new service without alias is already in my list with id %d, add it", sid);
                 }                 }
                 aes->Services.push_back (CService ());                 aes->Services.push_back (CService ());
                 sit = aes->Services.end();                 sit = aes->Services.end();
Line 380 
Line 463 
         (*sit).AliasName = alias;         (*sit).AliasName = alias;
         (*sit).Connected = true;         (*sit).Connected = true;
         msgin.serial ((*sit).ShortName, (*sit).LongName);         msgin.serial ((*sit).ShortName, (*sit).LongName);
          msgin.serialCont ((*sit).Commands);
  
         nlinfo ("*:%d:%d is identified to be '%s' '%s' '%s'", aes->Id, sid, (*sit).AliasName.c_str(), (*sit).ShortName.c_str(), (*sit).LongName.c_str());         nlinfo ("*:%d:%d is identified to be '%s' '%s' '%s'", aes->Id, sid, (*sit).AliasName.c_str(), (*sit).ShortName.c_str(), (*sit).LongName.c_str());
  
         // broadcast the message to all admin client         // broadcast the message to all admin client
         CMessage msgout (CNetManager::getSIDA ("AS"), "SID");         CMessage msgout (CNetManager::getSIDA ("AS"), "SID");
         msgout.serial (aes->Id, sid, (*sit).AliasName, (*sit).ShortName, (*sit).LongName);         msgout.serial (aes->Id, sid, (*sit).AliasName, (*sit).ShortName, (*sit).LongName);
          msgout.serialCont ((*sit).Commands);
  
         CNetManager::send ("AS", msgout, 0);         CNetManager::send ("AS", msgout, 0);
 } }
  
 static void cbServiceReady (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) static void cbServiceReady (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
 { {
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId();         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         uint32 sid;         uint32 sid;
         msgin.serial (sid);         msgin.serial (sid);
Line 413 
Line 499 
  
 static void cbServiceConnection (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) static void cbServiceConnection (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
 { {
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId();         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         uint32 sid;         uint32 sid;
         msgin.serial (sid);         msgin.serial (sid);
Line 433 
Line 519 
  
 static void cbServiceDisconnection (CMessage& msgin, TSockId from, CCallbackNetBase &netbase) static void cbServiceDisconnection (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
 { {
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId();         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         uint32 sid;         uint32 sid;
         msgin.serial (sid);         msgin.serial (sid);
  
         nlinfo ("*:%d:%d disconnected", aes->Id, sid);         nlinfo ("*:%d:%d disconnected", aes->Id, sid);
  
         SIT sit = aes->findService(sid);         SIT sit = aes->findService(sid, false);
  
         // broadcast the message to all admin client         // broadcast the message to all admin client
         CMessage msgout (CNetManager::getSIDA ("AS"), "SD");         CMessage msgout (CNetManager::getSIDA ("AS"), "SD");
         msgout.serial (aes->Id, (*sit).Id);         msgout.serial (aes->Id, sid);
         CNetManager::send ("AS", msgout, 0);         CNetManager::send ("AS", msgout, 0);
  
          // the service could disconnect before it's identification, in this case, we don't have it in the service list
          if (sit != aes->Services.end ())
          {
         if ((*sit).InConfig)         if ((*sit).InConfig)
         {         {
                 (*sit).Ready = (*sit).Connected = false;                 (*sit).Ready = (*sit).Connected = false;
                 (*sit).Id = 0xFFFFFFFF;                 (*sit).Id = 0xFFFFFFFF;
                 (*sit).ShortName = (*sit).LongName = "";                 (*sit).ShortName = (*sit).LongName = "";
                          (*sit).Commands.clear ();
         }         }
         else         else
         {         {
Line 460 
Line 550 
         }         }
 } }
  
          displayServices ();
  }
  
 // i'm connected to a new admin executor service // i'm connected to a new admin executor service
 void cbAESConnection (const string &serviceName, TSockId from, void *arg) void cbAESConnection (const string &serviceName, TSockId from, void *arg)
 { {
Line 467 
Line 560 
         CAdminExecutorService *aes = &(*aesit);         CAdminExecutorService *aes = &(*aesit);
                  
         // set the appid to find the aes in O(1)         // set the appid to find the aes in O(1)
         from->setAppId ((uint64)aes);         from->setAppId ((uint64)(uint)aes);
  
         aes->Connected = true;         aes->Connected = true;
         nlinfo ("*:%d:* connected", aes->Id);         nlinfo ("*:%d:* connected", aes->Id);
Line 490 
Line 583 
 void cbAESDisconnection (const string &serviceName, TSockId from, void *arg) void cbAESDisconnection (const string &serviceName, TSockId from, void *arg)
 { {
         // get the aes with the appid         // get the aes with the appid
         CAdminExecutorService *aes = (CAdminExecutorService*) from->appId();         CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         aes->Connected = false;         aes->Connected = false;
  
         SIT sit;         SIT sit;
         for (sit = aes->Services.begin(); sit != aes->Services.end(); sit++)         for (sit = aes->Services.begin(); sit != aes->Services.end();)
          {
                  // keep only inconfig services
                  if ((*sit).InConfig)
         {         {
                 (*sit).Id = 0xFFFFFFFF;                 (*sit).Id = 0xFFFFFFFF;
                 (*sit).ShortName = (*sit).LongName = "";                 (*sit).ShortName = (*sit).LongName = "";
                 (*sit).Ready = (*sit).Connected = false;                 (*sit).Ready = (*sit).Connected = false;
                          sit++;
                  }
                  else
                  {
                          // erase only if it's not a service in the config
                          sit = aes->Services.erase (sit);
                  }
         }         }
  
         nlinfo ("*:%d:* disconnected", aes->Id);         nlinfo ("*:%d:* disconnected", aes->Id);
Line 510 
Line 613 
         CNetManager::send ("AS", msgout, 0);         CNetManager::send ("AS", msgout, 0);
 */ */
  
          displayServices ();
  
         // broadcast the new state of this AES         // broadcast the new state of this AES
         CMessage msgout (CNetManager::getSIDA ("AS"), "AES_LIST");         CMessage msgout (CNetManager::getSIDA ("AS"), "AES_LIST");
         uint32 nbaes = 1;         uint32 nbaes = 1;
Line 522 
Line 627 
 { {
         // received an answer for a command, give it to all admin client         // received an answer for a command, give it to all admin client
  
          // get the aes with the appid
          CAdminExecutorService *aes = (CAdminExecutorService*) (uint) from->appId();
  
         // broadcast the message to the admin service         // broadcast the message to the admin service
         CMessage msgout (CNetManager::getSIDA ("AS"), "LOG");         CMessage msgout (CNetManager::getSIDA ("AS"), "XLOG");
         string log;         string log;
          uint32 sid;
          msgin.serial (sid);
         msgin.serial (log);         msgin.serial (log);
  
          msgout.serial (aes->Id);
          msgout.serial (sid);
         msgout.serial (log);         msgout.serial (log);
         CNetManager::send ("AS", msgout, 0);         CNetManager::send ("AS", msgout, 0);
 } }
Line 543 
Line 656 
  
         { "SAL", cbServiceAliasList },         { "SAL", cbServiceAliasList },
  
         { "LOG", cbLog },         { "XLOG", cbLog },
 }; };
  
  
Line 553 
Line 666 
 //////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////
  
 void errorMessage(string message, TSockId from, CCallbackNetBase &netbase) 
 { 
         CMessage msgout (netbase.getSIDA (), "ERR"); 
         msgout.serial (message); 
         netbase.send (msgout, from); 
 } 
  
 // //
 // A new admin client is connected. // A new admin client is connected.
 // //
Line 567 
Line 673 
 { {
         // new client, send him all out info about services         // new client, send him all out info about services
  
         nlinfo ("client %s is connected", from->asString().c_str());         nlinfo ("admin %s is connected", from->asString().c_str());
  
          CNetManager::getNetBase(serviceName)->authorizeOnly ("AUTH", from);
  }
  
  static void cbAuthenticateClient (CMessage& msgin, TSockId from, CCallbackNetBase &netbase)
  {
          //
          // Check the validity of the admin
          //
          
          string password;
          bool ok = false;
          try
          {
                  msgin.serial (password);
  
                  if (password == IService::ConfigFile.getVar("Password").asString())
                  {
                          // good authentification
                          ok = true;
                  }
          }
          catch (Exception &)
          {
                  // problem, eject him
          }
  
          if (ok)
          {
                  netbase.authorizeOnly (NULL, from);
                  nlinfo ("Admin authentification success");
          }
          else
          {
                  // bad auth => disconnect
                  netbase.disconnect (from);
                  nlwarning ("Bad admin authentification, tried password: '%s'", password.c_str());
                  return;
          }
  
         //         //
         // send the list of all the aes         // send the list of all the aes
Line 605 
Line 750 
                                                  
                         msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName);                         msgout.serial ((*sit).Id, (*sit).AliasName, (*sit).ShortName, (*sit).LongName);
                         msgout.serial ((*sit).Ready, (*sit).Connected, (*sit).InConfig);                         msgout.serial ((*sit).Ready, (*sit).Connected, (*sit).InConfig);
                          msgout.serialCont ((*sit).Commands);
                 }                 }
         }         }
         CNetManager::send ("AS", msgout, from);         CNetManager::send ("AS", msgout, from);
  
          displayServices ();
  
         //         //
         // send service alias list         // send service alias list
         //         //
  
          nlinfo("send SAL to admin startup");
  
         for (aesit = AdminExecutorServices.begin(); aesit != AdminExecutorServices.end(); aesit++)         for (aesit = AdminExecutorServices.begin(); aesit != AdminExecutorServices.end(); aesit++)
         {         {
                 CMessage msgout2 (CNetManager::getSIDA ("AS"), "SAL");                 CMessage msgout2 (CNetManager::getSIDA ("AS"), "SAL");
Line 634 
Line 784 
         if (aesit == AdminExecutorServices.end())         if (aesit == AdminExecutorServices.end())
         {         {
                 // don't find the aes, send an error message                 // don't find the aes, send an error message
                 errorMessage ("couldn't execute command, as didn't find the aes", from, netbase);                 messageToClient (0, "couldn't execute command, as didn't find the aes", from);
                 return;                 return;
         }         }
  
Line 657 
Line 807 
         if (aesit == AdminExecutorServices.end())         if (aesit == AdminExecutorServices.end())
         {         {
                 // don't find the aes, send an error message                 // don't find the aes, send an error message
                 errorMessage ("couldn't start service, as didn't find the aes", from, netbase);                 messageToClient (0, "couldn't start service, as didn't find the aes", from);
                 return;                 return;
         }         }
  
Line 677 
Line 827 
         AESIT aesit = findAdminExecutorService (aesid, false);         AESIT aesit = findAdminExecutorService (aesid, false);
         if (aesit == AdminExecutorServices.end())         if (aesit == AdminExecutorServices.end())
         {         {
                 errorMessage ("couldn't stop service, as didn't find the aes", from, netbase);                 messageToClient (0, "couldn't stop service, as didn't find the aes", from);
                 // don't find the aes, send an error message                 // don't find the aes, send an error message
                 return;                 return;
         }         }
Line 686 
Line 836 
         if (sit == (*aesit).Services.end())         if (sit == (*aesit).Services.end())
         {         {
                 // don't find the s, send an error message                 // don't find the s, send an error message
                 errorMessage ("couldn't stop service, as didn't find the service", from, netbase);                 messageToClient (0, "couldn't stop service, as didn't find the service", from);
                 return;                 return;
         }         }
  
Line 708 
Line 858 
         AESIT aesit = findAdminExecutorService (aesid, false);         AESIT aesit = findAdminExecutorService (aesid, false);
         if (aesit == AdminExecutorServices.end())         if (aesit == AdminExecutorServices.end())
         {         {
                 errorMessage ("couldn't stop service, as didn't find the aes", from, netbase);                 messageToClient (0, "couldn't stop service, as didn't find the aes", from);
                 // don't find the aes, send an error message                 // don't find the aes, send an error message
                 return;                 return;
         }         }
Line 717 
Line 867 
         if (sit == (*aesit).Services.end())         if (sit == (*aesit).Services.end())
         {         {
                 // don't find the s, send an error message                 // don't find the s, send an error message
                 errorMessage ("couldn't stop service, as didn't find the service", from, netbase);                 messageToClient (0, "couldn't stop service, as didn't find the service", from);
                 return;                 return;
         }         }
  
Line 752 
Line 902 
  
 TCallbackItem ClientCallbackArray[] = TCallbackItem ClientCallbackArray[] =
 { {
          { "AUTH", cbAuthenticateClient },
         { "SYS", cbExecuteSystemCommand },         { "SYS", cbExecuteSystemCommand },
         { "STARTS", cbStartService },         { "STARTS", cbStartService },
         { "STOPS", cbStopService },         { "STOPS", cbStopService },
Line 785 
Line 936 
                 //                 //
  
                 CConfigFile::CVar &host = ConfigFile.getVar ("AESHosts");                 CConfigFile::CVar &host = ConfigFile.getVar ("AESHosts");
                 for (sint i = 0 ; i < host.size (); i+=2)                 sint i;
                  for (i = 0 ; i < host.size (); i+=2)
                 {                 {
                         string serverAlias = host.asString(i);                         string serverAlias = host.asString(i);
                         string serverAddr = host.asString(i+1);                         string serverAddr = host.asString(i+1);
Line 821 
Line 973 
                         s.InConfig = true;                         s.InConfig = true;
                         (*aesit).Services.push_back (s);                         (*aesit).Services.push_back (s);
                 }                 }
         }                 displayServices ();
  
         bool                update () 
         { 
                 return true; 
         }         }
 }; };
  
Line 834 
Line 982 
 // AESAS is a client connection to the admin executor // AESAS is a client connection to the admin executor
  
 /// Naming Service /// Naming Service
 NLNET_SERVICE_MAIN (CAdminService, "AS", "admin_service", 49995, ClientCallbackArray); NLNET_SERVICE_MAIN (CAdminService, "AS", "admin_service", 49995, ClientCallbackArray, NELNS_CONFIG, NELNS_LOGS);


Legend:
Removed from v.1.5 
changed lines
 Added in v.1.14