]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #ifndef CEPH_MGR_MGRSESSION_H | |
5 | #define CEPH_MGR_MGRSESSION_H | |
6 | ||
7 | #include "common/RefCountedObj.h" | |
8 | #include "common/entity_name.h" | |
9 | #include "msg/msg_types.h" | |
92f5a8d4 | 10 | #include "MgrCap.h" |
7c673cae FG |
11 | |
12 | ||
13 | /** | |
14 | * Session state associated with the Connection. | |
15 | */ | |
16 | struct MgrSession : public RefCountedObject { | |
17 | uint64_t global_id = 0; | |
18 | EntityName entity_name; | |
19 | entity_inst_t inst; | |
20 | ||
31f18b77 FG |
21 | int osd_id = -1; ///< osd id (if an osd) |
22 | ||
92f5a8d4 | 23 | MgrCap caps; |
7c673cae | 24 | |
3efd9988 FG |
25 | std::set<std::string> declared_types; |
26 | ||
92f5a8d4 | 27 | const entity_addr_t& get_peer_addr() const { |
11fdf7f2 TL |
28 | return inst.addr; |
29 | } | |
9f95a23c TL |
30 | |
31 | private: | |
32 | FRIEND_MAKE_REF(MgrSession); | |
33 | explicit MgrSession(CephContext *cct) : RefCountedObject(cct) {} | |
34 | ~MgrSession() override = default; | |
7c673cae FG |
35 | }; |
36 | ||
9f95a23c | 37 | using MgrSessionRef = ceph::ref_t<MgrSession>; |
7c673cae FG |
38 | |
39 | ||
40 | #endif |