/*****************************************************************************/ /* ProxyStruct.h 08-AUG-1998 MGD initial */ /*****************************************************************************/ #ifndef PROXYSTRUCT_H_LOADED #define PROXYSTRUCT_H_LOADED 1 #include #include #include "enamel.h" #include "auth.h" #include "config.h" #include "net.h" #include "odsstruct.h" #include "proxytunnel.h" #ifndef __VAX # pragma nomember_alignment #endif /* forward references */ typedef struct RequestStruct REQUEST_STRUCT; typedef struct ServiceStruct SERVICE_STRUCT; /********************/ /* proxy accounting */ /********************/ #ifndef __VAX # pragma member_alignment __save # pragma member_alignment #endif #define PROXY_ACCOUNTING_STATUS_STRING_SIZE 128 #define TUNNEL_COUNT_MAX 5 typedef struct ProxyAccountingStruct PROXY_ACCOUNTING_STRUCT; struct ProxyAccountingStruct { BOOL CacheEnabled, FreeSpaceAvailable, ServingEnabled; int CacheReadCount, CacheRead304Count, CacheWriteCount, ConnectIpv4Count, ConnectIpv6Count, ConnectPersistCount, ConnectPersistFull, ConnectPersistMax, ConnectPersistPeak, FtpCount, FtpDeleCount, FtpDosCount, FtpListCount, FtpLoginFailCount, FtpRetrCount, FtpStorCount, FtpUnixCount, FtpUnknownCount, FtpVmsCount, /* ipv4/ipv6 -> ipv4/ipv6 */ GatewayIpvCount[2][2], /* http/https -> http/https/ftp */ GatewaySchemeCount[2][3], MethodConnectCount, MethodDeleteCount, MethodExtensionCount, MethodGetCount, MethodHeadCount, MethodOptionsCount, MethodPostCount, MethodPutCount, MethodSshCount, MethodTraceCount, MethodWebDavCopyCount, MethodWebDavLockCount, MethodWebDavMkColCount, MethodWebDavMoveCount, MethodWebDavPropFindCount, MethodWebDavPropPatchCount, MethodWebDavUnLockCount, PrevFileCount, RequestCannotCacheCount, ResponseCannotCacheCount, /* [service-in][proxy-out] */ TunnelCount[TUNNEL_COUNT_MAX][TUNNEL_COUNT_MAX], TunnelCurrent, Verify200Count, Verify403Count, Verify404Count, VerifyCurrentCount, VerifyFindRecordCount, VerifyFullCount, VerifySetRecordCount; unsigned long /* count of bytes received from proxied server */ BytesCacheRx [2], /* count of bytes sent to proxied server */ BytesCacheTx [2], /* bytes received from proxied server - not cacheable */ BytesCannotCacheRx [2], /* bytes sent to proxied server - not cacheable */ BytesCannotCacheTx [2], /* count of bytes in cache-serviced request header */ BytesRawRx [2], /* count of bytes in cache-serviced response */ BytesRawTx [2], /* HTTP status status code counts from cache */ CacheStatusCodeCount [6], /* HTTP status status code counts from network */ NetStatusCodeCount [6]; char StatusString [PROXY_ACCOUNTING_STATUS_STRING_SIZE]; }; #ifndef __VAX # pragma member_alignment __restore #endif /**************************************/ /* proxy->server connection structure */ /**************************************/ typedef struct ProxyConnectStruct PROXY_CONNECT; struct ProxyConnectStruct { LIST_ENTRY ListEntry; int /* how many times the TCP/IP connection has been (re)used */ ConnectionCount, /* server tick-second when the connection was placed on the list */ EntryTickSecond; unsigned short /* connect port at remote server */ ConnectPort, /* socket channel */ ProxyChannel; IPADDRESS /* address of remote server */ ConnectIpAddress; }; /**************************/ /* proxy cache structures */ /**************************/ /* i.e. originated and works with any after v9.0.0 (previously v6.0.0) */ #define PROXY_CACHE_FILE_VERSION 0x90000 typedef struct ProxyCacheDescrStruct PROXY_CACHE_DESCR; struct ProxyCacheDescrStruct { int CacheVersion, UrlLength, HeaderLength; }; typedef struct ProxyCacheFileQioStruct PROXY_CACHE_FILE_QIO; struct ProxyCacheFileQioStruct { BOOL EndOfFile; int AdjustBuffer, AllocatedVbn, BlockNumber, BufferCount, BufferSize, EndOfFileVbn, FirstFreeByte, SizeInBytes; unsigned short AcpChannel, QioChannel; unsigned long BdtBinTime [2], CdtBinTime [2], EdtBinTime [2], RdtBinTime [2]; char *BufferPtr; char FileName [40]; ACPQIO_ASC_DATES AscDates; ACPQIO_RECORD_ATTRIBUTES RecAttr; ATRDEF FileAtr [7]; struct dsc$descriptor FibDsc, FileNameDsc; IO_SB IOsb; #ifdef ODS_EXTENDED /* only use the local ENAMEL.H FIB definition when necessary */ # ifdef ENAMEL_FIBDEF struct enamel_fibdef Fib; # else FIBDEF Fib; # endif #else /* ODS_EXTENDED */ FIBDEF Fib; #endif /* ODS_EXTENDED */ }; /*****************************************/ /* reverse proxy verification structures */ /*****************************************/ #define PROXY_VERIFY_MAX_AUTH_LENGTH 96 typedef struct ProxyVerifyRecord PROXYVERIFY_RECORD; struct ProxyVerifyRecord { int AuthorizationStringLength, VerifyAttemptCount; unsigned long SourceRealm; char AuthorizationString [PROXY_VERIFY_MAX_AUTH_LENGTH+1], HttpdPrcNam [15+1], RealmName [AUTH_MAX_REALM_GROUP_LENGTH+1], RemoteUser [AUTH_MAX_USERNAME_LENGTH+1]; }; typedef struct ProxyVerifyGblSecStruct PROXYVERIFY_GBLSEC; struct ProxyVerifyGblSecStruct { unsigned long GblSecVersion, GblSecLength; int RecordCount; unsigned long SinceBinTime [2]; /* verify records are stored from this point onwards */ char RecordPool []; }; /************************/ /* proxy task structure */ /************************/ #ifndef __VAX # pragma member_alignment __save # pragma member_alignment #endif /* include to get the GZIP_COMPRESS structure */ #define GZIP_COMPRESS_ONLY #include "gzip.h" #undef GZIP_COMPRESS_ONLY typedef struct ProxyTaskStruct PROXY_TASK; struct ProxyTaskStruct { BOOL WatchItem, CannotCache, FtpDirList, FtpHasVersion, FtpListAlt, FtpListHide, FtpListRaw, FtpStorDone, FtpTypeDone, ParseInUse, PersistentRequest, PersistentResponse, ProxyAffinityInUse, ProxyCacheBeyondHeader, ProxyCacheFileExisted, ProxyCacheSuitable, ProxySslHttpRequest, ResponseHeaderSent, RequestAuthorization, RequestNotFromCache, ResponseCacheControlMaxAgeZero, ResponseCacheControlMustReval, ResponseCacheControlNoCache, ResponseCacheControlNoStore, ResponseCacheControlNoTransform, ResponseCacheControlPrivate, ResponseCacheControlProxyReval, ResponseCacheControlPublic, ResponseContentEncodingGzip, ResponseContentEncodingUnknown, ResponseContentTypeMultipart, ResponseContentTypeText, ResponseChunkedEnd, ResponseChunkedEol, ResponseChunkedEot, ResponseChunkedInit, ResponseConnectionClose, ResponseConnectionKeepAlive, ResponseKeepAlive, ResponseNegative, ResponseNoCache, ResponseTransferEncodingChunked, ResponseTransferEncodingUnsupported, ResponseUpgradeWebSocket, ResponseVaryUnsupported, TunnelEstablished, TunnelRequestGenerated; int ChainIpPort, ConnectPort, Ftp230Length, FtpCommandCount, FtpCommandSize, FtpFilePathLength, FtpFileSystem, FtpResponseClass, FtpResponseCode, FtpResponseCount, FtpResponseLineCount, FtpResponseRemaining, FtpResponseSize, FtpSpecific, FtpState, HttpMethod, ConnectionCount, ProxyCacheFileNameLength, ProxyCacheFileSizeInBytes, ProxyCacheLastModifiedHours, ProxyCacheReadBytes, ProxyLookupRetryCount, ProxyTunnel, QueuedBodyRead, RebuiltRequestLength, RebuiltResponseLength, RequestHostPortLength, RequestHttpMethod, RequestHttpVersion, RequestPort, RequestScheme, ResponseBodyLength, ResponseBufferCount, ResponseBufferCacheCount, ResponseBufferNetCount, ResponseBufferRemaining, ResponseBufferSize, ResponseBytes, ResponseCacheControlMaxAge, ResponseCacheControlSMaxAge, ResponseChunkedCount, ResponseChunkedSize, ResponseChunkedNewlineCount, ResponseConsecutiveNewLineCount, ResponseContentLength, ResponseHeaderLength, ResponseHttpVersion, ResponseStatusCode; unsigned short FtpDataIpPort; unsigned long BytesRawRx [2], BytesRawTx [2], ProxyCacheFileCdt [2], ResponseExpiresBinTime [2], ResponseLastModifiedBinTime [2]; char *ChainHostPortPtr, *ConnectHostPortPtr, *Ftp230Ptr, *FtpCommandPtr, *FtpContentTypePtr, *FtpFileSystemPtr, *FtpFilePathPtr, *FtpNextResponsePtr, *FtpResponsePtr, *FtpResponseCurrentPtr, *FtpWildPtr, *RebuiltRequestPtr, *RebuiltResponsePtr, *ResponseBufferPtr, *ResponseBufferCachePtr, *ResponseBufferCurrentPtr, *ResponseBufferNetPtr, *RequestHttpCookiePtr, *RequestHttpMethodNamePtr, *ResponseHeaderPtr, *RequestUriPtr, *RequestUriQueryStringPtr; char AffinityDomain [32], ChainHostPort [TCPIP_HOSTNAME_MAX+1+8], ProxyCacheDirectoryName [64], ProxyCacheMd5HexDigest [33], RequestHostName [TCPIP_HOSTNAME_MAX+1], RequestHostPort [TCPIP_HOSTNAME_MAX+1+8], RequestPortString [16], RequestSchemeName [16], ResponseChunkedString [32], ResponseExpires [32], ResponseHttpProtocol [16], ResponseLastModified [48], UrlPassword [32], UrlUserName [32]; /* the cache and FTP storage are not required at the same time */ variant_union { char ExpandedFileName [256]; char FtpCWD [256]; } Overlay1; variant_union { char ProxyCacheFileName [128]; char FtpSYST [128]; } Overlay2; IPADDRESS BindIpAddress, ChainIpAddress, ConnectIpAddress, FtpDataBindIpAddress, FtpDataIpAddress, RequestHostIpAddress; /* pointer to service struct */ SERVICE_STRUCT *ServicePtr; /* pointer to associated request (if any) */ REQUEST_STRUCT *RequestPtr; /* structure is used to get/set file characteristics */ PROXY_CACHE_FILE_QIO CacheFileQio; /* pointer to structure holding reverse-proxy verification data */ PROXYVERIFY_RECORD *VerifyRecordPtr; /* RMS structures */ struct FAB LoadFab; struct RAB LoadRab; struct FAB ParseFab; struct NAM ParseNam; struct XABDAT LoadXabDat; struct XABPRO LoadXabPro; unsigned short ProxyChannel, FtpDataChannel; /* network read and write buffer */ char *FtpDataReadRawDataPtr, *FtpDataWriteRawDataPtr, *ProxyReadRawDataPtr, *ProxyWriteRawDataPtr; int FtpDataReadRawDataSize, FtpDataWriteRawDataCount, ProxyReadRawDataSize, ProxyWriteRawDataCount; /* ZLIB (compressed) stream to/from remote server */ GZIP_COMPRESS GzipCompress; /* AST function pointers */ PROXY_AST FtpAstFunction; REQUEST_AST FtpDataReadRawAstFunction; REQUEST_AST FtpDataWriteRawAstFunction; REQUEST_AST ProxyReadRawAstFunction; REQUEST_AST ProxyWriteRawAstFunction; /* I/O status blocks */ IO_SB FtpDataConnectIOsb, FtpDataReadIOsb, FtpDataWriteIOsb, ProxyConnectIOsb, ProxyReadIOsb, ProxyWriteIOsb; SOCKADDRESS FtpDataSocketName, FtpDataBindSocketName, ProxySocketName, ProxyBindSocketName; TCPIP_HOST_LOOKUP HostLookup; VMS_ITEM_LIST2 FtpDataBindSocketNameItem, FtpDataSocketNameItem, ProxyBindSocketNameItem, ProxySocketNameItem; /* make it easy on ourselves, make the SSL structure pointer typeless! */ void *SesolaPtr; }; #ifndef __VAX # pragma member_alignment __restore #endif #endif /* PROXYSTRUCT_H_LOADED */ /*****************************************************************************/