]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/icap/Options.h
f57ccab984b9989b0fc7f08b1f6d07de6eeca817
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_ICAPOPTIONS_H
10 #define SQUID_ICAPOPTIONS_H
12 #include "adaptation/icap/ServiceRep.h"
22 /* Maintains options supported by a given ICAP service.
23 * See RFC 3507, Section "4.10.2 OPTIONS Response". */
29 typedef void GetCallback(void *data
, Options
*options
);
30 static void Get(ServiceRep::Pointer
&service
, GetCallback
*cb
, void *data
);
36 void configure(const HttpReply
*reply
);
41 time_t expire() const;
42 time_t timestamp() const { return theTimestamp
; };
44 typedef enum { xferNone
, xferPreview
, xferIgnore
, xferComplete
} TransferKind
;
45 TransferKind
transferKind(const String
&urlPath
) const;
48 const char *error
; // human-readable information; set iff !valid()
50 // ICAP server MUST supply this info
51 std::vector
<ICAP::Method
> methods
;
54 // ICAP server MAY supply this info. If not, Squid supplies defaults.
63 // Transfer-* extension list representation
64 // maintains wordlist and does parsing/matching
71 bool matches(const String
&urlPath
) const;
73 void parse(const String
&buf
, bool &foundStar
);
74 void add(const char *extension
);
75 void report(int level
, const char *prefix
) const;
78 wordlist
*extensions
; // TODO: optimize with a hash of some sort
79 const char *name
; // header name, mostly for debugging
80 TransferKind kind
; // to simplify caller's life
83 // varios Transfer-* lists
87 TransferList complete
;
88 TransferList
*byDefault
; // Transfer-X that has '*'
95 void cfgMethod(ICAP::Method m
);
96 void cfgIntHeader(const HttpHeader
*h
, const char *fname
, int &value
);
97 void cfgTransferList(const HttpHeader
*h
, TransferList
&l
);
101 } // namespace Adaptation
103 #endif /* SQUID_ICAPOPTIONS_H */