root/trunk/pdns/pdns/rec_channel.hh @ 802

Revision 802, 1.0 KB (checked in by ahu, 7 years ago)

Big bag of VC++ fixes, mostly by Michel 'Wimpie' Stol

RevLine 
[593]1#ifndef PDNS_REC_CHANNEL
2#define PDNS_REC_CHANNEL
3#include <string>
[594]4#include <map>
[802]5#if !defined SOLARIS8 && !defined WIN32
[593]6#include <stdint.h>
[802]7#elif defined WIN32
8#include "utility.hh"
[765]9#endif
[798]10
11#ifndef WIN32
[633]12#include <sys/un.h>
[798]13#else
14// ?
15struct sockaddr_un {};
16#endif
[593]17
18/** this class is used both to send and answer channel commands to the PowerDNS Recursor */
19class RecursorControlChannel
20{
21public:
[798]22  RecursorControlChannel();
[633]23
[798]24  ~RecursorControlChannel();
[633]25
[593]26  int listen(const std::string& filename);
[631]27  void connect(const std::string& path, const std::string& filename);
[593]28
29  uint64_t getStat(const std::string& name);
[594]30
31  void send(const std::string& msg, const std::string* remote=0);
32  std::string recv(std::string* remote=0);
33
[593]34  int d_fd;
[633]35private:
36  struct sockaddr_un d_local;
[593]37};
38
[594]39class RecursorControlParser
40{
41public:
42  RecursorControlParser();
[631]43  static void nop(void){}
44  typedef void func_t(void);
45  std::string getAnswer(const std::string& question, func_t** func);
[594]46};
47
48
[593]49#endif
Note: See TracBrowser for help on using the browser.