err_type.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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_ERR_TYPE_H
10 #define _SQUID_ERR_TYPE_H
11 
12 typedef enum {
14 
15  /* Access Permission Errors. Prefix new with ERR_ACCESS_ */
22 
23  /* TCP Errors. */
31 
32  /* DNS Errors */
35 
36  /* HTTP Errors */
37  ERR_ONLY_IF_CACHED_MISS, /* failure to satisfy only-if-cached request */
40  ERR_UNSUP_HTTPVERSION, /* HTTP version is not supported */
47 
48  /* FTP Errors */
55  ERR_FTP_PUT_CREATED, /* !error,a note that the file was created */
56  ERR_FTP_PUT_MODIFIED, /* modified, !created */
57 
58  /* ESI Errors */
59  ERR_ESI, /* Failure to perform ESI processing */
60 
61  /* ICAP Errors */
63 
64  /* Squid problem */
66 
67  /* Special Cases */
68  ERR_DIR_LISTING, /* Display of remote directory (FTP, Gopher) */
69  ERR_SQUID_SIGNATURE, /* not really an error */
72 
73  // NOTE: error types defined below TCP_RESET are optional and do not generate
74  // a log warning if the files are missing
75  TCP_RESET, // Send TCP RST packet instead of error page
76 
77  ERR_SECURE_ACCEPT_FAIL, // Rejects the SSL connection intead of error page
78  ERR_REQUEST_START_TIMEOUT, // Aborts the connection instead of error page
79 
80  /* Cache Manager GUI can install a manager index/home page */
82 
84 } err_type;
85 
86 extern const char *err_type_str[];
87 
88 inline
90 errorTypeByName(const char *name)
91 {
92  for (int i = 0; i < ERR_MAX; ++i)
93  if (strcmp(name, err_type_str[i]) == 0)
94  return (err_type)i;
95  return ERR_MAX;
96 }
97 
98 inline
99 const char *
101 {
102  if (err < ERR_NONE || err >= ERR_MAX)
103  return "UNKNOWN";
104  return err_type_str[err];
105 }
106 
107 #endif /* _SQUID_ERR_TYPE_H */
108 
int i
Definition: membanger.c:49
const char * err_type_str[]
err_type errorTypeByName(const char *name)
Definition: err_type.h:90
const char * errorTypeName(err_type err)
Definition: err_type.h:100
err_type
Definition: err_type.h:12

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors