]> git.ipfire.org Git - thirdparty/squid.git/blame - src/ipc/StrandCoord.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / ipc / StrandCoord.h
CommitLineData
8822ebee 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
bbc27441
AJ
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
15namespace Ipc
16{
17
18/// Strand location details
19class StrandCoord
20{
21public:
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
28public:
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)
36class HereIamMessage
37{
38public:
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
43public:
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