ICP.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 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 #ifndef SQUID_ICP_H
10 #define SQUID_ICP_H
11 
17 #include "base/RefCount.h"
18 #include "comm/forward.h"
19 #include "icp_opcode.h"
20 #include "ip/Address.h"
21 #include "LogTags.h"
22 #include "store_key_md5.h"
23 #include "StoreClient.h"
24 
25 class AccessLogEntry;
27 
29 
35 class icp_common_t {
36 public:
38  unsigned char opcode;
40  unsigned char version;
42  unsigned short length;
44  uint32_t reqnum;
45  uint32_t flags;
46  uint32_t pad;
48  uint32_t shostid;
49 
50  icp_common_t();
51  icp_common_t(char *buf, unsigned int len);
52 
53  void handleReply(char *buf, Ip::Address &from);
54  icp_opcode getOpCode() const;
55 
57  static icp_common_t *CreateMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad);
58 };
59 
64 class ICPState: public StoreClient
65 {
66 
67 public:
68  ICPState(icp_common_t &aHeader, HttpRequest *aRequest);
69  virtual ~ICPState();
70 
73  int fd;
74 
76  char *url;
77 
78 protected:
79  /* StoreClient API */
80  virtual LogTags *loggingTags() override;
81  virtual void fillChecklist(ACLFilledChecklist &) const override;
82 
84  bool confirmAndPrepHit(const StoreEntry &);
85 
87 };
88 
92 
94 HttpRequest* icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from);
95 
97 bool icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request);
98 
100 void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from, AccessLogEntryPointer);
101 
104 
106 void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd);
107 
110 
112 void icpHandleIcpV3(int, Ip::Address &, char *, int);
113 
115 void icpOpenPorts(void);
116 
118 void icpConnectionShutdown(void);
119 
121 void icpClosePorts(void);
122 
124 int icpSetCacheKey(const cache_key * key);
125 
127 const cache_key *icpGetCacheKey(const char *url, int reqnum);
128 
129 #endif /* SQUID_ICP_H */
130 
Definition: ICP.h:64
icp_common_t()
Definition: icp_v2.cc:107
Comm::ConnectionPointer icpIncomingConn
Definition: icp_v2.cc:102
PF icpHandleUdp
Definition: ICP.h:109
Ip::Address from
Definition: ICP.h:75
icp_opcode icpGetCommonOpcode()
Definition: icp_v2.cc:400
const cache_key * icpGetCacheKey(const char *url, int reqnum)
Definition: icp_v2.cc:886
unsigned char cache_key
Store key.
Definition: forward.h:29
bool confirmAndPrepHit(const StoreEntry &)
either confirms and starts processing a cache hit or returns false
Definition: icp_v2.cc:158
void icpConnectionShutdown(void)
Definition: icp_v2.cc:791
unsigned char version
Definition: ICP.h:40
virtual void fillChecklist(ACLFilledChecklist &) const override
configure the ACL checklist with the current transaction state
Definition: icp_v2.cc:182
int fd
Definition: ICP.h:73
void handleReply(char *buf, Ip::Address &from)
Definition: icp_v2.cc:553
unsigned short length
Definition: ICP.h:42
bool icpAccessAllowed(Ip::Address &from, HttpRequest *icp_request)
Definition: icp_v2.cc:468
int icpSetCacheKey(const cache_key *key)
Definition: icp_v2.cc:873
uint32_t reqnum
Definition: ICP.h:44
void icpOpenPorts(void)
Definition: icp_v2.cc:708
unsigned char opcode
Definition: ICP.h:38
void icpClosePorts(void)
Definition: icp_v2.cc:816
char * url
Definition: ICP.h:76
void PF(int, void *)
Definition: forward.h:18
icp_opcode
Definition: icp_opcode.h:13
Comm::ConnectionPointer icpOutgoingConn
Definition: icp_v2.cc:104
icp_common_t header
Definition: ICP.h:71
Ip::Address theIcpPublicHostID
Definition: stub_icp.cc:30
virtual ~ICPState()
Definition: icp_v2.cc:151
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
HttpRequest * icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from)
Definition: icp_v2.cc:490
void const char * buf
Definition: stub_helper.cc:16
uint32_t flags
Definition: ICP.h:45
void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from, AccessLogEntryPointer)
Definition: icp_v2.cc:442
uint32_t pad
Definition: ICP.h:46
AccessLogEntryPointer al
Definition: ICP.h:86
icp_opcode getOpCode() const
Definition: icp_v2.cc:132
uint32_t shostid
Definition: ICP.h:48
void icpHandleIcpV3(int, Ip::Address &, char *, int)
Definition: icp_v3.cc:88
void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd)
Definition: icp_v2.cc:452
HttpRequest * request
Definition: ICP.h:72
virtual LogTags * loggingTags() override
Definition: icp_v2.cc:173
RefCount< AccessLogEntry > AccessLogEntryPointer
Definition: ICP.h:26
ICPState(icp_common_t &aHeader, HttpRequest *aRequest)
Definition: icp_v2.cc:142
static icp_common_t * CreateMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad)
Definition: icp_v2.cc:295
A StoreEntry::getPublic*() caller.
Definition: StoreClient.h:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors