]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/StrandCoord.h
2 * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_IPC_STRAND_COORD_H
10 #define SQUID_IPC_STRAND_COORD_H
12 #include "ipc/forward.h"
13 #include "ipc/Messages.h"
14 #include "ipc/QuestionerId.h"
15 #include "SquidString.h"
20 /// Strand location details
24 StrandCoord(); ///< unknown location
25 StrandCoord(int akidId
, pid_t aPid
);
27 void pack(TypedMsgHdr
&hdrMsg
) const; ///< prepare for sendmsg()
28 void unpack(const TypedMsgHdr
&hdrMsg
); ///< from recvmsg()
31 int kidId
; ///< internal Squid process number
32 pid_t pid
; ///< OS process or thread identifier
34 String tag
; ///< optional unique well-known key (e.g., cache_dir path)
37 /// an IPC message carrying StrandCoord
41 explicit StrandMessage(const StrandCoord
&, QuestionerId
);
42 explicit StrandMessage(const TypedMsgHdr
&);
43 void pack(MessageType
, TypedMsgHdr
&) const;
45 /// creates and sends StrandMessage to Coordinator
46 static void NotifyCoordinator(MessageType
, const char *tag
);
49 QuestionerId
intendedRecepient() const { return qid
; }
52 StrandCoord strand
; ///< messageType-specific coordinates (e.g., sender)
54 /// For IPC requests/questions: The sender of this request.
55 /// For IPC responses/answers: The sender of the corresponding request.
61 #endif /* SQUID_IPC_STRAND_COORD_H */