Ignore:
Timestamp:
05/06/12 21:25:45 (2 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.1, 0.4.2
Children:
ef5832c
Parents:
53473f7
Message:
  • Refactored server internals to be more uniform (This is the first step to adding more protocols like NRDP and unit tests for check_nt)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/NRPEServer/NRPEServer.h

    r81e420c r9bd40e2  
    2121 
    2222#include <socket_helpers.hpp> 
    23 #include <nrpe/server/server.hpp> 
     23#include <nrpe/server/protocol.hpp> 
     24#include "handler_impl.hpp" 
    2425 
    2526NSC_WRAPPERS_MAIN(); 
    2627 
    27 class NRPEListener : public nscapi::impl::simple_plugin { 
    28 private: 
    29   typedef enum { 
    30     inject, script, script_dir, 
    31   } command_type; 
    32   struct command_data { 
    33     command_data() : type(inject) {} 
    34     command_data(command_type type_, std::wstring arguments_) : type(type_), arguments(arguments_) {} 
    35     command_type type; 
    36     std::wstring arguments; 
    37   }; 
    38  
    39   nrpe::server::server::connection_info info_; 
    40  
     28class NRPEServer : public nscapi::impl::simple_plugin { 
    4129public: 
    42   NRPEListener(); 
    43   virtual ~NRPEListener(); 
     30  NRPEServer(); 
     31  virtual ~NRPEServer(); 
    4432  // Module calls 
    4533  bool loadModule(); 
     
    6755  NSCAPI::nagiosReturn handleCommand(const strEx::blindstr command, const unsigned int argLen, wchar_t **char_args, std::wstring &message, std::wstring &perf); 
    6856  std::wstring getConfigurationMeta(); 
     57   
     58private: 
     59  socket_helpers::connection_info info_; 
    6960  boost::shared_ptr<nrpe::server::server> server_; 
     61  boost::shared_ptr<handler_impl> handler_; 
    7062 
    71 private: 
     63 
    7264  class NRPEException { 
    7365    std::wstring error_; 
Note: See TracChangeset for help on using the changeset viewer.