Example #1
0
    "remote_addr",
    "time_local",
    "time_iso8601",
    "request",
    "status",
    "body_bytes_sent",
    "remote_port",
    "server_port",
    "request_time",
    "pid",
    "alpn",
    "ssl_cipher",
    "ssl_protocol",
    "ssl_session_id",
    "ssl_session_reused",
    "backend_host",
    "backend_port",
]

if __name__ == '__main__':
    gentokenlookup(OPTIONS,
                   'SHRPX_OPTID',
                   value_type='char',
                   comp_fun='util::strieq_l')
    gentokenlookup(LOGVARS,
                   'SHRPX_LOGF',
                   value_type='char',
                   comp_fun='util::strieq_l',
                   return_type='LogFragmentType',
                   fail_value='SHRPX_LOGF_NONE')
Example #2
0
  XX(15, UNLOCK, UNLOCK)
  XX(16, BIND, BIND)
  XX(17, REBIND, REBIND)
  XX(18, UNBIND, UNBIND)
  XX(19, ACL, ACL)
  XX(20, REPORT, REPORT)
  XX(21, MKACTIVITY, MKACTIVITY)
  XX(22, CHECKOUT, CHECKOUT)
  XX(23, MERGE, MERGE)
  XX(24, MSEARCH, M-SEARCH)
  XX(25, NOTIFY, NOTIFY)
  XX(26, SUBSCRIBE, SUBSCRIBE)
  XX(27, UNSUBSCRIBE, UNSUBSCRIBE)
  XX(28, PATCH, PATCH)
  XX(29, PURGE, PURGE)
  XX(30, MKCALENDAR, MKCALENDAR)
  XX(31, LINK, LINK)
  XX(32, UNLINK, UNLINK)
  XX(33, SOURCE, SOURCE)
'''

if __name__ == '__main__':
    methods = []
    for line in StringIO(SRC):
        line = line.strip()
        if not line.startswith('XX'):
            continue
        _, m, _ = line.split(',', 2)
        methods.append(m.strip())
    gentokenlookup(methods, 'HTTP_')
Example #3
0
    'expect',
    'host',
    'if-modified-since',
    "te",
    "cookie",
    "http2-settings",
    "server",
    "via",
    "x-forwarded-for",
    "x-forwarded-proto",
    "alt-svc",
    "content-length",
    "location",
    "trailer",
    "link",
    "accept-encoding",
    "accept-language",
    "cache-control",
    "user-agent",
    "date",
    # disallowed h1 headers
    'connection',
    'keep-alive',
    'proxy-connection',
    'transfer-encoding',
    'upgrade'
]

if __name__ == '__main__':
    gentokenlookup(HEADERS, 'HD')
Example #4
0
    "no-kqueue",
    "frontend-http2-settings-timeout",
    "backend-http2-settings-timeout",
    "api-max-request-body",
    "backend-max-backoff",
]

LOGVARS = [
    "remote_addr",
    "time_local",
    "time_iso8601",
    "request",
    "status",
    "body_bytes_sent",
    "remote_port",
    "server_port",
    "request_time",
    "pid",
    "alpn",
    "ssl_cipher",
    "ssl_protocol",
    "ssl_session_id",
    "ssl_session_reused",
    "backend_host",
    "backend_port",
]

if __name__ == '__main__':
    gentokenlookup(OPTIONS, 'SHRPX_OPTID', value_type='char', comp_fun='util::strieq_l')
    gentokenlookup(LOGVARS, 'SHRPX_LOGF', value_type='char', comp_fun='util::strieq_l', return_type='LogFragmentType', fail_value='SHRPX_LOGF_NONE')
Example #5
0
    "http2-settings",
    "server",
    "via",
    "forwarded",
    "x-forwarded-for",
    "x-forwarded-proto",
    "alt-svc",
    "content-length",
    "location",
    "trailer",
    "link",
    "accept-encoding",
    "accept-language",
    "cache-control",
    "user-agent",
    "date",
    "content-type",
    "early-data",
    "sec-websocket-accept",
    "sec-websocket-key",
    # disallowed h1 headers
    'connection',
    'keep-alive',
    'proxy-connection',
    'transfer-encoding',
    'upgrade'
]

if __name__ == '__main__':
    gentokenlookup(HEADERS, 'HD_')
Example #6
0
]

LOGVARS = [
    "remote_addr",
    "time_local",
    "time_iso8601",
    "request",
    "status",
    "body_bytes_sent",
    "remote_port",
    "server_port",
    "request_time",
    "pid",
    "alpn",
    "ssl_cipher",
    "ssl_protocol",
    "ssl_session_id",
    "ssl_session_reused",
]

if __name__ == "__main__":
    gentokenlookup(OPTIONS, "SHRPX_OPTID", value_type="char", comp_fun="util::strieq_l")
    gentokenlookup(
        LOGVARS,
        "SHRPX_LOGF",
        value_type="char",
        comp_fun="util::strieq_l",
        return_type="LogFragmentType",
        fail_value="SHRPX_LOGF_NONE",
    )