Apache HTTPD
h2_proxy_util.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __mod_h2__h2_proxy_util__
18#define __mod_h2__h2_proxy_util__
19
20/*******************************************************************************
21 * some debugging/format helpers
22 ******************************************************************************/
23struct h2_proxy_request;
24struct nghttp2_frame;
25
26int h2_proxy_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen);
27
28/*******************************************************************************
29 * ihash - hash for structs with int identifier
30 ******************************************************************************/
32typedef int h2_proxy_ihash_iter_t(void *ctx, void *val);
33
40
43void *h2_proxy_ihash_get(h2_proxy_ihash_t *ih, int id);
44
54
59
60size_t h2_proxy_ihash_shift(h2_proxy_ihash_t *ih, void **buffer, size_t max);
61size_t h2_proxy_ihash_ishift(h2_proxy_ihash_t *ih, int *buffer, size_t max);
62
63/*******************************************************************************
64 * iqueue - sorted list of int with user defined ordering
65 ******************************************************************************/
73
85typedef int h2_proxy_iq_cmp(int i1, int i2, void *ctx);
86
93
99
105
115
124
129
139
148
149/*******************************************************************************
150 * common helpers
151 ******************************************************************************/
152/* h2_proxy_log2(n) iff n is a power of 2 */
153unsigned char h2_proxy_log2(int n);
154
155/*******************************************************************************
156 * HTTP/2 header helpers
157 ******************************************************************************/
158void h2_proxy_util_camel_case_header(char *s, size_t len);
159int h2_proxy_res_ignore_header(const char *name, size_t len);
160
161/*******************************************************************************
162 * nghttp2 helpers
163 ******************************************************************************/
169 const struct h2_proxy_request *req);
170
172
173/*******************************************************************************
174 * h2_proxy_request helpers
175 ******************************************************************************/
177
179 const char *method; /* pseudo header values, see ch. 8.1.2.3 */
180 const char *scheme;
181 const char *authority;
182 const char *path;
183
185
187
188 int chunked; /* iff request body needs to be forwarded as chunked */
189};
190
193 const char *method, const char *scheme,
194 const char *authority, const char *path,
195 apr_table_t *headers);
196
197/*******************************************************************************
198 * reverse mapping for link headers
199 ******************************************************************************/
201 proxy_dir_conf *conf,
202 const char *real_server_uri,
203 const char *proxy_server_uri,
204 const char *s);
205
206/*******************************************************************************
207 * FIFO queue
208 ******************************************************************************/
209
215
221
228
231
234
245
248
255
256
257#endif /* defined(__mod_h2__h2_proxy_util__) */
int n
Definition ap_regex.h:278
const char apr_size_t len
Definition ap_regex.h:187
request_rec int int apr_table_t const char * path
request_rec * r
apr_brigade_flush void * ctx
apr_size_t size
apr_uint32_t apr_uint32_t cmp
Definition apr_atomic.h:106
apr_uint32_t val
Definition apr_atomic.h:66
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
char * buffer
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
Definition apr_poll.h:195
const char * s
Definition apr_strings.h:95
apr_size_t apr_size_t max
Definition apr_time.h:220
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_status_t h2_proxy_fifo_try_push(h2_proxy_fifo *fifo, void *elem)
apr_status_t h2_proxy_fifo_try_pull(h2_proxy_fifo *fifo, void **pelem)
int h2_proxy_iq_remove(h2_proxy_iqueue *q, int sid)
int h2_proxy_ihash_iter(h2_proxy_ihash_t *ih, h2_proxy_ihash_iter_t *fn, void *ctx)
void h2_proxy_ihash_remove_val(h2_proxy_ihash_t *ih, void *val)
apr_status_t h2_proxy_fifo_remove(h2_proxy_fifo *fifo, void *elem)
apr_status_t h2_proxy_fifo_set_create(h2_proxy_fifo **pfifo, apr_pool_t *pool, int capacity)
apr_status_t h2_proxy_req_make(h2_proxy_request *req, apr_pool_t *pool, const char *method, const char *scheme, const char *authority, const char *path, apr_table_t *headers)
void h2_proxy_iq_clear(h2_proxy_iqueue *q)
int h2_proxy_iq_shift(h2_proxy_iqueue *q)
h2_proxy_ngheader * h2_proxy_util_nghd_make(apr_pool_t *p, apr_table_t *headers)
int h2_proxy_fifo_count(h2_proxy_fifo *fifo)
apr_status_t h2_proxy_fifo_pull(h2_proxy_fifo *fifo, void **pelem)
const char * h2_proxy_link_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *real_server_uri, const char *proxy_server_uri, const char *s)
int h2_proxy_iq_cmp(int i1, int i2, void *ctx)
unsigned char h2_proxy_log2(int n)
int h2_proxy_util_frame_print(const nghttp2_frame *frame, char *buffer, size_t maxlen)
apr_status_t h2_proxy_fifo_interrupt(h2_proxy_fifo *fifo)
h2_proxy_ngheader * h2_proxy_util_nghd_make_req(apr_pool_t *p, const struct h2_proxy_request *req)
void h2_proxy_ihash_remove(h2_proxy_ihash_t *ih, int id)
int h2_proxy_fifo_capacity(h2_proxy_fifo *fifo)
size_t h2_proxy_ihash_shift(h2_proxy_ihash_t *ih, void **buffer, size_t max)
void h2_proxy_iq_add(h2_proxy_iqueue *q, int sid, h2_proxy_iq_cmp *cmp, void *ctx)
int h2_proxy_iq_empty(h2_proxy_iqueue *q)
h2_proxy_request * h2_proxy_req_create(int id, apr_pool_t *pool)
size_t h2_proxy_ihash_ishift(h2_proxy_ihash_t *ih, int *buffer, size_t max)
void * h2_proxy_ihash_get(h2_proxy_ihash_t *ih, int id)
h2_proxy_ihash_t * h2_proxy_ihash_create(apr_pool_t *pool, size_t offset_of_int)
void h2_proxy_ihash_clear(h2_proxy_ihash_t *ih)
void h2_proxy_util_camel_case_header(char *s, size_t len)
int h2_proxy_iq_count(h2_proxy_iqueue *q)
apr_status_t h2_proxy_fifo_term(h2_proxy_fifo *fifo)
int h2_proxy_ihash_iter_t(void *ctx, void *val)
size_t h2_proxy_ihash_count(h2_proxy_ihash_t *ih)
void h2_proxy_ihash_add(h2_proxy_ihash_t *ih, void *val)
void h2_proxy_iq_sort(h2_proxy_iqueue *q, h2_proxy_iq_cmp *cmp, void *ctx)
h2_proxy_iqueue * h2_proxy_iq_create(apr_pool_t *pool, int capacity)
int h2_proxy_res_ignore_header(const char *name, size_t len)
apr_status_t h2_proxy_fifo_push(h2_proxy_fifo *fifo, void *elem)
int h2_proxy_ihash_empty(h2_proxy_ihash_t *ih)
apr_status_t h2_proxy_fifo_create(h2_proxy_fifo **pfifo, apr_pool_t *pool, int capacity)
apr_pool_t * p
Definition md_event.c:32
char * name
apr_pool_t * pool
const char * scheme
const char * authority
apr_table_t * headers
apr_time_t request_time
const char * path
const char * method
A structure that represents the current request.
Definition httpd.h:845