source: bin/varnishtest/vtc.h @ 8aa1d8

Revision 8aa1d8, 3.0 KB checked in by Poul-Henning Kamp <phk@…>, 3 years ago (diff)

Eliminate nested <*.h> includes from include/*

Sort #includes according to rules which are for me to know and you
to guess.

  • Property mode set to 100644
Line 
1/*-
2 * Copyright (c) 2008-2011 Varnish Software AS
3 * All rights reserved.
4 *
5 * Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 *    notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 */
29
30#include <errno.h>
31#include <limits.h>
32#include <signal.h>
33#include <pthread.h>
34#ifdef HAVE_PTHREAD_NP_H
35#include <pthread_np.h>
36#endif
37
38#include "miniobj.h"
39#include "vas.h"
40#include "vdef.h"
41#include "vqueue.h"
42#include "vsb.h"
43
44struct vtclog;
45struct cmds;
46
47#define CMD_ARGS \
48    char * const *av, void *priv, const struct cmds *cmd, struct vtclog *vl
49
50typedef void cmd_f(CMD_ARGS);
51
52struct cmds {
53        const char      *name;
54        cmd_f           *cmd;
55};
56
57void parse_string(char *buf, const struct cmds *cmd, void *priv,
58    struct vtclog *vl);
59
60cmd_f cmd_delay;
61cmd_f cmd_server;
62cmd_f cmd_client;
63cmd_f cmd_varnish;
64cmd_f cmd_sema;
65
66extern volatile sig_atomic_t vtc_error; /* Error, bail out */
67extern int vtc_stop;            /* Abandon current test, no error */
68extern pthread_t        vtc_thread;
69
70void init_sema(void);
71
72int http_process(struct vtclog *vl, const char *spec, int sock, int *sfd);
73
74void cmd_server_genvcl(struct vsb *vsb);
75
76void vtc_loginit(char *buf, unsigned buflen);
77struct vtclog *vtc_logopen(const char *id);
78void vtc_logclose(struct vtclog *vl);
79void vtc_log(struct vtclog *vl, unsigned lvl, const char *fmt, ...);
80void vtc_dump(struct vtclog *vl, unsigned lvl, const char *pfx,
81    const char *str, int len);
82void vtc_hexdump(struct vtclog *vl, unsigned lvl, const char *pfx,
83    const unsigned char *str, int len);
84
85int exec_file(const char *fn, const char *script, const char *tmpdir,
86    char *logbuf, unsigned loglen);
87
88void macro_def(struct vtclog *vl, const char *instance, const char *name,
89    const char *fmt, ...);
90struct vsb *macro_expand(struct vtclog *vl, const char *text);
91
92void extmacro_def(const char *name, const char *fmt, ...);
Note: See TracBrowser for help on using the repository browser.