]>
| Commit | Line | Data |
|---|---|---|
| 9cef6668 | 1 | /* |
| 1f7b830e | 2 | * Copyright (C) 1996-2025 The Squid Software Foundation and contributors |
| 9cef6668 | 3 | * |
| bbc27441 AJ |
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. | |
| 9cef6668 | 7 | */ |
| bbc27441 | 8 | |
| ff9d9458 FC |
9 | #ifndef SQUID_SRC_DEFINES_H |
| 10 | #define SQUID_SRC_DEFINES_H | |
| b5638623 | 11 | |
| a8258824 | 12 | #ifndef TRUE |
| 13 | #define TRUE 1 | |
| 14 | #endif | |
| 15 | #ifndef FALSE | |
| 16 | #define FALSE 0 | |
| 17 | #endif | |
| 18 | ||
| e1f7507e AJ |
19 | #ifndef BUFSIZ |
| 20 | #define BUFSIZ 4096 /* make unreasonable guess */ | |
| 21 | #endif | |
| 22 | ||
| a8258824 | 23 | /* Select types. */ |
| 24 | #define COMM_SELECT_READ (0x1) | |
| 25 | #define COMM_SELECT_WRITE (0x2) | |
| a8258824 | 26 | |
| a8258824 | 27 | #define DISK_OK (0) |
| 28 | #define DISK_ERROR (-1) | |
| 29 | #define DISK_EOF (-2) | |
| a8258824 | 30 | #define DISK_NO_SPACE_LEFT (-6) |
| 31 | ||
| f53969cc | 32 | #define FD_DESC_SZ 64 |
| a8258824 | 33 | |
| f53969cc | 34 | #define FQDN_LOOKUP_IF_MISS 0x01 |
| a8258824 | 35 | #define FQDN_MAX_NAMES 5 |
| a8258824 | 36 | |
| f53969cc | 37 | #define IP_LOOKUP_IF_MISS 0x01 |
| a8258824 | 38 | |
| a8258824 | 39 | #define ICP_FLAG_SRC_RTT 0x40000000ul |
| 40 | ||
| a8258824 | 41 | /* Version */ |
| f53969cc SM |
42 | #define ICP_VERSION_2 2 |
| 43 | #define ICP_VERSION_3 3 | |
| 44 | #define ICP_VERSION_CURRENT ICP_VERSION_2 | |
| a8258824 | 45 | |
| db1cd23c | 46 | #define DIRECT_UNKNOWN 0 |
| 47 | #define DIRECT_NO 1 | |
| 48 | #define DIRECT_MAYBE 2 | |
| 49 | #define DIRECT_YES 3 | |
| a8258824 | 50 | |
| a8258824 | 51 | #define REDIRECT_AV_FACTOR 1000 |
| 52 | ||
| 53 | #define REDIRECT_NONE 0 | |
| 54 | #define REDIRECT_PENDING 1 | |
| 55 | #define REDIRECT_DONE 2 | |
| 56 | ||
| 94439e4e | 57 | /* AUTHENTICATION */ |
| 73e67ee0 | 58 | |
| a8258824 | 59 | /* logfile status */ |
| 60 | #define LOG_ENABLE 1 | |
| 61 | #define LOG_DISABLE 0 | |
| 62 | ||
| 63 | #define SM_PAGE_SIZE 4096 | |
| a8258824 | 64 | |
| f53969cc SM |
65 | #define EBIT_SET(flag, bit) ((void)((flag) |= ((1L<<(bit))))) |
| 66 | #define EBIT_CLR(flag, bit) ((void)((flag) &= ~((1L<<(bit))))) | |
| 67 | #define EBIT_TEST(flag, bit) ((flag) & ((1L<<(bit)))) | |
| d8b249ef | 68 | |
| e908b3e3 | 69 | /* bit operations on a char[] mask of unlimited length */ |
| d8b249ef | 70 | #define CBIT_BIT(bit) (1<<((bit)%8)) |
| 71 | #define CBIT_BIN(mask, bit) (mask)[(bit)>>3] | |
| f53969cc SM |
72 | #define CBIT_SET(mask, bit) ((void)(CBIT_BIN(mask, bit) |= CBIT_BIT(bit))) |
| 73 | #define CBIT_CLR(mask, bit) ((void)(CBIT_BIN(mask, bit) &= ~CBIT_BIT(bit))) | |
| 74 | #define CBIT_TEST(mask, bit) (CBIT_BIN(mask, bit) & CBIT_BIT(bit)) | |
| a8258824 | 75 | |
| 788652f7 | 76 | #define MAX_URL 8192 |
| a8258824 | 77 | #define MAX_LOGIN_SZ 128 |
| 78 | ||
| a8258824 | 79 | #define PEER_MAX_ADDRESSES 10 |
| e39dc0e0 | 80 | #define RTT_AV_FACTOR 50 |
| f53969cc | 81 | #define RTT_BACKGROUND_AV_FACTOR 25 /* Background pings need a smaller factor since they are sent less frequently */ |
| a8258824 | 82 | |
| dc835977 | 83 | #define PEER_DEAD 0 |
| 84 | #define PEER_ALIVE 1 | |
| 85 | ||
| 58cd5bbd | 86 | #define CLIENT_REQ_BUF_SZ 4096 |
| 603a02fd | 87 | |
| a7c05555 | 88 | #define IPC_NONE 0 |
| 89 | #define IPC_TCP_SOCKET 1 | |
| 90 | #define IPC_UDP_SOCKET 2 | |
| 91 | #define IPC_FIFO 3 | |
| 1ccc0d40 | 92 | #define IPC_UNIX_STREAM 4 |
| 93 | #define IPC_UNIX_DGRAM 5 | |
| 94 | ||
| 5b346515 AR |
95 | /* required for AF_UNIX below to be defined [on FreeBSD] */ |
| 96 | #if HAVE_SYS_SOCKET_H | |
| f4199ea5 | 97 | #include <sys/socket.h> |
| 5b346515 AR |
98 | #endif |
| 99 | ||
| 1ccc0d40 | 100 | #if HAVE_SOCKETPAIR && defined (AF_UNIX) |
| 101 | #define IPC_STREAM IPC_UNIX_STREAM | |
| 102 | #define IPC_DGRAM IPC_UNIX_DGRAM | |
| 103 | #else | |
| 104 | #define IPC_STREAM IPC_TCP_SOCKET | |
| 105 | #define IPC_DGRAM IPC_UDP_SOCKET | |
| 106 | #endif | |
| f09f5b26 | 107 | |
| 2c29838d | 108 | #define COUNT_INTERVAL 60 |
| 109 | /* | |
| 110 | * keep 60 minutes' worth of per-minute readings (+ current reading) | |
| 111 | */ | |
| 112 | #define N_COUNT_HIST (3600 / COUNT_INTERVAL) + 1 | |
| 113 | /* | |
| 114 | * keep 3 days' (72 hours) worth of hourly readings | |
| 399e85ea | 115 | */ |
| 2c29838d | 116 | #define N_COUNT_HOUR_HIST (86400 * 3) / (60 * COUNT_INTERVAL) |
| 451b07c5 | 117 | |
| 98829f69 | 118 | /* |
| 119 | * This many TCP connections must FAIL before we mark the | |
| 120 | * peer as DEAD | |
| 121 | */ | |
| 122 | #define PEER_TCP_MAGIC_COUNT 10 | |
| cc27d775 | 123 | |
| 7e3ce7b9 | 124 | #define URI_WHITESPACE_STRIP 0 |
| d548ee64 | 125 | #define URI_WHITESPACE_ALLOW 1 |
| 126 | #define URI_WHITESPACE_ENCODE 2 | |
| 127 | #define URI_WHITESPACE_CHOP 3 | |
| 7e3ce7b9 | 128 | #define URI_WHITESPACE_DENY 4 |
| 86ed3fd2 | 129 | |
| c4aefe96 | 130 | #ifndef O_TEXT |
| 131 | #define O_TEXT 0 | |
| 132 | #endif | |
| 133 | #ifndef O_BINARY | |
| 134 | #define O_BINARY 0 | |
| 135 | #endif | |
| 0e6d05ef | 136 | |
| 5d1a7121 | 137 | /* |
| 138 | * Macro to find file access mode | |
| 139 | */ | |
| 140 | #ifdef O_ACCMODE | |
| 141 | #define FILE_MODE(x) ((x)&O_ACCMODE) | |
| 142 | #else | |
| 143 | #define FILE_MODE(x) ((x)&(O_RDONLY|O_WRONLY|O_RDWR)) | |
| 144 | #endif | |
| 145 | ||
| a50bfe93 | 146 | /* CygWin & Windows NT Port */ |
| be266cb2 | 147 | #if _SQUID_WINDOWS_ |
| a50bfe93 | 148 | #define _WIN_SQUID_SERVICE_CONTROL_STOP SERVICE_CONTROL_STOP |
| 149 | #define _WIN_SQUID_SERVICE_CONTROL_SHUTDOWN SERVICE_CONTROL_SHUTDOWN | |
| 150 | #define _WIN_SQUID_SERVICE_CONTROL_INTERROGATE SERVICE_CONTROL_INTERROGATE | |
| f53969cc SM |
151 | #define _WIN_SQUID_SERVICE_CONTROL_ROTATE 128 |
| 152 | #define _WIN_SQUID_SERVICE_CONTROL_RECONFIGURE 129 | |
| 153 | #define _WIN_SQUID_SERVICE_CONTROL_DEBUG 130 | |
| 154 | #define _WIN_SQUID_SERVICE_CONTROL_INTERRUPT 131 | |
| 155 | #define _WIN_SQUID_SERVICE_OPTION "--ntservice" | |
| 156 | #define _WIN_SQUID_RUN_MODE_INTERACTIVE 0 | |
| 157 | #define _WIN_SQUID_RUN_MODE_SERVICE 1 | |
| a50bfe93 | 158 | #endif |
| 159 | ||
| ff9d9458 | 160 | #endif /* SQUID_SRC_DEFINES_H */ |
| f53969cc | 161 |