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 "comm/forward.h"
18 #include "icp_opcode.h"
19 #include "ip/Address.h"
20 #include "LogTags.h"
21 #include "store_key_md5.h"
22 #include "StoreClient.h"
23 
24 class HttpRequest;
25 
31 class icp_common_t {
32 public:
34  unsigned char opcode;
36  unsigned char version;
38  unsigned short length;
40  uint32_t reqnum;
41  uint32_t flags;
42  uint32_t pad;
44  uint32_t shostid;
45 
46  icp_common_t();
47  icp_common_t(char *buf, unsigned int len);
48 
49  void handleReply(char *buf, Ip::Address &from);
50  icp_opcode getOpCode() const;
51 
53  static icp_common_t *CreateMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad);
54 };
55 
60 class ICPState
61 {
62 
63 public:
64  ICPState(icp_common_t &aHeader, HttpRequest *aRequest);
65  virtual ~ICPState();
68  int fd;
69 
71  char *url;
72 };
73 
75 struct icpUdpData {
76 
79 
80  void *msg;
81  size_t len;
83 #ifndef LESS_TIMING
84 
85  struct timeval start;
86 #endif
87 
89 
90  struct timeval queue_time;
91 };
92 
96 
98 HttpRequest* icpGetRequest(char *url, int reqnum, int fd, Ip::Address &from);
99 
101 bool icpAccessAllowed(Ip::Address &from, HttpRequest * icp_request);
102 
104 void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from);
105 
108 
110 int icpUdpSend(int, const Ip::Address &, icp_common_t *, const LogTags &, int);
111 
114 
116 void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd);
117 
120 
123 
125 void icpHandleIcpV3(int, Ip::Address &, char *, int);
126 
129 
131 void icpOpenPorts(void);
132 
134 void icpConnectionShutdown(void);
135 
137 void icpClosePorts(void);
138 
140 int icpSetCacheKey(const cache_key * key);
141 
143 const cache_key *icpGetCacheKey(const char *url, int reqnum);
144 
145 #endif /* SQUID_ICP_H */
146 
Definition: ICP.h:60
icp_common_t()
Definition: icp_v2.cc:76
Comm::ConnectionPointer icpIncomingConn
Definition: icp_v2.cc:71
PF icpHandleUdp
Definition: ICP.h:119
Ip::Address from
Definition: ICP.h:70
icp_opcode icpGetCommonOpcode()
Definition: icp_v2.cc:352
const cache_key * icpGetCacheKey(const char *url, int reqnum)
Definition: icp_v2.cc:829
unsigned char cache_key
Store key.
Definition: forward.h:29
Definition: ICP.h:75
struct _request * request(char *urlin)
Definition: tcp-banger2.c:291
void icpConnectionShutdown(void)
Definition: icp_v2.cc:734
unsigned char version
Definition: ICP.h:36
int fd
Definition: ICP.h:68
void handleReply(char *buf, Ip::Address &from)
Definition: icp_v2.cc:496
unsigned short length
Definition: ICP.h:38
bool icpAccessAllowed(Ip::Address &from, HttpRequest *icp_request)
Definition: icp_v2.cc:411
int icpSetCacheKey(const cache_key *key)
Definition: icp_v2.cc:816
uint32_t reqnum
Definition: ICP.h:40
void icpOpenPorts(void)
Definition: icp_v2.cc:651
size_t len
Definition: ICP.h:81
PF icpUdpSendQueue
Definition: ICP.h:122
int icpCheckUdpHit(StoreEntry *, HttpRequest *request)
Definition: icp_v2.cc:328
unsigned char opcode
Definition: ICP.h:34
void icpClosePorts(void)
Definition: icp_v2.cc:759
char * url
Definition: ICP.h:71
void PF(int, void *)
Definition: forward.h:18
LogTags logcode
Definition: ICP.h:88
icp_opcode
Definition: icp_opcode.h:13
Comm::ConnectionPointer icpOutgoingConn
Definition: icp_v2.cc:73
icp_common_t header
Definition: ICP.h:66
Ip::Address theIcpPublicHostID
Definition: stub_icp.cc:26
struct timeval queue_time
Definition: ICP.h:90
void icpCreateAndSend(icp_opcode, int flags, char const *url, int reqnum, int pad, int fd, const Ip::Address &from)
Definition: icp_v2.cc:388
void * msg
Definition: ICP.h:80
virtual ~ICPState()
Definition: icp_v2.cc:120
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:433
void const char * buf
Definition: stub_helper.cc:16
uint32_t flags
Definition: ICP.h:41
uint32_t pad
Definition: ICP.h:42
int icpUdpSend(int, const Ip::Address &, icp_common_t *, const LogTags &, int)
Definition: icp_v2.cc:277
icp_opcode getOpCode() const
Definition: icp_v2.cc:101
uint32_t shostid
Definition: ICP.h:44
Ip::Address address
IP address for the remote end. Because we reply to packets from unknown non-peers.
Definition: ICP.h:78
void icpHandleIcpV3(int, Ip::Address &, char *, int)
Definition: icp_v3.cc:84
void icpDenyAccess(Ip::Address &from, char *url, int reqnum, int fd)
Definition: icp_v2.cc:395
icpUdpData * next
Definition: ICP.h:82
HttpRequest * request
Definition: ICP.h:67
LogTags icpLogFromICPCode(icp_opcode opcode)
Definition: icp_v2.cc:365
struct timeval start
Definition: ICP.h:85
ICPState(icp_common_t &aHeader, HttpRequest *aRequest)
Definition: icp_v2.cc:111
static icp_common_t * CreateMessage(icp_opcode opcode, int flags, const char *url, int reqnum, int pad)
Definition: icp_v2.cc:232

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors