]>
Commit | Line | Data |
---|---|---|
8822ebee | 1 | /* |
bbc27441 AJ |
2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
3 | * | |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
8822ebee AR |
7 | */ |
8 | ||
9 | #ifndef SQUID_IPC_STRAND_COORD_H | |
10 | #define SQUID_IPC_STRAND_COORD_H | |
11 | ||
12 | #include "ipc/forward.h" | |
254912f3 | 13 | #include "SquidString.h" |
8822ebee AR |
14 | |
15 | namespace Ipc | |
16 | { | |
17 | ||
18 | /// Strand location details | |
19 | class StrandCoord | |
20 | { | |
21 | public: | |
22 | StrandCoord(); ///< unknown location | |
254912f3 AR |
23 | StrandCoord(int akidId, pid_t aPid); |
24 | ||
8822ebee | 25 | void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg() |
254912f3 | 26 | void unpack(const TypedMsgHdr &hdrMsg); ///< from recvmsg() |
8822ebee AR |
27 | |
28 | public: | |
29 | int kidId; ///< internal Squid process number | |
30 | pid_t pid; ///< OS process or thread identifier | |
254912f3 AR |
31 | |
32 | String tag; ///< optional unique well-known key (e.g., cache_dir path) | |
8822ebee AR |
33 | }; |
34 | ||
254912f3 AR |
35 | /// strand registration with Coordinator (also used as an ACK) |
36 | class HereIamMessage | |
37 | { | |
38 | public: | |
39 | explicit HereIamMessage(const StrandCoord &strand); ///< from registrant | |
40 | explicit HereIamMessage(const TypedMsgHdr &hdrMsg); ///< from recvmsg() | |
41 | void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg() | |
42 | ||
43 | public: | |
44 | StrandCoord strand; ///< registrant coordinates and related details | |
45 | }; | |
46 | ||
8822ebee AR |
47 | } // namespace Ipc; |
48 | ||
49 | #endif /* SQUID_IPC_STRAND_COORD_H */ | |
f53969cc | 50 |