blob: 5241a3a7ecc6a8fafcaf17dcb19d64fa55e00fa0 [file] [log] [blame]
Emeric Brun107ca302010-01-04 16:16:05 +01001/*
Willy Tarreaucd3b0942012-04-27 21:52:18 +02002 * include/proto/sample.h
3 * Functions for samples management.
Emeric Brun107ca302010-01-04 16:16:05 +01004 *
5 * Copyright (C) 2009-2010 EXCELIANCE, Emeric Brun <ebrun@exceliance.fr>
Willy Tarreaucd3b0942012-04-27 21:52:18 +02006 * Copyright (C) 2012 Willy Tarreau <w@1wt.eu>
Emeric Brun107ca302010-01-04 16:16:05 +01007 *
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
Willy Tarreaucd3b0942012-04-27 21:52:18 +020023#ifndef _PROTO_SAMPLE_H
24#define _PROTO_SAMPLE_H
Emeric Brun107ca302010-01-04 16:16:05 +010025
Willy Tarreaucd3b0942012-04-27 21:52:18 +020026#include <types/sample.h>
Emeric Brun107ca302010-01-04 16:16:05 +010027#include <types/stick_table.h>
28
Willy Tarreau7e2c6472012-10-29 20:44:36 +010029/* only exported for late memory allocation, do not use */
30extern char *sample_trash_buf1;
31extern char *sample_trash_buf2;
32
Willy Tarreau12785782012-04-27 21:37:17 +020033struct sample_expr *sample_parse_expr(char **str, int *idx, char *err, int err_size);
34struct sample *sample_process(struct proxy *px, struct session *l4,
35 void *l7, unsigned int dir, struct sample_expr *expr,
Willy Tarreaub4a88f02012-04-23 21:35:11 +020036 struct sample *p);
Willy Tarreaue7ad4bb2012-12-21 00:02:32 +010037struct sample *sample_fetch_string(struct proxy *px, struct session *l4, void *l7,
38 unsigned int opt, struct sample_expr *expr);
Willy Tarreau12785782012-04-27 21:37:17 +020039void sample_register_fetches(struct sample_fetch_kw_list *psl);
40void sample_register_convs(struct sample_conv_kw_list *psl);
Emeric Bruna068a292012-10-17 15:34:03 +020041struct chunk *sample_get_trash_chunk(void);
Willy Tarreaucd3b0942012-04-27 21:52:18 +020042
43#endif /* _PROTO_SAMPLE_H */