Changeset 7f9c823 in nscp for modules


Ignore:
Timestamp:
11/08/09 23:24:31 (4 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
6672c56
Parents:
3b4097d
Message:

First attempt at serious boostification.
NOTICE! This is NOT a complete edition, it build and runs but many features are disabled and/or broken.
But we have working, sockets and mutexes and conversion functions from boost inside now and more to come...
Also started to build with CMake since it works better then boost.build

Location:
modules
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • modules/CheckDisk/CheckDisk.cpp

    rf0eb62d r7f9c823  
    680680  unsigned long long now = ((now_.dwHighDateTime * ((unsigned long long)MAXDWORD+1)) + (unsigned long long)now_.dwLowDateTime); 
    681681  time_t value = (now-finder.info.ullLastWriteTime)/10000000; 
    682   message = strEx::itos(value/60) + _T("&") + strEx::format_time_delta(gmtime(&value), format); 
     682  message = to_wstring(value/60) + _T("&") + strEx::format_time_delta(gmtime(&value), format); 
    683683  return NSCAPI::returnOK; 
    684684} 
  • modules/CheckDisk/stdafx.h

    rb0ae738 r7f9c823  
    3030#include <NSCAPI.h> 
    3131#include <NSCHelper.h> 
     32#include <nsc_module_wrapper.hpp> 
    3233 
    3334#ifdef MEMCHECK 
  • modules/CheckEventLog/CheckEventLog.cpp

    rd5356c1 r7f9c823  
    361361    return ret; 
    362362  } 
    363   SYSTEMTIME get_time(DWORD time) { 
     363  // SYSTEMTIME  
     364  boost::posix_time::ptime get_time(DWORD time) { 
    364365    FILETIME FileTime, LocalFileTime; 
    365366    SYSTEMTIME SysTime; 
     
    372373    FileTime.dwHighDateTime = (DWORD)(lgTemp >> 32); 
    373374 
     375    return boost::date_time::time_from_ftime<boost::posix_time::ptime>(FileTime); 
     376 
     377 
     378/* 
    374379    FileTimeToLocalFileTime(&FileTime, &LocalFileTime); 
    375380    FileTimeToSystemTime(&LocalFileTime, &SysTime); 
    376381    return SysTime; 
    377   } 
    378  
    379   SYSTEMTIME get_time_generated() { 
     382    */ 
     383  } 
     384 
     385  boost::posix_time::ptime get_time_generated() { 
    380386    return get_time(pevlr_->TimeGenerated); 
    381387  } 
    382   SYSTEMTIME get_time_written() { 
     388  boost::posix_time::ptime get_time_written() { 
    383389    return get_time(pevlr_->TimeWritten); 
    384390  } 
  • modules/CheckEventLog/stdafx.h

    rb0ae738 r7f9c823  
    3434 
    3535#include <NSCAPI.h> 
     36#include <nsc_module_wrapper.hpp> 
    3637#include <NSCHelper.h> 
    3738 
  • modules/CheckExternalScripts/CheckExternalScripts-2005.vcproj

    rf0eb62d r7f9c823  
    4949        Name="VCCLCompilerTool" 
    5050        AdditionalIncludeDirectories="../include;../../include" 
     51        PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_NEWALLOC;_STLP_DEBUG=1;USE_BOOST" 
    5152      /> 
    5253      <Tool 
     
    114115        Name="VCCLCompilerTool" 
    115116        AdditionalIncludeDirectories="../include;../../include" 
     117        PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_NEWALLOC;_STLP_DEBUG=1;USE_BOOST" 
    116118      /> 
    117119      <Tool 
     
    127129        Name="VCLinkerTool" 
    128130        AdditionalDependencies="ws2_32.lib ssleay32.lib libeay32.lib" 
     131      /> 
     132      <Tool 
     133        Name="VCALinkTool" 
     134      /> 
     135      <Tool 
     136        Name="VCManifestTool" 
     137      /> 
     138      <Tool 
     139        Name="VCXDCMakeTool" 
     140      /> 
     141      <Tool 
     142        Name="VCBscMakeTool" 
     143      /> 
     144      <Tool 
     145        Name="VCFxCopTool" 
     146      /> 
     147      <Tool 
     148        Name="VCAppVerifierTool" 
     149      /> 
     150      <Tool 
     151        Name="VCWebDeploymentTool" 
     152      /> 
     153      <Tool 
     154        Name="VCPostBuildEventTool" 
     155      /> 
     156    </Configuration> 
     157    <Configuration 
     158      Name="Debug|Win32" 
     159      OutputDirectory="$(SolutionDir)$(ConfigurationName)" 
     160      IntermediateDirectory="$(ConfigurationName)" 
     161      ConfigurationType="2" 
     162      CharacterSet="1" 
     163      > 
     164      <Tool 
     165        Name="VCPreBuildEventTool" 
     166      /> 
     167      <Tool 
     168        Name="VCCustomBuildTool" 
     169      /> 
     170      <Tool 
     171        Name="VCXMLDataGeneratorTool" 
     172      /> 
     173      <Tool 
     174        Name="VCWebServiceProxyGeneratorTool" 
     175      /> 
     176      <Tool 
     177        Name="VCMIDLTool" 
     178      /> 
     179      <Tool 
     180        Name="VCCLCompilerTool" 
     181        AdditionalIncludeDirectories="../include;../../include" 
     182        PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_NEWALLOC;_STLP_DEBUG=1;USE_BOOST" 
     183      /> 
     184      <Tool 
     185        Name="VCManagedResourceCompilerTool" 
     186      /> 
     187      <Tool 
     188        Name="VCResourceCompilerTool" 
     189      /> 
     190      <Tool 
     191        Name="VCPreLinkEventTool" 
     192      /> 
     193      <Tool 
     194        Name="VCLinkerTool" 
     195      /> 
     196      <Tool 
     197        Name="VCALinkTool" 
     198      /> 
     199      <Tool 
     200        Name="VCManifestTool" 
     201      /> 
     202      <Tool 
     203        Name="VCXDCMakeTool" 
     204      /> 
     205      <Tool 
     206        Name="VCBscMakeTool" 
     207      /> 
     208      <Tool 
     209        Name="VCFxCopTool" 
     210      /> 
     211      <Tool 
     212        Name="VCAppVerifierTool" 
     213      /> 
     214      <Tool 
     215        Name="VCWebDeploymentTool" 
     216      /> 
     217      <Tool 
     218        Name="VCPostBuildEventTool" 
     219      /> 
     220    </Configuration> 
     221    <Configuration 
     222      Name="Debug|x64" 
     223      OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" 
     224      IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" 
     225      ConfigurationType="2" 
     226      CharacterSet="1" 
     227      > 
     228      <Tool 
     229        Name="VCPreBuildEventTool" 
     230      /> 
     231      <Tool 
     232        Name="VCCustomBuildTool" 
     233      /> 
     234      <Tool 
     235        Name="VCXMLDataGeneratorTool" 
     236      /> 
     237      <Tool 
     238        Name="VCWebServiceProxyGeneratorTool" 
     239      /> 
     240      <Tool 
     241        Name="VCMIDLTool" 
     242      /> 
     243      <Tool 
     244        Name="VCCLCompilerTool" 
     245        AdditionalIncludeDirectories="../include;../../include" 
     246        PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_STLP_USE_NEWALLOC;_STLP_DEBUG=1;USE_BOOST" 
     247      /> 
     248      <Tool 
     249        Name="VCManagedResourceCompilerTool" 
     250      /> 
     251      <Tool 
     252        Name="VCResourceCompilerTool" 
     253      /> 
     254      <Tool 
     255        Name="VCPreLinkEventTool" 
     256      /> 
     257      <Tool 
     258        Name="VCLinkerTool" 
    129259      /> 
    130260      <Tool 
  • modules/CheckExternalScripts/stdafx.h

    rd5356c1 r7f9c823  
    3030#include <utils.h> 
    3131 
     32#include <boost/lexical_cast.hpp> 
     33 
    3234#include <NSCAPI.h> 
     35#include <nsc_module_wrapper.hpp> 
    3336#include <NSCHelper.h> 
    3437 
  • modules/CheckHelpers/stdafx.h

    rb0ae738 r7f9c823  
    2929 
    3030#include <NSCAPI.h> 
     31#include <nsc_module_wrapper.hpp> 
    3132#include <NSCHelper.h> 
    3233 
  • modules/CheckSystem/CheckSystem.cpp

    rf0eb62d r7f9c823  
    365365  } 
    366366  static std::wstring print_perf(__int64 value, std::wstring unit) { 
    367     return strEx::itos(value); 
     367    return to_wstring(value); 
    368368  } 
    369369  static std::wstring print_percent(int value) { 
    370     return strEx::itos(value) + _T("%"); 
     370    return to_wstring(value) + _T("%"); 
    371371  } 
    372372  static std::wstring key_prefix() { 
  • modules/CheckSystem/stdafx.h

    rb0ae738 r7f9c823  
    3535#include <list> 
    3636#include <NSCAPI.h> 
     37#include <nsc_module_wrapper.hpp> 
    3738#include <NSCHelper.h> 
    3839#include <config.h> 
  • modules/CheckTaskSched/stdafx.h

    r367bf20 r7f9c823  
    3535#include <NSCAPI.h> 
    3636#include <NSCHelper.h> 
     37#include <nsc_module_wrapper.hpp> 
    3738#include <checkHelpers.hpp> 
    3839#include <filter_framework.hpp> 
  • modules/CheckWMI/WMIQuery.h

    r1fc246c r7f9c823  
    101101    void setString(std::wstring a, std::wstring s) { 
    102102      string = s; 
    103       numeric = strEx::stoi64(s); 
     103      numeric = boost::lexical_cast<long long>(s); 
    104104      alias = a; 
    105105    } 
    106106    void setNumeric(std::wstring a, long long n) { 
    107107      numeric = n; 
    108       string = strEx::itos(n); 
     108      string = to_wstring(n); 
    109109      alias = a; 
    110110    } 
  • modules/CheckWMI/stdafx.h

    rb0ae738 r7f9c823  
    3535#include <NSCAPI.h> 
    3636#include <NSCHelper.h> 
     37#include <nsc_module_wrapper.hpp> 
    3738#include <checkHelpers.hpp> 
    3839#include <filter_framework.hpp> 
  • modules/DebugLogMetrics/stdafx.h

    r3692371 r7f9c823  
    3333#include <NSCAPI.h> 
    3434#include <NSCHelper.h> 
     35#include <nsc_module_wrapper.hpp> 
    3536 
    3637#ifdef MEMCHECK 
  • modules/FileLogger/stdafx.h

    rb0ae738 r7f9c823  
    2727#include <NSCAPI.h> 
    2828#include <NSCHelper.h> 
     29#include <nsc_module_wrapper.hpp> 
    2930#include <string> 
    3031#include <iostream> 
  • modules/LUAScript/stdafx.h

    r3f69109 r7f9c823  
    3030#include <NSCAPI.h> 
    3131#include <NSCHelper.h> 
     32#include <nsc_module_wrapper.hpp> 
    3233 
    3334#ifdef MEMCHECK 
  • modules/NRPEClient/NRPEClient.cpp

    r3b4097d r7f9c823  
    186186#endif 
    187187 
    188 using boost::asio::ip::tcp; 
    189188 
    190189int NRPEClient::commandLineExec(const TCHAR* command, const unsigned int argLen, TCHAR** args) { 
     
    246245  } 
    247246} 
     247/* 
    248248NRPEPacket NRPEClient::send_ssl(std::wstring host, int port, int timeout, NRPEPacket packet) 
    249249{ 
     
    251251  return send_nossl(host, port, timeout, packet); 
    252252#else 
     253   
    253254  initSSL(); 
    254255  simpleSSL::Socket socket(true); 
     
    261262  packet.readFrom(buffer.getBuffer(), buffer.getLength()); 
    262263  return packet; 
    263 #endif 
    264 } 
    265  
     264   
     265 
     266  boost::asio::ssl::context ctx(io_service, boost::asio::ssl::context::sslv23); 
     267  ctx.use_tmp_dh_file("d:\\nrpe_512.pem"); 
     268  ctx.set_verify_mode(boost::asio::ssl::context::verify_peer); 
     269  nrpe_ssl_socket socket(io_service, ctx, host, port); 
     270  //socket. 
     271 
     272#endif 
     273} 
     274*/ 
     275using boost::asio::ip::tcp; 
    266276 
    267277void set_result(boost::optional<boost::system::error_code>* a, boost::system::error_code b) 
     
    269279  a->reset(b); 
    270280}  
    271 template <typename MutableBufferSequence> 
    272 void read_with_timeout(tcp::socket& sock, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration) 
     281template <typename AsyncReadStream, typename RawSocket, typename MutableBufferSequence> 
     282void read_with_timeout(AsyncReadStream& sock, RawSocket& rawSocket, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration) 
    273283{ 
    274284  boost::optional<boost::system::error_code> timer_result; 
     
    286296      timer.cancel(); 
    287297    else if (timer_result) 
    288       sock.close(); 
     298      rawSocket.close(); 
    289299  } 
    290300 
     
    293303}  
    294304 
     305template <typename AsyncWriteStream, typename RawSocket, typename MutableBufferSequence> 
     306void write_with_timeout(AsyncWriteStream& sock, RawSocket& rawSocket, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration) 
     307{ 
     308  boost::optional<boost::system::error_code> timer_result; 
     309  boost::asio::deadline_timer timer(sock.io_service()); 
     310  timer.expires_from_now(duration); 
     311  timer.async_wait(boost::bind(set_result, &timer_result, _1)); 
     312 
     313  boost::optional<boost::system::error_code> read_result; 
     314  async_write(sock, buffers, boost::bind(set_result, &read_result, _1)); 
     315 
     316  sock.io_service().reset(); 
     317  while (sock.io_service().run_one()) 
     318  { 
     319    if (read_result) 
     320      timer.cancel(); 
     321    else if (timer_result) 
     322      rawSocket.close(); 
     323  } 
     324 
     325  if (*read_result) 
     326    throw boost::system::system_error(*read_result); 
     327} 
     328 
     329class nrpe_socket : public boost::noncopyable { 
     330public: 
     331  tcp::socket socket_; 
     332 
     333public: 
     334  nrpe_socket(boost::asio::io_service &io_service, std::wstring host, int port) : socket_(io_service) { 
     335    NSC_LOG_CRITICAL(_T("Looking up...")); 
     336    tcp::resolver resolver(io_service); 
     337    tcp::resolver::query query(to_string(host), to_string(port)); 
     338    //tcp::resolver::query query("www.medin.name", "80"); 
     339    //tcp::resolver::query query("test_server", "80"); 
     340 
     341    tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); 
     342    tcp::resolver::iterator end; 
     343 
     344    NSC_LOG_CRITICAL(_T("connecting...")); 
     345    boost::system::error_code error = boost::asio::error::host_not_found; 
     346    while (error && endpoint_iterator != end) 
     347    { 
     348      tcp::resolver::endpoint_type ep = *endpoint_iterator; 
     349      NSC_DEBUG_MSG_STD(_T("Attempting to connect to: ") + to_wstring(ep.address().to_string()) + _T(":") + to_wstring(ep.port())); 
     350      socket_.close(); 
     351      socket_.connect(*endpoint_iterator++, error); 
     352    } 
     353    NSC_LOG_CRITICAL(_T("Connected...")); 
     354    if (error) 
     355      throw boost::system::system_error(error); 
     356  } 
     357  ~nrpe_socket() { 
     358    socket_.close(); 
     359  } 
     360 
     361  void send(NRPEPacket &packet, boost::posix_time::seconds timeout) { 
     362    std::vector<char> buf(packet.getBufferLength()); 
     363    write_with_timeout(socket_, socket_, boost::asio::buffer(packet.getBuffer(), packet.getBufferLength()), timeout); 
     364  } 
     365  NRPEPacket recv(const NRPEPacket &packet, boost::posix_time::seconds timeout) { 
     366    std::vector<char> buf(packet.getBufferLength()); 
     367    read_with_timeout(socket_, socket_, boost::asio::buffer(buf), timeout); 
     368    return NRPEPacket(&buf[0], buf.size(), packet.getInternalBufferLength()); 
     369  } 
     370}; 
     371 
     372class nrpe_ssl_socket { 
     373 
     374private: 
     375  boost::asio::ssl::stream<boost::asio::ip::tcp::socket> socket_; 
     376public: 
     377  nrpe_ssl_socket(boost::asio::io_service &io_service, boost::asio::ssl::context &ctx, std::wstring host, int port) : socket_(io_service, ctx) { 
     378    NSC_LOG_CRITICAL(_T("Looking up...")); 
     379    tcp::resolver resolver(io_service); 
     380    //tcp::resolver::query query(to_string(host), to_string(port)); 
     381    tcp::resolver::query query("www.medin.name", "80"); 
     382    //tcp::resolver::query query("test_server", "80"); 
     383 
     384    tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); 
     385    tcp::resolver::iterator end; 
     386 
     387    boost::system::error_code error = boost::asio::error::host_not_found; 
     388    NSC_LOG_CRITICAL(_T("Connecting...")); 
     389    while (error && endpoint_iterator != end) 
     390    { 
     391      tcp::resolver::endpoint_type ep = *endpoint_iterator; 
     392      NSC_DEBUG_MSG_STD(_T("Attempting to connect to: ") + to_wstring(ep.address().to_string()) + _T(":") + to_wstring(ep.port())); 
     393      socket_.lowest_layer().close(); 
     394      socket_.lowest_layer().connect(*endpoint_iterator++, error); 
     395    } 
     396    if (error) 
     397      throw boost::system::system_error(error); 
     398    NSC_LOG_CRITICAL(_T("Connected...")); 
     399 
     400    NSC_LOG_CRITICAL(_T("Handshaking...")); 
     401    //socket_.handshake(boost::asio::ssl::stream_base::client); 
     402    socket_.handshake(boost::asio::ssl::stream_base::client); 
     403    NSC_LOG_CRITICAL(_T("Handshook...") + strEx::itos(error.value())); 
     404 
     405  } 
     406 
     407  void send(NRPEPacket &packet, boost::posix_time::seconds timeout) { 
     408    NSC_LOG_CRITICAL(_T("Writing...")); 
     409    std::vector<char> buf(packet.getBufferLength()); 
     410    write_with_timeout(socket_, socket_.lowest_layer(), boost::asio::buffer(packet.getBuffer(), packet.getBufferLength()), timeout); 
     411    NSC_LOG_CRITICAL(_T("Written...")); 
     412  } 
     413  NRPEPacket recv(const NRPEPacket &packet, boost::posix_time::seconds timeout) { 
     414    NSC_LOG_CRITICAL(_T("Reading...")); 
     415    std::vector<char> buf(packet.getBufferLength()); 
     416    read_with_timeout(socket_, socket_.lowest_layer(), boost::asio::buffer(buf), timeout); 
     417    return NRPEPacket(&buf[0], buf.size(), packet.getInternalBufferLength()); 
     418    NSC_LOG_CRITICAL(_T("Read...")); 
     419  } 
     420}; 
     421 
    295422NRPEPacket NRPEClient::send_nossl(std::wstring host, int port, int timeout, NRPEPacket packet) 
    296423{ 
    297424  boost::asio::io_service io_service; 
    298   tcp::resolver resolver(io_service); 
    299 //  tcp::resolver::query query("127.0.0.1", boost::lexical_cast<std::string>(port)); 
    300   tcp::resolver::query query("www.medin.name", "80"); 
    301  
    302   tcp::resolver::iterator endpoint_iterator = resolver.resolve(query); 
    303   tcp::resolver::iterator end; 
    304  
    305   tcp::socket socket(io_service); 
    306   boost::system::error_code error = boost::asio::error::host_not_found; 
    307   while (error && endpoint_iterator != end) 
    308   { 
    309     tcp::resolver::endpoint_type ep = *endpoint_iterator; 
    310     NSC_DEBUG_MSG_STD(_T("Connectiing to: ") + boost::lexical_cast<std::wstring>(ep.address().to_string()) + _T(":") + boost::lexical_cast<std::wstring>(ep.port())); 
    311     socket.close(); 
    312     socket.connect(*endpoint_iterator++, error); 
    313   } 
    314   if (error) 
    315     throw boost::system::system_error(error); 
    316  
    317   //for (;;) 
    318   { 
    319     std::vector<char> buf(packet.getBufferLength()); 
    320     boost::system::error_code error; 
    321  
    322     size_t len = socket.write_some(boost::asio::buffer(packet.getBuffer(), packet.getBufferLength()), error); 
    323     NSC_DEBUG_MSG_STD(_T("Error: ") + strEx::itos(error.value()) + _T(" wrote: ") + strEx::itos(len)); 
    324  
    325     read_with_timeout(socket, boost::asio::buffer(buf), boost::posix_time::seconds(5) ); 
    326     //len = socket.read_some(boost::asio::buffer(buf), error); 
    327     NSC_DEBUG_MSG_STD(_T("Error: ") + strEx::itos(error.value()) + _T(" read: ") + strEx::itos(len)); 
    328  
    329     if (error == boost::asio::error::eof) 
    330       ;//break; // Connection closed cleanly by peer. 
    331     else if (error) 
    332       throw boost::system::system_error(error); // Some other error. 
    333     packet.readFrom(&buf[0], buf.size()); 
    334   } 
    335  
    336  
    337  
     425  nrpe_socket socket(io_service, host, port); 
     426  socket.send(packet, boost::posix_time::seconds(timeout)); 
     427  return socket.recv(packet, boost::posix_time::seconds(timeout)); 
     428} 
     429 
     430NRPEPacket NRPEClient::send_ssl(std::wstring host, int port, int timeout, NRPEPacket packet) 
     431{ 
     432  boost::asio::io_service io_service; 
     433  boost::asio::ssl::context ctx(io_service, boost::asio::ssl::context::sslv23); 
     434  SSL_CTX_set_cipher_list(ctx.impl(), "ADH"); 
     435  ctx.use_tmp_dh_file("d:\\nrpe_512.pem"); 
     436  ctx.set_verify_mode(boost::asio::ssl::context::verify_none); 
     437  nrpe_ssl_socket socket(io_service, ctx, host, port); 
     438  socket.send(packet, boost::posix_time::seconds(timeout)); 
     439  return socket.recv(packet, boost::posix_time::seconds(timeout)); 
     440} 
    338441/* 
    339   simpleSocket::Socket socket(true); 
    340   socket.connect(host, port); 
    341   socket.sendAll(packet.getBuffer(), packet.getBufferLength()); 
    342   simpleSocket::DataBuffer buffer; 
    343   socket.readAll(buffer); 
    344   packet.readFrom(buffer.getBuffer(), buffer.getLength()); 
    345   */ 
    346   return packet; 
    347 } 
    348  
     442NRPEPacket NRPEClient::send_nossl(std::wstring host, int port, int timeout, NRPEPacket packet) 
     443{ 
     444  unsigned char dh512_p[] = { 
     445    0xCF, 0xFF, 0x65, 0xC2, 0xC8, 0xB4, 0xD2, 0x68, 0x8C, 0xC1, 0x80, 0xB1, 
     446    0x7B, 0xD6, 0xE8, 0xB3, 0x62, 0x59, 0x62, 0xED, 0xA7, 0x45, 0x6A, 0xF8, 
     447    0xE9, 0xD8, 0xBE, 0x3F, 0x38, 0x42, 0x5F, 0xB2, 0xA5, 0x36, 0x03, 0xD3, 
     448    0x06, 0x27, 0x81, 0xC8, 0x9B, 0x88, 0x50, 0x3B, 0x82, 0x3D, 0x31, 0x45, 
     449    0x2C, 0xB4, 0xC5, 0xA5, 0xBE, 0x6A, 0xE3, 0x2E, 0xA6, 0x86, 0xFD, 0x6A, 
     450    0x7E, 0x1E, 0x6A, 0x73, 
     451  }; 
     452  unsigned char dh512_g[] = { 0x02, }; 
     453 
     454  DH *dh_2 = DH_new(); 
     455  dh_2->p = BN_bin2bn(dh512_p, sizeof(dh512_p), NULL); 
     456  dh_2->g = BN_bin2bn(dh512_g, sizeof(dh512_g), NULL); 
     457 
     458  FILE *outfile = fopen("d:\\nrpe_512.pem", "w"); 
     459  PEM_write_DHparams(outfile, dh_2); 
     460  PEM_write_DHparams(stdout, dh_2); 
     461  fclose(outfile); 
     462 
     463  nrpe_socket socket(host, port); 
     464  socket.send(packet, boost::posix_time::seconds(timeout)); 
     465  return socket.recv(packet, boost::posix_time::seconds(timeout)); 
     466} 
     467*/ 
    349468 
    350469 
  • modules/NRPEClient/stdafx.h

    r3b4097d r7f9c823  
    3636#include <NSCAPI.h> 
    3737#include <NSCHelper.h> 
     38#include <nsc_module_wrapper.hpp> 
    3839 
    3940#include <boost/array.hpp> 
    40 #include <boost/date_time/posix_time/posix_time.hpp> 
    4141#include <boost/asio.hpp> 
     42#include <boost/optional.hpp> 
    4243#include <boost/bind.hpp> 
     44#include <boost/asio/ssl.hpp> 
    4345 
    4446#ifdef MEMCHECK 
  • modules/NRPEListener/stdafx.h

    rb0ae738 r7f9c823  
    3333#include <NSCAPI.h> 
    3434#include <NSCHelper.h> 
     35#include <nsc_module_wrapper.hpp> 
    3536 
    3637#ifdef MEMCHECK 
  • modules/NSCAAgent/stdafx.h

    r5ca3931 r7f9c823  
    3636#include <NSCAPI.h> 
    3737#include <NSCHelper.h> 
     38#include <nsc_module_wrapper.hpp> 
    3839#include <config.h> 
    3940#include <utils.h> 
  • modules/NSClientListener/stdafx.h

    rb0ae738 r7f9c823  
    3030#include <NSCAPI.h> 
    3131#include <NSCHelper.h> 
     32#include <nsc_module_wrapper.hpp> 
    3233 
    3334#ifdef MEMCHECK 
  • modules/SysTray/stdafx.h

    rb0ae738 r7f9c823  
    2727#include <string> 
    2828#include <NSCHelper.h> 
     29#include <nsc_module_wrapper.hpp> 
    2930#include <assert.h> 
    3031 
Note: See TracChangeset for help on using the changeset viewer.