Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 1 | /* |
| 2 | * include/types/http_htx.h |
| 3 | * This file defines function prototypes for HTTP manipulation using the |
| 4 | * internal representation. |
| 5 | * |
| 6 | * Copyright (C) 2018 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.com> |
| 7 | * |
| 8 | * This library is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU Lesser General Public |
| 10 | * License as published by the Free Software Foundation, version 2.1 |
| 11 | * exclusively. |
| 12 | * |
| 13 | * This library is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 | * Lesser General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU Lesser General Public |
| 19 | * License along with this library; if not, write to the Free Software |
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ |
| 22 | |
| 23 | #ifndef _PROTO_HTTP_HTX_H |
| 24 | #define _PROTO_HTTP_HTX_H |
| 25 | |
| 26 | #include <common/buf.h> |
| 27 | |
| 28 | #include <types/h1.h> |
| 29 | #include <types/http_htx.h> |
| 30 | |
| 31 | union h1_sl http_find_stline(const struct htx *htx); |
| 32 | int http_find_header(const struct htx *htx, const struct ist name, struct http_hdr_ctx *ctx, int full); |
| 33 | int http_add_header(struct htx *htx, const struct ist n, const struct ist v); |
| 34 | int http_replace_reqline(struct htx *htx, const union h1_sl sl); |
| 35 | int http_replace_resline(struct htx *htx, const union h1_sl sl); |
Christopher Faulet | e010c80 | 2018-10-24 10:36:45 +0200 | [diff] [blame] | 36 | int http_replace_req_meth(struct htx *htx, const struct ist meth); |
| 37 | int http_replace_req_uri(struct htx *htx, const struct ist uri); |
| 38 | int http_replace_req_path(struct htx *htx, const struct ist path); |
| 39 | int http_replace_req_query(struct htx *htx, const struct ist query); |
| 40 | int http_replace_res_status(struct htx *htx, const struct ist status); |
| 41 | int http_replace_res_reason(struct htx *htx, const struct ist reason); |
Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 42 | int http_replace_header_value(struct htx *htx, struct http_hdr_ctx *ctx, const struct ist data); |
| 43 | int http_replace_header(struct htx *htx, struct http_hdr_ctx *ctx, const struct ist name, const struct ist value); |
| 44 | int http_remove_header(struct htx *htx, struct http_hdr_ctx *ctx); |
Christopher Faulet | 7ff1cea | 2018-10-24 10:39:35 +0200 | [diff] [blame] | 45 | unsigned int http_get_htx_hdr(const struct htx *htx, const struct ist hdr, |
| 46 | int occ, struct http_hdr_ctx *ctx, char **vptr, size_t *vlen); |
| 47 | unsigned int http_get_htx_fhdr(const struct htx *htx, const struct ist hdr, |
| 48 | int occ, struct http_hdr_ctx *ctx, char **vptr, size_t *vlen); |
Christopher Faulet | 47596d3 | 2018-10-22 09:17:28 +0200 | [diff] [blame] | 49 | |
| 50 | #endif /* _PROTO_HTTP_HTX_H */ |