]>
Commit | Line | Data |
---|---|---|
1bac0258 AR |
1 | /* |
2 | * $Id$ | |
3 | * | |
4 | * DEBUG: section 54 Interprocess Communication | |
5 | * | |
6 | */ | |
7 | ||
f7f3304a | 8 | #include "squid.h" |
254912f3 | 9 | #include "Debug.h" |
1bac0258 | 10 | #include "ipc/Messages.h" |
8822ebee | 11 | #include "ipc/StrandCoord.h" |
1bac0258 AR |
12 | #include "ipc/TypedMsgHdr.h" |
13 | ||
1bac0258 AR |
14 | Ipc::StrandCoord::StrandCoord(): kidId(-1), pid(0) |
15 | { | |
16 | } | |
17 | ||
18 | Ipc::StrandCoord::StrandCoord(int aKidId, pid_t aPid): kidId(aKidId), pid(aPid) | |
19 | { | |
20 | } | |
21 | ||
254912f3 AR |
22 | void |
23 | Ipc::StrandCoord::unpack(const TypedMsgHdr &hdrMsg) | |
1bac0258 | 24 | { |
254912f3 AR |
25 | hdrMsg.getPod(kidId); |
26 | hdrMsg.getPod(pid); | |
27 | hdrMsg.getString(tag); | |
1bac0258 AR |
28 | } |
29 | ||
30 | void Ipc::StrandCoord::pack(TypedMsgHdr &hdrMsg) const | |
254912f3 AR |
31 | { |
32 | hdrMsg.putPod(kidId); | |
33 | hdrMsg.putPod(pid); | |
254912f3 AR |
34 | hdrMsg.putString(tag); |
35 | } | |
36 | ||
254912f3 | 37 | Ipc::HereIamMessage::HereIamMessage(const StrandCoord &aStrand): |
9199139f | 38 | strand(aStrand) |
254912f3 AR |
39 | { |
40 | } | |
41 | ||
42 | Ipc::HereIamMessage::HereIamMessage(const TypedMsgHdr &hdrMsg) | |
43 | { | |
44 | hdrMsg.checkType(mtRegistration); | |
45 | strand.unpack(hdrMsg); | |
46 | } | |
47 | ||
48 | void Ipc::HereIamMessage::pack(TypedMsgHdr &hdrMsg) const | |
1bac0258 | 49 | { |
8822ebee | 50 | hdrMsg.setType(mtRegistration); |
254912f3 | 51 | strand.pack(hdrMsg); |
1bac0258 | 52 | } |