Code Coverage: vinyl-cache/include/vcl.h
 
82217aa4fc7094b3610340078afaf78cd95a8ec9
 
0
/*
1
 * NB:  This file is machine generated, DO NOT EDIT!
2
 *
3
 * Edit and run lib/libvcc/generate.py instead.
4
 */
5
6
#ifdef VCL_H_INCLUDED
7
#  error "vcl.h included multiple times"
8
#endif
9
#define VCL_H_INCLUDED
10
11
#ifndef VRT_H_INCLUDED
12
#  error "include vrt.h before vcl.h"
13
#endif
14
15
/* VCL Methods */
16 647052
#define VCL_MET_RECV                    (1U << 1)
17 701724
#define VCL_MET_PIPE                    (1U << 2)
18 635221
#define VCL_MET_PASS                    (1U << 3)
19 639862
#define VCL_MET_HASH                    (1U << 4)
20 625790
#define VCL_MET_PURGE                   (1U << 5)
21 632003
#define VCL_MET_MISS                    (1U << 6)
22 669638
#define VCL_MET_HIT                     (1U << 7)
23 741124
#define VCL_MET_DELIVER                 (1U << 8)
24 712054
#define VCL_MET_SYNTH                   (1U << 9)
25 546109
#define VCL_MET_BACKEND_FETCH           (1U << 10)
26 694676
#define VCL_MET_BACKEND_REFRESH         (1U << 11)
27 696716
#define VCL_MET_BACKEND_RESPONSE        (1U << 12)
28 652550
#define VCL_MET_BACKEND_ERROR           (1U << 13)
29 446568
#define VCL_MET_INIT                    (1U << 14)
30 443757
#define VCL_MET_FINI                    (1U << 15)
31
32 52544
#define VCL_MET_MAX                     16
33
34
#define VCL_MET_MASK                    0xffff
35
36 161846
#define VCL_MET_TASK_B                  ( VCL_MET_BACKEND_FETCH | \
37 161846
                                          VCL_MET_BACKEND_REFRESH | \
38 161846
                                          VCL_MET_BACKEND_RESPONSE | \
39 161846
                                          VCL_MET_BACKEND_ERROR )
40 161965
#define VCL_MET_TASK_C                  ( VCL_MET_RECV | \
41 161965
                                          VCL_MET_PIPE | \
42 161965
                                          VCL_MET_PASS | \
43 161965
                                          VCL_MET_HASH | \
44 161965
                                          VCL_MET_PURGE | \
45 161965
                                          VCL_MET_MISS | \
46 161965
                                          VCL_MET_HIT | \
47 161965
                                          VCL_MET_DELIVER | \
48 161965
                                          VCL_MET_SYNTH )
49 219730
#define VCL_MET_TASK_H                  ( VCL_MET_INIT | \
50 219730
                                          VCL_MET_FINI )
51
52 160762
#define VCL_MET_TASK_ALL                ( VCL_MET_TASK_C | \
53 160762
                                          VCL_MET_TASK_B | \
54 160762
                                          VCL_MET_TASK_H )
