]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/StrandCoord.h
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / ipc / StrandCoord.h
index e5c3d9fbb524f72cc30acc8b8f4e1d45d17ed8f7..133a711314f51cbb3a30324a714b73caec782911 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -10,6 +10,8 @@
 #define SQUID_IPC_STRAND_COORD_H
 
 #include "ipc/forward.h"
+#include "ipc/Messages.h"
+#include "ipc/QuestionerId.h"
 #include "SquidString.h"
 
 namespace Ipc
@@ -32,16 +34,26 @@ public:
     String tag; ///< optional unique well-known key (e.g., cache_dir path)
 };
 
-/// strand registration with Coordinator (also used as an ACK)
-class HereIamMessage
+/// an IPC message carrying StrandCoord
+class StrandMessage
 {
 public:
-    explicit HereIamMessage(const StrandCoord &strand); ///< from registrant
-    explicit HereIamMessage(const TypedMsgHdr &hdrMsg); ///< from recvmsg()
-    void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg()
+    explicit StrandMessage(const StrandCoord &, QuestionerId);
+    explicit StrandMessage(const TypedMsgHdr &);
+    void pack(MessageType, TypedMsgHdr &) const;
+
+    /// creates and sends StrandMessage to Coordinator
+    static void NotifyCoordinator(MessageType, const char *tag);
+
+    /// for Mine() tests
+    QuestionerId intendedRecepient() const { return qid; }
 
 public:
-    StrandCoord strand; ///< registrant coordinates and related details
+    StrandCoord strand; ///< messageType-specific coordinates (e.g., sender)
+
+    /// For IPC requests/questions: The sender of this request.
+    /// For IPC responses/answers: The sender of the corresponding request.
+    QuestionerId qid;
 };
 
 } // namespace Ipc;