• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-block-list",
117    "no-http2-cipher-black-list",
118    "backend-http1-tls",
119    "tls-session-cache-memcached-cert-file",
120    "tls-session-cache-memcached-private-key-file",
121    "tls-session-cache-memcached-address-family",
122    "tls-ticket-key-memcached-tls",
123    "tls-ticket-key-memcached-cert-file",
124    "tls-ticket-key-memcached-private-key-file",
125    "tls-ticket-key-memcached-address-family",
126    "backend-address-family",
127    "frontend-http2-max-concurrent-streams",
128    "backend-http2-max-concurrent-streams",
129    "backend-connections-per-frontend",
130    "backend-tls",
131    "backend-connections-per-host",
132    "error-page",
133    "no-kqueue",
134    "frontend-http2-settings-timeout",
135    "backend-http2-settings-timeout",
136    "api-max-request-body",
137    "backend-max-backoff",
138    "server-name",
139    "no-server-rewrite",
140    "frontend-http2-optimize-write-buffer-size",
141    "frontend-http2-optimize-window-size",
142    "frontend-http2-window-size",
143    "frontend-http2-connection-window-size",
144    "backend-http2-window-size",
145    "backend-http2-connection-window-size",
146    "frontend-http2-encoder-dynamic-table-size",
147    "frontend-http2-decoder-dynamic-table-size",
148    "backend-http2-encoder-dynamic-table-size",
149    "backend-http2-decoder-dynamic-table-size",
150    "ecdh-curves",
151    "tls-sct-dir",
152    "backend-connect-timeout",
153    "dns-cache-timeout",
154    "dns-lookup-timeout",
155    "dns-max-try",
156    "frontend-keep-alive-timeout",
157    "psk-secrets",
158    "client-psk-secrets",
159    "client-no-http2-cipher-block-list",
160    "client-no-http2-cipher-black-list",
161    "client-ciphers",
162    "accesslog-write-early",
163    "tls-min-proto-version",
164    "tls-max-proto-version",
165    "redirect-https-port",
166    "frontend-max-requests",
167    "single-thread",
168    "single-process",
169    "no-add-x-forwarded-proto",
170    "no-strip-incoming-x-forwarded-proto",
171    "ocsp-startup",
172    "no-verify-ocsp",
173    "verify-client-tolerate-expired",
174    "ignore-per-pattern-mruby-error",
175    "tls-no-postpone-early-data",
176    "tls-max-early-data",
177    "tls13-ciphers",
178    "tls13-client-ciphers",
179    "no-strip-incoming-early-data",
180    "quic-bpf-program-file",
181    "no-quic-bpf",
182    "http2-altsvc",
183    "frontend-http3-read-timeout",
184    "frontend-quic-idle-timeout",
185    "frontend-quic-debug-log",
186    "frontend-http3-window-size",
187    "frontend-http3-connection-window-size",
188    "frontend-http3-max-window-size",
189    "frontend-http3-max-connection-window-size",
190    "frontend-http3-max-concurrent-streams",
191    "frontend-quic-early-data",
192    "frontend-quic-qlog-dir",
193    "frontend-quic-require-token",
194    "frontend-quic-congestion-controller",
195    "quic-server-id",
196    "frontend-quic-secret-file",
197    "rlimit-memlock",
198    "max-worker-processes",
199    "worker-process-grace-shutdown-period",
200    "frontend-quic-initial-rtt",
201    "require-http-scheme",
202    "tls-ktls",
203]
204
205LOGVARS = [
206    "remote_addr",
207    "time_local",
208    "time_iso8601",
209    "request",
210    "status",
211    "body_bytes_sent",
212    "remote_port",
213    "server_port",
214    "request_time",
215    "pid",
216    "alpn",
217    "ssl_cipher",
218    "ssl_protocol",
219    "ssl_session_id",
220    "ssl_session_reused",
221    "tls_cipher",
222    "tls_protocol",
223    "tls_session_id",
224    "tls_session_reused",
225    "tls_sni",
226    "tls_client_fingerprint_sha256",
227    "tls_client_fingerprint_sha1",
228    "tls_client_subject_name",
229    "tls_client_issuer_name",
230    "tls_client_serial",
231    "backend_host",
232    "backend_port",
233    "method",
234    "path",
235    "path_without_query",
236    "protocol_version",
237]
238
239if __name__ == '__main__':
240    gentokenlookup(OPTIONS, 'SHRPX_OPTID_', value_type='char', comp_fun='util::strieq_l')
241    gentokenlookup(LOGVARS, 'LogFragmentType::', value_type='char', comp_fun='util::strieq_l', return_type='LogFragmentType', fail_value='LogFragmentType::NONE')
242