--- /dev/null
+/*
+ * $Id$
+ *
+ * DEBUG: section 54 Interprocess Communication
+ *
+ */
+
+
+#include "config.h"
+#include "ipc/Messages.h"
+#include "ipc/StrandSearch.h"
+#include "ipc/TypedMsgHdr.h"
+
+
+Ipc::StrandSearchRequest::StrandSearchRequest(): requestorId(-1), requestId(0)
+{
+}
+
+Ipc::StrandSearchRequest::StrandSearchRequest(const TypedMsgHdr &hdrMsg):
+ requestorId(-1), requestId(0)
+{
+ hdrMsg.checkType(mtStrandSearchRequest);
+ hdrMsg.getPod(requestorId);
+ hdrMsg.getPod(requestId);
+ hdrMsg.getString(tag);
+}
+
+void Ipc::StrandSearchRequest::pack(TypedMsgHdr &hdrMsg) const
+{
+ hdrMsg.setType(mtStrandSearchRequest);
+ hdrMsg.putPod(requestorId);
+ hdrMsg.putPod(requestId);
+ hdrMsg.putString(tag);
+}
+
+
+/* StrandSearchResponse */
+
+Ipc::StrandSearchResponse::StrandSearchResponse(int aRequestId,
+ const Ipc::StrandCoord &aStrand):
+ requestId(aRequestId), strand(aStrand)
+{
+}
+
+Ipc::StrandSearchResponse::StrandSearchResponse(const TypedMsgHdr &hdrMsg):
+ requestId(0)
+{
+ hdrMsg.checkType(mtStrandSearchResponse);
+ hdrMsg.getPod(requestId);
+ strand.unpack(hdrMsg);
+}
+
+void Ipc::StrandSearchResponse::pack(TypedMsgHdr &hdrMsg) const
+{
+ hdrMsg.setType(mtStrandSearchResponse);
+ hdrMsg.putPod(requestId);
+ strand.pack(hdrMsg);
+}
--- /dev/null
+/*
+ * $Id$
+ *
+ */
+
+#ifndef SQUID_IPC_STRAND_SEARCH_H
+#define SQUID_IPC_STRAND_SEARCH_H
+
+#include "ipc/forward.h"
+#include "ipc/StrandCoord.h"
+#include "SquidString.h"
+#include <sys/types.h>
+
+namespace Ipc
+{
+
+/// asynchronous strand search request
+class StrandSearchRequest
+{
+public:
+ StrandSearchRequest();
+ explicit StrandSearchRequest(const TypedMsgHdr &hdrMsg); ///< from recvmsg()
+ void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg()
+
+public:
+ int requestorId; ///< sender-provided return address
+ unsigned int requestId; ///< sender-provided for response:request matching
+ String tag; ///< set when looking for a matching StrandCoord::tag
+};
+
+/// asynchronous strand search response
+class StrandSearchResponse
+{
+public:
+ StrandSearchResponse(int requestId, const StrandCoord &strand);
+ explicit StrandSearchResponse(const TypedMsgHdr &hdrMsg); ///< from recvmsg()
+ void pack(TypedMsgHdr &hdrMsg) const; ///< prepare for sendmsg()
+
+public:
+ unsigned int requestId; ///< a copy of the StrandSearchRequest::requestId
+ StrandCoord strand; ///< answer matching StrandSearchRequest criteria
+};
+
+} // namespace Ipc;
+
+#endif /* SQUID_IPC_STRAND_SEARCH_H */