55
/* VCL Returns */
56 15339
#define VCL_RET_ABANDON                 1
57 8
#define VCL_RET_BERESP                  2
58 42156
#define VCL_RET_DELIVER                 3
59 24449
#define VCL_RET_ERROR                   4
60 150881
#define VCL_RET_FAIL                    5
61 17845
#define VCL_RET_FETCH                   6
62 10344
#define VCL_RET_HASH                    7
63 11720
#define VCL_RET_LOOKUP                  8
64 3096
#define VCL_RET_MERGE                   9
65 5
#define VCL_RET_OBJ_STALE               10
66 6060
#define VCL_RET_OK                      11
67 23494
#define VCL_RET_PASS                    12
68 11860
#define VCL_RET_PIPE                    13
69 31
#define VCL_RET_PURGE                   14
70 11158
#define VCL_RET_RESTART                 15
71 3143
#define VCL_RET_RETRY                   16
72 184581
#define VCL_RET_SYNTH                   17
73 78520
#define VCL_RET_VCL                     18
74
75 82521
#define VCL_RET_MAX                     19
76
77
/* VCL Types */
78
struct vrt_type {
79
        unsigned                magic;
80
#define VRT_TYPE_MAGIC          0xa943bc32
81
        const char              *lname;
82
        const char              *uname;
83
        const char              *ctype;
84
        size_t                  szof;
85
};
86
87
extern const struct vrt_type VCL_TYPE_ACL[1];
88
extern const struct vrt_type VCL_TYPE_BACKEND[1];
89
extern const struct vrt_type VCL_TYPE_BLOB[1];
90
extern const struct vrt_type VCL_TYPE_BODY[1];
91
extern const struct vrt_type VCL_TYPE_BOOL[1];
92
extern const struct vrt_type VCL_TYPE_BYTES[1];
93
extern const struct vrt_type VCL_TYPE_DURATION[1];
94
extern const struct vrt_type VCL_TYPE_ENUM[1];
95
extern const struct vrt_type VCL_TYPE_HEADER[1];
96
extern const struct vrt_type VCL_TYPE_HTTP[1];
97
extern const struct vrt_type VCL_TYPE_INSTANCE[1];
98
extern const struct vrt_type VCL_TYPE_INT[1];
99
extern const struct vrt_type VCL_TYPE_IP[1];
100
extern const struct vrt_type VCL_TYPE_PROBE[1];
101
extern const struct vrt_type VCL_TYPE_REAL[1];
102
extern const struct vrt_type VCL_TYPE_REGEX[1];
103
extern const struct vrt_type VCL_TYPE_STEVEDORE[1];
104
extern const struct vrt_type VCL_TYPE_STRANDS[1];
105
extern const struct vrt_type VCL_TYPE_STRING[1];
106
extern const struct vrt_type VCL_TYPE_STRINGS[1];
107
extern const struct vrt_type VCL_TYPE_SUB[1];
108
extern const struct vrt_type VCL_TYPE_TIME[1];
109
extern const struct vrt_type VCL_TYPE_VCL[1];
110
extern const struct vrt_type VCL_TYPE_VOID[1];
111
112
/* Compiled VCL Interface */
113
typedef int vcl_event_f(VRT_CTX, enum vcl_event_e);
114
typedef int vcl_init_f(VRT_CTX);
115
typedef void vcl_fini_f(VRT_CTX);
116
117
struct VCL_conf {
118
        unsigned                magic;
119 2664
#define VCL_CONF_MAGIC          0x7406c509      /* from /dev/random */
120
121
        unsigned                syntax;
122
        VCL_BACKEND             *default_director;
123
        VCL_PROBE               default_probe;
124
        unsigned                nref;
125
        const struct vpi_ref    *ref;
126
127
        unsigned                nsrc;
128
        unsigned                nsub;
129
        const char              **srcname;
130
        const char              **srcbody;
131
132
        int                     nvmod;
133
        const struct vpi_ii     *instance_info;
134
135
        vcl_event_f             *event_vcl;
136
137
        vcl_func_f              *recv_func;
138
        vcl_func_f              *pipe_func;
139
        vcl_func_f              *pass_func;
140
        vcl_func_f              *hash_func;
141
        vcl_func_f              *purge_func;
142
        vcl_func_f              *miss_func;
143
        vcl_func_f              *hit_func;
144
        vcl_func_f              *deliver_func;
145
        vcl_func_f              *synth_func;
146
        vcl_func_f              *backend_fetch_func;
147
        vcl_func_f              *backend_refresh_func;
148
        vcl_func_f              *backend_response_func;
149
        vcl_func_f              *backend_error_func;
150
        vcl_func_f              *init_func;
151
        vcl_func_f              *fini_func;
152
153
};