blob: 7840af672c1809b019a1d21354cf8a0a6f010b38 [file] [log] [blame]
Christopher Fauleta3d2a162018-10-22 08:59:39 +02001/*
Willy Tarreaub96b77e2018-12-11 10:22:41 +01002 * include/common/htx.h
Christopher Fauleta3d2a162018-10-22 08:59:39 +02003 * This file defines everything related to the internal HTTP messages.
4 *
5 * Copyright (C) 2018 HAProxy Technologies, Christopher Faulet <cfaulet@haproxy.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation, version 2.1
10 * exclusively.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
Willy Tarreaub96b77e2018-12-11 10:22:41 +010022#ifndef _COMMON_HTX_H
23#define _COMMON_HTX_H
Christopher Fauleta3d2a162018-10-22 08:59:39 +020024
Willy Tarreaub96b77e2018-12-11 10:22:41 +010025#include <stdio.h>
Christopher Fauleta3d2a162018-10-22 08:59:39 +020026#include <common/buf.h>
27#include <common/config.h>
Willy Tarreaub96b77e2018-12-11 10:22:41 +010028#include <common/ist.h>
29#include <common/http.h>
Christopher Fauleta3d2a162018-10-22 08:59:39 +020030#include <common/http-hdr.h>
Willy Tarreaub96b77e2018-12-11 10:22:41 +010031#include <common/standard.h>
32
33/*
34 * The internal representation of an HTTP message is a contiguous array
35 * containing both the blocks (htx_blk) and their contents. Blocks are stored
36 * starting from the end of the array while their contents are stored at the
37 * beginning.
38 *
39 * As data are sent to the peer, blocks and contents are released at the
40 * edges. This free space is reused when no more space left. So blocks and
41 * contents may wrap, not necessarily the same time.
42 *
43 * An HTTP block is as well a header as a body part or a trailer part. For all
44 * these types of block, a content is attached to the block. It can also be a
45 * mark, like the end-of-headers or end-of-message. For these blocks, there is
46 * no content but it count for a byte. It is important to not skip it when data
47 * are forwarded. An HTTP block is composed of 2 fields:
48 *
49 * - .info : It a 32 bits field containing the block's type on 4 bits
50 * followed by content' length. See below for details.
51 *
52 * - .addr : The content's address, if any, relatively to the beginning the
53 * array used to store the HTTP message itself.
54 *
55 * htx_blk.info representation:
56 *
57 * 0b 0000 0000 0000 0000 0000 0000 0000 0000
58 * ---- ------------------------ ---------
59 * type value (1 MB max) name length (header)
60 * ----------------------------------
61 * data length (256 MB max)
62 * (body, method, path, version, status, reason, trailers)
63 *
64 * types:
65 * - 0000 = request start-line
66 * - 0001 = response start-line
67 * - 0010 = header
68 * - 0011 = pseudo-header ou "special" header
69 * - 0100 = end-of-headers
70 * - 0101 = data
71 * - 0110 = end-of-data
72 * - 0111 = trailer
73 * - 1000 = end-of-message
74 * ...
75 * - 1101 = out-of-band
76 * - 1110 = error
77 * - 1111 = unused
78 *
79 */
80
81/*HTX start-line flags */
82#define HTX_SL_F_NONE 0x00000000
83#define HTX_SL_F_IS_RESP 0x00000001 /* It is the response start-line (unset means the request one) */
84#define HTX_SL_F_XFER_LEN 0x00000002 /* The message xfer size can be dertermined */
85#define HTX_SL_F_XFER_ENC 0x00000004 /* The transfer-encoding header was found in message */
86#define HTX_SL_F_CLEN 0x00000008 /* The content-length header was found in message */
87#define HTX_SL_F_CHNK 0x00000010 /* The message payload is chunked */
88#define HTX_SL_F_VER_11 0x00000020 /* The message indicates version 1.1 or above */
89#define HTX_SL_F_BODYLESS 0x00000040 /* The message has no body (content-length = 0) */
90
91/* HTX flags */
92#define HTX_FL_NONE 0x00000000
93#define HTX_FL_PARSING_ERROR 0x00000001
Christopher Faulet0ef372a2019-04-08 10:57:20 +020094#define HTX_FL_UPGRADE 0x00000002
Willy Tarreaub96b77e2018-12-11 10:22:41 +010095
96
97/* Pseudo header types (max 255). */
98enum htx_phdr_type {
99 HTX_PHDR_UNKNOWN = 0,
100 HTX_PHDR_SIZE,
101};
102
103/* HTTP block's type (max 15). */
104enum htx_blk_type {
105 HTX_BLK_REQ_SL = 0, /* Request start-line */
106 HTX_BLK_RES_SL = 1, /* Response start-line */
107 HTX_BLK_HDR = 2, /* header name/value block */
108 HTX_BLK_PHDR = 3, /* pseudo header block */
109 HTX_BLK_EOH = 4, /* end-of-headers block */
110 HTX_BLK_DATA = 5, /* data block */
111 HTX_BLK_EOD = 6, /* end-of-data block */
112 HTX_BLK_TLR = 7, /* trailer name/value block */
113 HTX_BLK_EOM = 8, /* end-of-message block */
Christopher Faulet6f3cb182019-05-07 21:48:12 +0200114 /* 9 .. 14 unused */
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100115 HTX_BLK_UNUSED = 15, /* unused/removed block */
116};
117
118/* One HTTP block descriptor */
119struct htx_blk {
120 uint32_t addr; /* relative storage address of a data block */
121 uint32_t info; /* information about data stored */
122};
123
124struct htx_ret {
125 int32_t ret;
126 struct htx_blk *blk;
127};
128
129struct htx_sl {
130 unsigned int flags; /* HTX_SL_F_* */
131 union {
132 struct {
133 enum http_meth_t meth; /* method */
134 } req;
135 struct {
136 uint16_t status; /* status code */
137 } res;
138 } info;
139
140 /* XXX 2 bytes unused */
141
Christopher Faulet05c083c2019-05-15 14:56:47 +0200142 int32_t hdrs_bytes; /* Bytes held by all headers from this start-line
143 * to the corresponding EOH. -1 if unknown */
144
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100145 unsigned int len[3]; /* length of differnt parts of the start-line */
146 char l[0];
147};
148
149/* Internal representation of an HTTP message */
150struct htx {
151 uint32_t size; /* the array size, in bytes, used to store the HTTP message itself */
152 uint32_t data; /* the data size, in bytes. To known to total size used by all allocated
153 * blocks (blocks and their contents), you need to add size used by blocks,
154 * i.e. [ used * sizeof(struct htx_blk *) ] */
155
156 uint32_t used; /* number of blocks in use */
157 uint32_t tail; /* last inserted block */
Christopher Faulet28f29c72019-04-30 17:55:45 +0200158 uint32_t head; /* older inserted block */
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100159 uint32_t front; /* block's position of the first content before the blocks table */
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100160
161 uint64_t extra; /* known bytes amount remaining to receive */
162 uint32_t flags; /* HTX_FL_* */
163
Christopher Faulet29f17582019-05-23 11:03:26 +0200164 int32_t first; /* position of the first block to (re)start the analyse. -1 if unset. */
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100165
166 struct htx_blk blocks[0]; /* Blocks representing the HTTP message itself */
167};
168
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200169
170extern struct htx htx_empty;
171
172struct htx_blk *htx_defrag(struct htx *htx, struct htx_blk *blk);
173struct htx_blk *htx_add_blk(struct htx *htx, enum htx_blk_type type, uint32_t blksz);
174struct htx_blk *htx_remove_blk(struct htx *htx, struct htx_blk *blk);
Christopher Faulet00cf6972019-01-07 14:53:27 +0100175void htx_truncate(struct htx *htx, uint32_t offset);
Christopher Faulet549822f2019-02-25 10:23:19 +0100176struct htx_ret htx_drain(struct htx *htx, uint32_t max);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200177
178struct htx_blk *htx_replace_blk_value(struct htx *htx, struct htx_blk *blk,
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100179 const struct ist old, const struct ist new);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200180struct htx_ret htx_xfer_blks(struct htx *dst, struct htx *src, uint32_t count,
181 enum htx_blk_type mark);
182
Christopher Fauletf1ba18d2018-11-26 21:37:08 +0100183struct htx_sl *htx_add_stline(struct htx *htx, enum htx_blk_type type, unsigned int flags,
184 const struct ist p1, const struct ist p2, const struct ist p3);
185struct htx_sl *htx_replace_stline(struct htx *htx, struct htx_blk *blk, const struct ist p1,
186 const struct ist p2, const struct ist p3);
187
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200188struct htx_blk *htx_replace_header(struct htx *htx, struct htx_blk *blk,
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100189 const struct ist name, const struct ist value);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200190
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200191struct htx_blk *htx_add_header(struct htx *htx, const struct ist name, const struct ist value);
Willy Tarreau52610e92019-01-03 18:26:17 +0100192struct htx_blk *htx_add_blk_type_size(struct htx *htx, enum htx_blk_type type, uint32_t blksz);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200193struct htx_blk *htx_add_all_headers(struct htx *htx, const struct http_hdr *hdrs);
194struct htx_blk *htx_add_pseudo_header(struct htx *htx, enum htx_phdr_type phdr, const struct ist value);
195struct htx_blk *htx_add_endof(struct htx *htx, enum htx_blk_type type);
196struct htx_blk *htx_add_data(struct htx *htx, const struct ist data);
197struct htx_blk *htx_add_trailer(struct htx *htx, const struct ist tlr);
Christopher Faulet24ed8352018-11-22 11:20:43 +0100198struct htx_blk *htx_add_data_before(struct htx *htx, const struct htx_blk *ref, const struct ist data);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200199
Christopher Fauletc59ff232018-12-03 13:58:44 +0100200int htx_reqline_to_h1(const struct htx_sl *sl, struct buffer *chk);
201int htx_stline_to_h1(const struct htx_sl *sl, struct buffer *chk);
202int htx_hdr_to_h1(const struct ist n, const struct ist v, struct buffer *chk);
203int htx_data_to_h1(const struct ist data, struct buffer *chk, int chunked);
204int htx_trailer_to_h1(const struct ist tlr, struct buffer *chk);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200205
Christopher Faulet570d1612018-11-26 11:13:57 +0100206/* Functions and macros to get parts of the start-line or legnth of these
207 * parts
208 */
209#define HTX_SL_LEN(sl) ((sl)->len[0] + (sl)->len[1] + (sl)->len[2])
210
211#define HTX_SL_P1_LEN(sl) ((sl)->len[0])
212#define HTX_SL_P2_LEN(sl) ((sl)->len[1])
213#define HTX_SL_P3_LEN(sl) ((sl)->len[2])
214#define HTX_SL_P1_PTR(sl) ((sl)->l)
215#define HTX_SL_P2_PTR(sl) (HTX_SL_P1_PTR(sl) + HTX_SL_P1_LEN(sl))
216#define HTX_SL_P3_PTR(sl) (HTX_SL_P2_PTR(sl) + HTX_SL_P2_LEN(sl))
217
218#define HTX_SL_REQ_MLEN(sl) HTX_SL_P1_LEN(sl)
219#define HTX_SL_REQ_ULEN(sl) HTX_SL_P2_LEN(sl)
220#define HTX_SL_REQ_VLEN(sl) HTX_SL_P3_LEN(sl)
221#define HTX_SL_REQ_MPTR(sl) HTX_SL_P1_PTR(sl)
222#define HTX_SL_REQ_UPTR(sl) HTX_SL_P2_PTR(sl)
223#define HTX_SL_REQ_VPTR(sl) HTX_SL_P3_PTR(sl)
224
225#define HTX_SL_RES_VLEN(sl) HTX_SL_P1_LEN(sl)
226#define HTX_SL_RES_CLEN(sl) HTX_SL_P2_LEN(sl)
227#define HTX_SL_RES_RLEN(sl) HTX_SL_P3_LEN(sl)
228#define HTX_SL_RES_VPTR(sl) HTX_SL_P1_PTR(sl)
229#define HTX_SL_RES_CPTR(sl) HTX_SL_P2_PTR(sl)
230#define HTX_SL_RES_RPTR(sl) HTX_SL_P3_PTR(sl)
231
Willy Tarreau8de1df92019-04-15 21:27:18 +0200232static inline struct ist htx_sl_p1(const struct htx_sl *sl)
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100233{
234 return ist2(HTX_SL_P1_PTR(sl), HTX_SL_P1_LEN(sl));
235}
Christopher Faulet570d1612018-11-26 11:13:57 +0100236
Willy Tarreau8de1df92019-04-15 21:27:18 +0200237static inline struct ist htx_sl_p2(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100238{
239 return ist2(HTX_SL_P2_PTR(sl), HTX_SL_P2_LEN(sl));
240}
241
Willy Tarreau8de1df92019-04-15 21:27:18 +0200242static inline struct ist htx_sl_p3(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100243{
244 return ist2(HTX_SL_P3_PTR(sl), HTX_SL_P3_LEN(sl));
245}
246
Willy Tarreau8de1df92019-04-15 21:27:18 +0200247static inline struct ist htx_sl_req_meth(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100248{
249 return htx_sl_p1(sl);
250}
251
Willy Tarreau8de1df92019-04-15 21:27:18 +0200252static inline struct ist htx_sl_req_uri(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100253{
254 return htx_sl_p2(sl);
255}
256
Willy Tarreau8de1df92019-04-15 21:27:18 +0200257static inline struct ist htx_sl_req_vsn(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100258{
259 return htx_sl_p3(sl);
260}
261
262
Willy Tarreau8de1df92019-04-15 21:27:18 +0200263static inline struct ist htx_sl_res_vsn(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100264{
265 return htx_sl_p1(sl);
266}
267
Willy Tarreau8de1df92019-04-15 21:27:18 +0200268static inline struct ist htx_sl_res_code(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100269{
270 return htx_sl_p2(sl);
271}
272
Willy Tarreau8de1df92019-04-15 21:27:18 +0200273static inline struct ist htx_sl_res_reason(const struct htx_sl *sl)
Christopher Faulet570d1612018-11-26 11:13:57 +0100274{
275 return htx_sl_p3(sl);
276}
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200277
278/* Returns the array index of a block given its position <pos> */
279static inline uint32_t htx_pos_to_idx(const struct htx *htx, uint32_t pos)
280{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100281 return ((htx->size / sizeof(htx->blocks[0])) - pos - 1);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200282}
283
284/* Returns the position of the block <blk> */
285static inline uint32_t htx_get_blk_pos(const struct htx *htx, const struct htx_blk *blk)
286{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100287 return (htx->blocks + (htx->size / sizeof(htx->blocks[0])) - blk - 1);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200288}
289
290/* Returns the block at the position <pos> */
291static inline struct htx_blk *htx_get_blk(const struct htx *htx, uint32_t pos)
292{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100293 return ((struct htx_blk *)(htx->blocks) + htx_pos_to_idx(htx, pos));
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200294}
295
296/* Returns the type of the block <blk> */
297static inline enum htx_blk_type htx_get_blk_type(const struct htx_blk *blk)
298{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100299 return (blk->info >> 28);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200300}
301
302/* Returns the pseudo-header type of the block <blk>. If it's not a
303 * pseudo-header, HTX_PHDR_UNKNOWN is returned.
304 */
305static inline enum htx_phdr_type htx_get_blk_phdr(const struct htx_blk *blk)
306{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100307 enum htx_blk_type type = htx_get_blk_type(blk);
308 enum htx_phdr_type phdr;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200309
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100310 switch (type) {
311 case HTX_BLK_PHDR:
312 phdr = (blk->info & 0xff);
313 return phdr;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200314
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100315 default:
316 /* Not a pseudo-header */
317 return HTX_PHDR_UNKNOWN;
318 }
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200319}
320
321/* Returns the size of the block <blk>, depending of its type */
322static inline uint32_t htx_get_blksz(const struct htx_blk *blk)
323{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100324 enum htx_blk_type type = htx_get_blk_type(blk);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200325
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100326 switch (type) {
327 case HTX_BLK_HDR:
328 /* name.length + value.length */
329 return ((blk->info & 0xff) + ((blk->info >> 8) & 0xfffff));
330 case HTX_BLK_PHDR:
331 /* value.length */
332 return ((blk->info >> 8) & 0xfffff);
333 default:
334 /* value.length */
335 return (blk->info & 0xfffffff);
336 }
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200337}
338
Christopher Faulet28f29c72019-04-30 17:55:45 +0200339/* Returns the wrap position, ie the position where the blocks table wraps.
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200340 *
341 * An signed 32-bits integer is returned to handle -1 case. Blocks position are
342 * store on unsigned 32-bits integer, but it is impossible to have so much
343 * blocks to overflow a 32-bits signed integer !
344 */
Christopher Faulet28f29c72019-04-30 17:55:45 +0200345static inline int32_t htx_get_wrap(const struct htx *htx)
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200346{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100347 if (!htx->used)
348 return -1;
Christopher Faulet28f29c72019-04-30 17:55:45 +0200349 return ((htx->tail >= htx->head)
350 ? (htx->used + htx->head)
351 : (htx->used - 1) + (htx->head - htx->tail));
352}
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200353
Christopher Faulet28f29c72019-04-30 17:55:45 +0200354/* Returns the position of the oldest entry (head).
355 *
356 * An signed 32-bits integer is returned to handle -1 case. Blocks position are
357 * store on unsigned 32-bits integer, but it is impossible to have so much
358 * blocks to overflow a 32-bits signed integer !
359 */
360static inline int32_t htx_get_head(const struct htx *htx)
361{
362 return (htx->used ? htx->head : -1);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200363}
364
365/* Returns the oldest HTX block (head) if the HTX message is not
366 * empty. Otherwise it returns NULL.
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100367 */
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200368static inline struct htx_blk *htx_get_head_blk(const struct htx *htx)
369{
370 int32_t head = htx_get_head(htx);
371
372 return ((head == -1) ? NULL : htx_get_blk(htx, head));
373}
374
375/* Returns the type of the oldest HTX block (head) if the HTX message is not
376 * empty. Otherwise it returns HTX_BLK_UNUSED.
377 */
378static inline enum htx_blk_type htx_get_head_type(const struct htx *htx)
379{
380 struct htx_blk *blk = htx_get_head_blk(htx);
381
382 return (blk ? htx_get_blk_type(blk) : HTX_BLK_UNUSED);
383}
384
385/* Returns the position of the newest entry (tail).
386 *
387 * An signed 32-bits integer is returned to handle -1 case. Blocks position are
388 * store on unsigned 32-bits integer, but it is impossible to have so much
389 * blocks to overflow a 32-bits signed integer !
390 */
391static inline int32_t htx_get_tail(const struct htx *htx)
392{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100393 return (htx->used ? htx->tail : -1);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200394}
395
396/* Returns the newest HTX block (tail) if the HTX message is not
397 * empty. Otherwise it returns NULL.
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100398 */
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200399static inline struct htx_blk *htx_get_tail_blk(const struct htx *htx)
400{
401 int32_t tail = htx_get_tail(htx);
402
403 return ((tail == -1) ? NULL : htx_get_blk(htx, tail));
404}
405
406/* Returns the type of the newest HTX block (tail) if the HTX message is not
407 * empty. Otherwise it returns HTX_BLK_UNUSED.
408 */
409static inline enum htx_blk_type htx_get_tail_type(const struct htx *htx)
410{
411 struct htx_blk *blk = htx_get_tail_blk(htx);
412
413 return (blk ? htx_get_blk_type(blk) : HTX_BLK_UNUSED);
414}
415
Christopher Faulet29f17582019-05-23 11:03:26 +0200416/* Returns the position of the first block in the HTX message <htx>. If unset,
417 * or if <htx> is empty, -1 is returned.
Christopher Fauleta3ad6b12019-05-13 11:36:27 +0200418 *
419 * An signed 32-bits integer is returned to handle -1 case. Blocks position are
420 * store on unsigned 32-bits integer, but it is impossible to have so much
421 * blocks to overflow a 32-bits signed integer !
422 */
423static inline int32_t htx_get_first(const struct htx *htx)
424{
Christopher Faulet29f17582019-05-23 11:03:26 +0200425 if (!htx->used)
426 return -1;
427 return htx->first;
Christopher Fauleta3ad6b12019-05-13 11:36:27 +0200428}
429
Christopher Faulet29f17582019-05-23 11:03:26 +0200430/* Returns the first HTX block in the HTX message <htx>. If unset or if <htx> is
431 * empty, NULL returned.
Christopher Fauleta3ad6b12019-05-13 11:36:27 +0200432 */
433static inline struct htx_blk *htx_get_first_blk(const struct htx *htx)
434{
435 int32_t pos;
436
437 pos = htx_get_first(htx);
438 return ((pos == -1) ? NULL : htx_get_blk(htx, pos));
439}
440
441/* Returns the type of the first block in the HTX message <htx>. If unset or if
442 * <htx> is empty, HTX_BLK_UNUSED is returned.
443 */
444static inline enum htx_blk_type htx_get_first_type(const struct htx *htx)
445{
446 struct htx_blk *blk = htx_get_first_blk(htx);
447
448 return (blk ? htx_get_blk_type(blk) : HTX_BLK_UNUSED);
449}
450
Joseph Herlantc42c0e92018-11-25 10:43:27 -0800451/* Returns the position of block immediately before the one pointed by <pos>. If
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200452 * the message is empty or if <pos> is the position of the head, -1 returned.
453 *
454 * An signed 32-bits integer is returned to handle -1 case. Blocks position are
455 * store on unsigned 32-bits integer, but it is impossible to have so much
456 * blocks to overflow a 32-bits signed integer !
457 */
458static inline int32_t htx_get_prev(const struct htx *htx, uint32_t pos)
459{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100460 int32_t head;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200461
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100462 head = htx_get_head(htx);
463 if (head == -1 || pos == head)
464 return -1;
Christopher Faulet28f29c72019-04-30 17:55:45 +0200465 if (!pos) {
466 /* htx_get_wrap() is always greater than 1 here */
467 return (htx_get_wrap(htx) - 1);
468 }
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100469 return (pos - 1);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200470}
471
Christopher Fauletd16b0a72018-11-22 11:23:23 +0100472/* Returns the HTX block before <blk> in the HTX message <htx>. If <blk> is the
473 * head, NULL returned.
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100474 */
Christopher Fauletd16b0a72018-11-22 11:23:23 +0100475static inline struct htx_blk *htx_get_prev_blk(const struct htx *htx,
476 const struct htx_blk *blk)
477{
478 int32_t pos;
479
480 pos = htx_get_prev(htx, htx_get_blk_pos(htx, blk));
481 return ((pos == -1) ? NULL : htx_get_blk(htx, pos));
482}
483
Joseph Herlantc42c0e92018-11-25 10:43:27 -0800484/* Returns the position of block immediately after the one pointed by <pos>. If
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200485 * the message is empty or if <pos> is the position of the tail, -1 returned.
486 *
487 * An signed 32-bits integer is returned to handle -1 case. Blocks position are
488 * store on unsigned 32-bits integer, but it is impossible to have so much
489 * blocks to overflow a 32-bits signed integer !
490 */
491static inline int32_t htx_get_next(const struct htx *htx, uint32_t pos)
492{
Christopher Faulet28f29c72019-04-30 17:55:45 +0200493 if (!htx->used || pos == htx->tail)
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100494 return -1;
495 pos++;
Christopher Faulet28f29c72019-04-30 17:55:45 +0200496 if (pos == htx_get_wrap(htx))
497 return 0;
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100498 return pos;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200499
500}
Christopher Fauletd16b0a72018-11-22 11:23:23 +0100501
502/* Returns the HTX block after <blk> in the HTX message <htx>. If <blk> is the
503 * tail, NULL returned.
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100504 */
Christopher Fauletd16b0a72018-11-22 11:23:23 +0100505static inline struct htx_blk *htx_get_next_blk(const struct htx *htx,
506 const struct htx_blk *blk)
507{
508 int32_t pos;
509
510 pos = htx_get_next(htx, htx_get_blk_pos(htx, blk));
511 return ((pos == -1) ? NULL : htx_get_blk(htx, pos));
512}
513
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200514static inline int32_t htx_find_front(const struct htx *htx)
515{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100516 int32_t front, pos;
517 uint32_t addr = 0;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200518
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100519 if (!htx->used)
520 return -1;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200521
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100522 front = -1;
523 for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
524 struct htx_blk *blk = htx_get_blk(htx, pos);
525 enum htx_blk_type type = htx_get_blk_type(blk);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200526
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100527 if (type != HTX_BLK_UNUSED && blk->addr >= addr) {
528 front = pos;
529 addr = blk->addr;
530 }
531 }
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200532
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100533 return front;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200534}
535
536/* Changes the size of the value. It is the caller responsibility to change the
537 * value itself, make sure there is enough space and update allocated value.
538 */
539static inline void htx_set_blk_value_len(struct htx_blk *blk, uint32_t vlen)
540{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100541 enum htx_blk_type type = htx_get_blk_type(blk);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200542
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100543 switch (type) {
544 case HTX_BLK_HDR:
545 case HTX_BLK_PHDR:
546 blk->info = (type << 28) + (vlen << 8) + (blk->info & 0xff);
547 break;
548 case HTX_BLK_REQ_SL:
549 case HTX_BLK_RES_SL:
550 case HTX_BLK_DATA:
551 case HTX_BLK_TLR:
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100552 blk->info = (type << 28) + vlen;
553 break;
554 default:
555 /* Unexpected case */
556 break;
557 }
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200558}
559
560/* Returns the data pointer of the block <blk> */
561static inline void *htx_get_blk_ptr(const struct htx *htx, const struct htx_blk *blk)
562{
563 return ((void *)htx->blocks + blk->addr);
564}
565
566/* Returns the name of the block <blk>, only if it is a header. Otherwise it
567 * returns an empty name.
568 */
569static inline struct ist htx_get_blk_name(const struct htx *htx, const struct htx_blk *blk)
570{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100571 enum htx_blk_type type = htx_get_blk_type(blk);
572 struct ist ret;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200573
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100574 switch (type) {
575 case HTX_BLK_HDR:
576 ret.ptr = htx_get_blk_ptr(htx, blk);
577 ret.len = blk->info & 0xff;
578 break;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200579
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100580 default:
581 return ist("");
582 }
583 return ret;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200584}
585
Christopher Faulet54483df2018-11-26 15:05:52 +0100586
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200587/* Returns the value of the block <blk>, depending on its type. If there is no
588 * value, an empty one is retruned.
589 */
590static inline struct ist htx_get_blk_value(const struct htx *htx, const struct htx_blk *blk)
591{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100592 enum htx_blk_type type = htx_get_blk_type(blk);
593 struct ist ret;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200594
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100595 switch (type) {
596 case HTX_BLK_HDR:
597 ret.ptr = htx_get_blk_ptr(htx, blk) + (blk->info & 0xff);
598 ret.len = (blk->info >> 8) & 0xfffff;
599 break;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200600
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100601 case HTX_BLK_PHDR:
602 ret.ptr = htx_get_blk_ptr(htx, blk);
603 ret.len = (blk->info >> 8) & 0xfffff;
604 break;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200605
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100606 case HTX_BLK_REQ_SL:
607 case HTX_BLK_RES_SL:
608 case HTX_BLK_DATA:
609 case HTX_BLK_TLR:
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100610 ret.ptr = htx_get_blk_ptr(htx, blk);
611 ret.len = blk->info & 0xfffffff;
612 break;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200613
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100614 default:
615 return ist("");
616 }
617 return ret;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200618}
619
Willy Tarreauc01ed9f2018-11-30 14:29:31 +0100620/* Removes <n> bytes from the beginning of DATA block <blk>. The block's start
621 * address and its length are adjusted, and the htx's total data count is
622 * updated. This is used to mark that part of some data were transfered
623 * from a DATA block without removing this DATA block. No sanity check is
624 * performed, the caller is reponsible for doing this exclusively on DATA
625 * blocks, and never removing more than the block's size.
626 */
627static inline void htx_cut_data_blk(struct htx *htx, struct htx_blk *blk, uint32_t n)
628{
629 blk->addr += n;
630 blk->info -= n;
631 htx->data -= n;
632}
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200633
634/* Returns the space used by metadata in <htx>. */
635static inline uint32_t htx_meta_space(const struct htx *htx)
636{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100637 return (htx->used * sizeof(htx->blocks[0]));
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200638}
639
640/* Returns the space used (data + metadata) in <htx> */
641static inline uint32_t htx_used_space(const struct htx *htx)
642{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100643 return (htx->data + htx_meta_space(htx));
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200644}
645
646/* Returns the free space in <htx> */
647static inline uint32_t htx_free_space(const struct htx *htx)
648{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100649 return (htx->size - htx_used_space(htx));
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200650}
651
Christopher Faulet8564c1f2019-01-07 13:48:55 +0100652/* Returns the maximum space usable for data in <htx>. This is in fact the
653 * maximum sice for a uniq block to fill the HTX message. */
654static inline uint32_t htx_max_data_space(const struct htx *htx)
655{
656 if (!htx->size)
657 return 0;
658 return (htx->size - sizeof(htx->blocks[0]));
659}
660
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200661/* Returns the maximum size available to store some data in <htx> if a new block
662 * is reserved.
663 */
664static inline uint32_t htx_free_data_space(const struct htx *htx)
665{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100666 uint32_t free = htx_free_space(htx);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200667
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100668 if (free < sizeof(htx->blocks[0]))
669 return 0;
670 return (free - sizeof(htx->blocks[0]));
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200671}
672
Christopher Faulet2ae35042019-05-16 11:16:39 +0200673/* Returns the maximum size for a block, not exceeding <max> bytes. <max> may be
674 * set to -1 to have no limit.
675 */
676static inline uint32_t htx_get_max_blksz(const struct htx *htx, int32_t max)
677{
678 uint32_t free = htx_free_space(htx);
679
680 if (max != -1 && free > max)
681 free = max;
682 if (free < sizeof(htx->blocks[0]))
683 return 0;
684 return (free - sizeof(htx->blocks[0]));
685}
686
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200687/* Returns 1 if the message has less than 1/4 of its capacity free, otherwise 0 */
688static inline int htx_almost_full(const struct htx *htx)
689{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100690 if (!htx->size || htx_free_space(htx) < htx->size / 4)
691 return 1;
692 return 0;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200693}
694
695static inline void htx_reset(struct htx *htx)
696{
Christopher Faulet28f29c72019-04-30 17:55:45 +0200697 htx->data = htx->used = htx->tail = htx->head = htx->front = 0;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200698 htx->extra = 0;
699 htx->flags = HTX_FL_NONE;
Christopher Faulet29f17582019-05-23 11:03:26 +0200700 htx->first = -1;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200701}
702
Willy Tarreau3906e222018-12-05 07:56:25 +0100703/* returns the available room for raw data in buffer <buf> once HTX overhead is
704 * taken into account (one HTX header and two blocks). The purpose is to figure
705 * the optimal fill length to avoid copies.
706 */
707static inline size_t buf_room_for_htx_data(const struct buffer *buf)
708{
709 size_t room;
710
711 room = b_room(buf);
712 if (room <= sizeof(struct htx) + 2 * sizeof(struct htx_blk))
713 room = 0;
714 else
715 room -= sizeof(struct htx) + 2 * sizeof(struct htx_blk);
716
717 return room;
718}
719
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100720
721/* Returns an HTX message using the buffer <buf>. Unlike htx_from_buf(), this
Willy Tarreau245d1892019-01-31 07:21:42 +0100722 * function does not update to the buffer.
723 * Note that it always returns a valid pointer, either to an initialized buffer
724 * or to the empty buffer.
725 */
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100726static inline struct htx *htxbuf(const struct buffer *buf)
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200727{
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100728 struct htx *htx;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200729
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100730 if (b_is_null(buf))
731 return &htx_empty;
732 htx = ((struct htx *)(buf->area));
733 if (!b_data(buf)) {
Willy Tarreau8ae42352018-12-05 09:47:34 +0100734 htx->size = buf->size - sizeof(*htx);
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100735 htx_reset(htx);
Willy Tarreau8ae42352018-12-05 09:47:34 +0100736 }
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200737 return htx;
738}
739
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100740/* Returns an HTX message using the buffer <buf>. <buf> is updated to appear as
741 * full. It is the caller responsibility to call htx_to_buf() when it finish to
Willy Tarreau245d1892019-01-31 07:21:42 +0100742 * manipulate the HTX message to update <buf> accordingly. The returned pointer
743 * is always valid.
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100744 *
Willy Tarreau245d1892019-01-31 07:21:42 +0100745 * The caller can call htxbuf() function to avoid any update of the buffer.
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100746 */
747static inline struct htx *htx_from_buf(struct buffer *buf)
748{
749 struct htx *htx = htxbuf(buf);
750
751 b_set_data(buf, b_size(buf));
752 return htx;
753}
754
755/* Upate <buf> accordingly to the HTX message <htx> */
756static inline void htx_to_buf(struct htx *htx, struct buffer *buf)
757{
Christopher Faulet0ef372a2019-04-08 10:57:20 +0200758 if (!htx->used && !(htx->flags & (HTX_FL_PARSING_ERROR|HTX_FL_UPGRADE))) {
Christopher Faulet27ba2dc2018-12-05 11:53:24 +0100759 htx_reset(htx);
760 b_set_data(buf, 0);
761 }
762 else
763 b_set_data(buf, b_size(buf));
764}
765
Willy Tarreaue5fcfbe2019-01-31 07:31:18 +0100766/* Returns 1 if the message is empty, otherwise it returns 0. Note that it is
767 * illegal to call this with htx == NULL.
768 */
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200769static inline int htx_is_empty(const struct htx *htx)
770{
Willy Tarreaue5fcfbe2019-01-31 07:31:18 +0100771 return !htx->used;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200772}
773
Willy Tarreaue5fcfbe2019-01-31 07:31:18 +0100774/* Returns 1 if the message is not empty, otherwise it returns 0. Note that it
775 * is illegal to call this with htx == NULL.
776 */
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200777static inline int htx_is_not_empty(const struct htx *htx)
778{
Willy Tarreaue5fcfbe2019-01-31 07:31:18 +0100779 return htx->used;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200780}
781
782/* For debugging purpose */
783static inline const char *htx_blk_type_str(enum htx_blk_type type)
784{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100785 switch (type) {
786 case HTX_BLK_REQ_SL: return "HTX_BLK_REQ_SL";
787 case HTX_BLK_RES_SL: return "HTX_BLK_RES_SL";
788 case HTX_BLK_HDR: return "HTX_BLK_HDR";
789 case HTX_BLK_PHDR: return "HTX_BLK_PHDR";
790 case HTX_BLK_EOH: return "HTX_BLK_EOH";
791 case HTX_BLK_DATA: return "HTX_BLK_DATA";
792 case HTX_BLK_EOD: return "HTX_BLK_EOD";
793 case HTX_BLK_TLR: return "HTX_BLK_TLR";
794 case HTX_BLK_EOM: return "HTX_BLK_EOM";
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100795 case HTX_BLK_UNUSED: return "HTX_BLK_UNUSED";
796 default: return "HTX_BLK_???";
797 };
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200798}
799
800static inline const char *htx_blk_phdr_str(enum htx_phdr_type phdr)
801{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100802 switch (phdr) {
803 case HTX_PHDR_UNKNOWN: return "HTX_PHDR_UNKNOWN";
804 default: return "HTX_PHDR_???";
805 }
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200806}
807
808static inline void htx_dump(struct htx *htx)
809{
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100810 int32_t pos;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200811
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100812 fprintf(stderr, "htx:%p [ size=%u - data=%u - used=%u - wrap=%s - extra=%llu]\n",
Christopher Faulet28f29c72019-04-30 17:55:45 +0200813 htx, htx->size, htx->data, htx->used, (htx->tail >= htx->head) ? "NO" : "YES",
Willy Tarreaua7280a12018-11-26 19:41:40 +0100814 (unsigned long long)htx->extra);
Christopher Faulet29f17582019-05-23 11:03:26 +0200815 fprintf(stderr, "\tfirst=%d - head=%u, tail=%u - front=%u\n",
816 htx->first, htx->head, htx->tail, htx->front);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200817
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100818 for (pos = htx_get_head(htx); pos != -1; pos = htx_get_next(htx, pos)) {
Christopher Faulet570d1612018-11-26 11:13:57 +0100819 struct htx_sl *sl;
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100820 struct htx_blk *blk = htx_get_blk(htx, pos);
821 enum htx_blk_type type = htx_get_blk_type(blk);
822 enum htx_phdr_type phdr = htx_get_blk_phdr(blk);
823 uint32_t sz = htx_get_blksz(blk);
824 struct ist n, v;
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200825
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100826 n = htx_get_blk_name(htx, blk);
827 v = htx_get_blk_value(htx, blk);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200828
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100829 if (type == HTX_BLK_REQ_SL || type == HTX_BLK_RES_SL) {
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200830 sl = htx_get_blk_ptr(htx, blk);
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100831 fprintf(stderr, "\t\t[%u] type=%-17s - size=%-6u - addr=%-6u\t%.*s %.*s %.*s\n",
832 pos, htx_blk_type_str(type), sz, blk->addr,
833 HTX_SL_P1_LEN(sl), HTX_SL_P1_PTR(sl),
834 HTX_SL_P2_LEN(sl), HTX_SL_P2_PTR(sl),
835 HTX_SL_P3_LEN(sl), HTX_SL_P3_PTR(sl));
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200836 }
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100837 else if (type == HTX_BLK_HDR)
838 fprintf(stderr, "\t\t[%u] type=%-17s - size=%-6u - addr=%-6u\t%.*s: %.*s\n",
839 pos, htx_blk_type_str(type), sz, blk->addr,
840 (int)n.len, n.ptr,
841 (int)v.len, v.ptr);
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200842
Christopher Fauletaa75b3d2018-12-05 16:20:40 +0100843 else if (type == HTX_BLK_PHDR)
844 fprintf(stderr, "\t\t[%u] type=%-17s - size=%-6u - addr=%-6u\t%.*s\n",
845 pos, htx_blk_phdr_str(phdr), sz, blk->addr,
846 (int)v.len, v.ptr);
847 else
848 fprintf(stderr, "\t\t[%u] type=%-17s - size=%-6u - addr=%-6u%s\n",
849 pos, htx_blk_type_str(type), sz, blk->addr,
850 (!v.len ? "\t<empty>" : ""));
851 }
852 fprintf(stderr, "\n");
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200853}
854
Willy Tarreaub96b77e2018-12-11 10:22:41 +0100855#endif /* _COMMON_HTX_H */
Christopher Fauleta3d2a162018-10-22 08:59:39 +0200856
857/*
858 * Local variables:
859 * c-indent-level: 8
860 * c-basic-offset: 8
861 * End:
862 */