]> git.proxmox.com Git - ceph.git/blob - ceph/src/common/admin_socket_client.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / common / admin_socket_client.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2011 New Dream Network
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14
15 #ifndef CEPH_COMMON_ADMIN_SOCKET_CLIENT_H
16 #define CEPH_COMMON_ADMIN_SOCKET_CLIENT_H
17
18 #include <stdint.h>
19 #include <string>
20
21 /* This is a simple client that talks to an AdminSocket using blocking I/O.
22 * We put a 5-second timeout on send and recv operations.
23 */
24 class AdminSocketClient
25 {
26 public:
27 AdminSocketClient(const std::string &path);
28 std::string do_request(std::string request, std::string *result);
29 std::string ping(bool *ok);
30 private:
31 std::string m_path;
32 };
33
34 const char* get_rand_socket_path();
35
36 #endif