source: nscp/modules/NSClientListener/NSClientSocket.h @ 1a5449e

0.4.00.4.10.4.2stable
Last change on this file since 1a5449e was 1a5449e, checked in by Michael Medin <michael@…>, 8 years ago

+ NRPE Support (very basic, no encryption, and nothing fancy)

  • Socket classes rewritten + Added NSCModuleHelper::getSettingsSection to the API
  • Property mode set to 100644
File size: 1.6 KB
Line 
1#pragma once
2#include "resource.h"
3#include <Thread.h>
4#include <Mutex.h>
5#include <WinSock2.h>
6#include <strEx.h>
7#include <charEx.h>
8#include <Socket.h>
9/**
10 * @ingroup NSClient++
11 * Socket responder class.
12 * This is a background thread that listens to the socket and executes incoming commands.
13 *
14 * @version 1.0
15 * first version
16 *
17 * @date 02-12-2005
18 *
19 * @author mickem
20 *
21 * @par license
22 * This code is absolutely free to use and modify. The code is provided "as is" with
23 * no expressed or implied warranty. The author accepts no liability if it causes
24 * any damage to your computer, causes your pet to fall ill, increases baldness
25 * or makes your car start emitting strange noises when you start it up.
26 * This code has no bugs, just undocumented features!
27 *
28 * @todo This is not very well written and should probably be reworked.
29 *
30 * @bug
31 *
32 */
33class NSClientSocket : public simpleSocket::Listener {
34private:
35
36public:
37        NSClientSocket();
38        virtual ~NSClientSocket();
39
40private:
41        virtual void onAccept(simpleSocket::Socket client);
42        std::string parseRequest(std::string buffer);
43};
44
45
46#define REQ_CLIENTVERSION       1       // Works fine!
47#define REQ_CPULOAD                     2       // Quirks
48#define REQ_UPTIME                      3       // Works fine!
49#define REQ_USEDDISKSPACE       4       // Works fine!
50#define REQ_SERVICESTATE        5       // Works fine!
51#define REQ_PROCSTATE           6       // Works fine!
52#define REQ_MEMUSE                      7       // Works fine!
53//#define REQ_COUNTER           8       // ! - not implemented Have to look at this, if anyone has a sample let me know...
54//#define REQ_FILEAGE           9       // ! - not implemented Dont know how to use
55//#define REQ_INSTANCES 10      // ! - not implemented Dont know how to use
56
57
Note: See TracBrowser for help on using the repository browser.