1#!/usr/bin/env python3 2 3from gentokenlookup import gentokenlookup 4 5OPTIONS = [ 6 "private-key-file", 7 "private-key-passwd-file", 8 "certificate-file", 9 "dh-param-file", 10 "subcert", 11 "backend", 12 "frontend", 13 "workers", 14 "http2-max-concurrent-streams", 15 "log-level", 16 "daemon", 17 "http2-proxy", 18 "http2-bridge", 19 "client-proxy", 20 "add-x-forwarded-for", 21 "strip-incoming-x-forwarded-for", 22 "no-via", 23 "frontend-http2-read-timeout", 24 "frontend-read-timeout", 25 "frontend-write-timeout", 26 "backend-read-timeout", 27 "backend-write-timeout", 28 "stream-read-timeout", 29 "stream-write-timeout", 30 "accesslog-file", 31 "accesslog-syslog", 32 "accesslog-format", 33 "errorlog-file", 34 "errorlog-syslog", 35 "backend-keep-alive-timeout", 36 "frontend-http2-window-bits", 37 "backend-http2-window-bits", 38 "frontend-http2-connection-window-bits", 39 "backend-http2-connection-window-bits", 40 "frontend-no-tls", 41 "backend-no-tls", 42 "backend-tls-sni-field", 43 "pid-file", 44 "user", 45 "syslog-facility", 46 "backlog", 47 "ciphers", 48 "client", 49 "insecure", 50 "cacert", 51 "backend-ipv4", 52 "backend-ipv6", 53 "backend-http-proxy-uri", 54 "read-rate", 55 "read-burst", 56 "write-rate", 57 "write-burst", 58 "worker-read-rate", 59 "worker-read-burst", 60 "worker-write-rate", 61 "worker-write-burst", 62 "npn-list", 63 "tls-proto-list", 64 "verify-client", 65 "verify-client-cacert", 66 "client-private-key-file", 67 "client-cert-file", 68 "frontend-http2-dump-request-header", 69 "frontend-http2-dump-response-header", 70 "http2-no-cookie-crumbling", 71 "frontend-frame-debug", 72 "padding", 73 "altsvc", 74 "add-request-header", 75 "add-response-header", 76 "worker-frontend-connections", 77 "no-location-rewrite", 78 "no-host-rewrite", 79 "backend-http1-connections-per-host", 80 "backend-http1-connections-per-frontend", 81 "listener-disable-timeout", 82 "tls-ticket-key-file", 83 "rlimit-nofile", 84 "backend-request-buffer", 85 "backend-response-buffer", 86 "no-server-push", 87 "backend-http2-connections-per-worker", 88 "fetch-ocsp-response-file", 89 "ocsp-update-interval", 90 "no-ocsp", 91 "include", 92 "tls-ticket-key-cipher", 93 "host-rewrite", 94 "tls-session-cache-memcached", 95 "tls-session-cache-memcached-tls", 96 "tls-ticket-key-memcached", 97 "tls-ticket-key-memcached-interval", 98 "tls-ticket-key-memcached-max-retry", 99 "tls-ticket-key-memcached-max-fail", 100 "mruby-file", 101 "accept-proxy-protocol", 102 "conf", 103 "fastopen", 104 "tls-dyn-rec-warmup-threshold", 105 "tls-dyn-rec-idle-timeout", 106 "add-forwarded", 107 "strip-incoming-forwarded", 108 "forwarded-by", 109 "forwarded-for", 110 "response-header-field-buffer", 111 "max-response-header-fields", 112 "request-header-field-buffer", 113 "max-request-header-fields", 114 "header-field-buffer", 115 "max-header-fields", 116 "no-http2-cipher-black-list", 117 "backend-http1-tls", 118 "tls-session-cache-memcached-cert-file", 119 "tls-session-cache-memcached-private-key-file", 120 "tls-session-cache-memcached-address-family", 121 "tls-ticket-key-memcached-tls", 122 "tls-ticket-key-memcached-cert-file", 123 "tls-ticket-key-memcached-private-key-file", 124 "tls-ticket-key-memcached-address-family", 125 "backend-address-family", 126 "frontend-http2-max-concurrent-streams", 127 "backend-http2-max-concurrent-streams", 128 "backend-connections-per-frontend", 129 "backend-tls", 130 "backend-connections-per-host", 131 "error-page", 132 "no-kqueue", 133 "frontend-http2-settings-timeout", 134 "backend-http2-settings-timeout", 135 "api-max-request-body", 136 "backend-max-backoff", 137 "server-name", 138 "no-server-rewrite", 139 "frontend-http2-optimize-write-buffer-size", 140 "frontend-http2-optimize-window-size", 141 "frontend-http2-window-size", 142 "frontend-http2-connection-window-size", 143 "backend-http2-window-size", 144 "backend-http2-connection-window-size", 145 "frontend-http2-encoder-dynamic-table-size", 146 "frontend-http2-decoder-dynamic-table-size", 147 "backend-http2-encoder-dynamic-table-size", 148 "backend-http2-decoder-dynamic-table-size", 149 "ecdh-curves", 150 "tls-sct-dir", 151 "backend-connect-timeout", 152 "dns-cache-timeout", 153 "dns-lookup-timeout", 154 "dns-max-try", 155 "frontend-keep-alive-timeout", 156 "psk-secrets", 157 "client-psk-secrets", 158 "client-no-http2-cipher-black-list", 159 "client-ciphers", 160 "accesslog-write-early", 161 "tls-min-proto-version", 162 "tls-max-proto-version", 163 "redirect-https-port", 164 "frontend-max-requests", 165 "single-thread", 166 "single-process", 167 "no-add-x-forwarded-proto", 168 "no-strip-incoming-x-forwarded-proto", 169 "ocsp-startup", 170 "no-verify-ocsp", 171 "verify-client-tolerate-expired", 172 "ignore-per-pattern-mruby-error", 173 "tls-no-postpone-early-data", 174 "tls-max-early-data", 175 "tls13-ciphers", 176 "tls13-client-ciphers", 177 "no-strip-incoming-early-data", 178] 179 180LOGVARS = [ 181 "remote_addr", 182 "time_local", 183 "time_iso8601", 184 "request", 185 "status", 186 "body_bytes_sent", 187 "remote_port", 188 "server_port", 189 "request_time", 190 "pid", 191 "alpn", 192 "ssl_cipher", 193 "ssl_protocol", 194 "ssl_session_id", 195 "ssl_session_reused", 196 "tls_cipher", 197 "tls_protocol", 198 "tls_session_id", 199 "tls_session_reused", 200 "tls_sni", 201 "tls_client_fingerprint_sha256", 202 "tls_client_fingerprint_sha1", 203 "tls_client_subject_name", 204 "tls_client_issuer_name", 205 "tls_client_serial", 206 "backend_host", 207 "backend_port", 208 "method", 209 "path", 210 "path_without_query", 211 "protocol_version", 212] 213 214if __name__ == '__main__': 215 gentokenlookup(OPTIONS, 'SHRPX_OPTID_', value_type='char', comp_fun='util::strieq_l') 216 gentokenlookup(LOGVARS, 'LogFragmentType::', value_type='char', comp_fun='util::strieq_l', return_type='LogFragmentType', fail_value='LogFragmentType::NONE') 217