source: nscp/modules/NRPEServer/nrpe_handler.hpp @ acf0660

0.4.00.4.10.4.2
Last change on this file since acf0660 was 40970de, checked in by Michael Medin <michael@…>, 3 years ago

Preliminary NSCA support (much is hard coded right now so only a PoC not a finished concept)

  • Property mode set to 100644
File size: 973 bytes
Line 
1#include <nrpe/nrpe_packet.hpp>
2#include <boost/tuple/tuple.hpp>
3
4namespace nrpe {
5        namespace server {
6                class handler {
7                        unsigned int payload_length_;
8                        bool allowArgs_;
9                        bool allowNasty_;
10                        bool noPerfData_;
11                public:
12                        handler(unsigned int payload_length)
13                                : payload_length_(payload_length)
14                        {}
15                        handler(const handler &other) {
16                                payload_length_ = other.payload_length_;
17                        }
18                        handler& operator= (const handler &other) {
19                                payload_length_ = other.payload_length_;
20                                return *this;
21                        }
22                        unsigned int get_payload_length() {
23                                return payload_length_;
24                        }
25                        nrpe::packet handle(nrpe::packet packet);
26                        /*
27                        nrpe::packet handle(nrpe::packet packet) {
28                                return nrpe::packet::create_response(1, _T("HELLO!"), payload_length_);
29                        }
30                        */
31                        nrpe::packet create_error(std::wstring msg) {
32                                return nrpe::packet::create_response(4, msg, payload_length_);
33                        }
34                };
35
36        }// namespace server
37} // namespace nrpe
Note: See TracBrowser for help on using the repository browser.