]> git.ipfire.org Git - thirdparty/squid.git/blame - src/anyp/ProtocolType.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / anyp / ProtocolType.h
CommitLineData
bbc27441 1/*
4ac4a490 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
bbc27441
AJ
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
0c3d3f65
AJ
9#ifndef _SQUID_SRC_ANYP_PROTOCOLTYPE_H
10#define _SQUID_SRC_ANYP_PROTOCOLTYPE_H
11
0c3d3f65 12#include <ostream>
0c3d3f65 13
10c40d99
A
14namespace AnyP
15{
0c3d3f65
AJ
16
17/**
18 * List of all protocols known and supported.
19 * This is a combined list. It is used as type-codes where needed and
20 * the AnyP::ProtocolType_Str array of strings may be used for display
21 */
22typedef enum {
23 PROTO_NONE = 0,
24 PROTO_HTTP,
25 PROTO_FTP,
26 PROTO_HTTPS,
330f829e
AJ
27 PROTO_COAP,
28 PROTO_COAPS,
0c3d3f65
AJ
29 PROTO_GOPHER,
30 PROTO_WAIS,
39a19cb7 31 PROTO_CACHE_OBJECT,
0c3d3f65
AJ
32 PROTO_ICP,
33#if USE_HTCP
34 PROTO_HTCP,
35#endif
36 PROTO_URN,
37 PROTO_WHOIS,
0c3d3f65 38 PROTO_ICY,
67c99fc6 39 PROTO_TLS,
d9219c2b 40 PROTO_SSL,
6b2b6cfe 41 PROTO_AUTHORITY_FORM,
0c3d3f65
AJ
42 PROTO_UNKNOWN,
43 PROTO_MAX
44} ProtocolType;
45
46extern const char *ProtocolType_str[];
47
48/** Display the registered Protocol Type (in upper case).
49 * If the protocol is not a registered AnyP::ProtocolType nothing will be displayed.
50 * The caller is responsible for any alternative text.
51 */
52inline std::ostream &
53operator <<(std::ostream &os, ProtocolType const &p)
54{
55 if (PROTO_NONE <= p && p < PROTO_MAX)
56 os << ProtocolType_str[p];
57 else
58 os << static_cast<int>(p);
59 return os;
60}
61
62} // namespace AnyP
63
64#endif /* _SQUID_SRC_ANYP_PROTOCOLTYPE_H */
f53969cc 65