summaryrefslogtreecommitdiffstats
path: root/src/librbd/migration/Types.h
blob: 244dc28b774924d7f7a1129e593c2cfdc4622d35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#ifndef CEPH_LIBRBD_MIGRATION_TYPES_H
#define CEPH_LIBRBD_MIGRATION_TYPES_H

#include <string>
#include <utility>

namespace librbd {
namespace migration {

enum UrlScheme {
  URL_SCHEME_HTTP,
  URL_SCHEME_HTTPS,
};

struct UrlSpec {
  UrlSpec() {}
  UrlSpec(UrlScheme scheme, const std::string& host, const std::string& port,
          const std::string& path)
    : scheme(scheme), host(host), port(port), path(path) {
  }

  UrlScheme scheme = URL_SCHEME_HTTP;
  std::string host;
  std::string port = "80";
  std::string path = "/";

};

inline bool operator==(const UrlSpec& lhs, const UrlSpec& rhs) {
  return (lhs.scheme == rhs.scheme &&
          lhs.host == rhs.host &&
          lhs.port == rhs.port &&
          lhs.path == rhs.path);
}

} // namespace migration
} // namespace librbd

#endif // CEPH_LIBRBD_MIGRATION_TYPES_H