StrandCoord.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
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.
7  */
8 
9 /* DEBUG: section 54 Interprocess Communication */
10 
11 #include "squid.h"
12 #include "Debug.h"
13 #include "ipc/Messages.h"
14 #include "ipc/StrandCoord.h"
15 #include "ipc/TypedMsgHdr.h"
16 
18 {
19 }
20 
21 Ipc::StrandCoord::StrandCoord(int aKidId, pid_t aPid): kidId(aKidId), pid(aPid)
22 {
23 }
24 
25 void
27 {
28  hdrMsg.getPod(kidId);
29  hdrMsg.getPod(pid);
30  hdrMsg.getString(tag);
31 }
32 
34 {
35  hdrMsg.putPod(kidId);
36  hdrMsg.putPod(pid);
37  hdrMsg.putString(tag);
38 }
39 
41  strand(aStrand)
42 {
43 }
44 
46 {
47  hdrMsg.checkType(mtRegistration);
48  strand.unpack(hdrMsg);
49 }
50 
52 {
53  hdrMsg.setType(mtRegistration);
54  strand.pack(hdrMsg);
55 }
56 
void unpack(const TypedMsgHdr &hdrMsg)
from recvmsg()
Definition: StrandCoord.cc:26
Strand location details.
Definition: StrandCoord.h:19
void getPod(Pod &pod) const
load POD
Definition: TypedMsgHdr.h:50
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
Definition: StrandCoord.cc:33
void putPod(const Pod &pod)
store POD
Definition: TypedMsgHdr.h:52
void pack(TypedMsgHdr &hdrMsg) const
prepare for sendmsg()
Definition: StrandCoord.cc:51
StrandCoord()
unknown location
Definition: StrandCoord.cc:17
static pid_t pid
Definition: IcmpSquid.cc:35
void putString(const String &s)
store variable-length string
Definition: TypedMsgHdr.cc:133
struct msghdr with a known type, fixed-size I/O and control buffers
Definition: TypedMsgHdr.h:31
void checkType(int aType) const
throws if stored type is not aType
Definition: TypedMsgHdr.cc:84
HereIamMessage(const StrandCoord &strand)
from registrant
Definition: StrandCoord.cc:40
void getString(String &s) const
load variable-length string
Definition: TypedMsgHdr.cc:115
void setType(int aType)
sets message type; use MessageType enum
Definition: TypedMsgHdr.cc:90

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors