]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/Messages.h
4 * DEBUG: section 54 Interprocess Communication
8 #ifndef SQUID_IPC_MESSAGES_H
9 #define SQUID_IPC_MESSAGES_H
11 #include <sys/types.h>
12 #include <sys/socket.h>
14 /// Declare IPC messages. These classes translate between high-level
15 /// information and low-level TypedMsgHdr (i.e., struct msghdr) buffers.
22 typedef enum { mtNone
= 0, mtRegistration
, mtDescriptor
} MessageType
;
24 /// Strand location details
27 StrandCoord(); ///< unknown location
28 StrandCoord(int akidId
, pid_t aPid
); ///< from registrant
29 explicit StrandCoord(const TypedMsgHdr
&hdrMsg
); ///< from recvmsg()
30 void pack(TypedMsgHdr
&hdrMsg
) const; ///< prepare for sendmsg()
33 int kidId
; ///< internal Squid process number
34 pid_t pid
; ///< OS process or thread identifier
37 /// a [socket] descriptor information
41 explicit Descriptor(int fd
); ///< from descriptor sender
42 explicit Descriptor(const TypedMsgHdr
&hdrMsg
); ///< from recvmsg()
43 void pack(TypedMsgHdr
&hdrMsg
) const; ///< prepare for sendmsg()
46 int fd
; ///< raw descriptor value
53 #endif /* SQUID_IPC_MESSAGES_H */