blob: d467e1408d99f6f65eafe277b45135e5da0f6bde [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
Willy Tarreau03fa5df2010-05-24 21:02:37 +02002 * Frontend variables and functions.
Willy Tarreaubaaee002006-06-26 02:48:02 +02003 *
Willy Tarreau03fa5df2010-05-24 21:02:37 +02004 * Copyright 2000-2010 Willy Tarreau <w@1wt.eu>
Willy Tarreaubaaee002006-06-26 02:48:02 +02005 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <errno.h>
14#include <fcntl.h>
15#include <stdio.h>
16#include <stdlib.h>
Willy Tarreau2dd0d472006-06-29 17:53:05 +020017#include <string.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020018
19#include <sys/socket.h>
20#include <sys/stat.h>
21#include <sys/types.h>
22
Willy Tarreau2dd0d472006-06-29 17:53:05 +020023#include <common/compat.h>
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020024#include <common/config.h>
Willy Tarreau2dd0d472006-06-29 17:53:05 +020025#include <common/time.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020026
Willy Tarreaubaaee002006-06-26 02:48:02 +020027#include <types/global.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020028
Willy Tarreau8797c062007-05-07 00:55:35 +020029#include <proto/acl.h>
Willy Tarreau54469402006-07-29 16:59:06 +020030#include <proto/buffers.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020031#include <proto/fd.h>
Willy Tarreau03fa5df2010-05-24 21:02:37 +020032#include <proto/frontend.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020033#include <proto/log.h>
Willy Tarreaue5f20dc2006-12-03 15:21:35 +010034#include <proto/hdr_idx.h>
Willy Tarreau9650f372009-08-16 14:02:45 +020035#include <proto/proto_tcp.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020036#include <proto/proto_http.h>
Willy Tarreau7f062c42009-03-05 18:43:00 +010037#include <proto/proxy.h>
Willy Tarreauc6ca1a02007-05-13 19:43:47 +020038#include <proto/session.h>
Willy Tarreaudded32d2008-11-30 19:48:07 +010039#include <proto/stream_interface.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020040#include <proto/stream_sock.h>
41#include <proto/task.h>
42
43
Willy Tarreau14c8aac2007-05-08 19:46:30 +020044/* Retrieves the original destination address used by the client, and sets the
45 * SN_FRT_ADDR_SET flag.
46 */
47void get_frt_addr(struct session *s)
48{
49 socklen_t namelen = sizeof(s->frt_addr);
50
Willy Tarreau7e5067d2008-12-07 16:27:56 +010051 if (get_original_dst(s->si[0].fd, (struct sockaddr_in *)&s->frt_addr, &namelen) == -1)
52 getsockname(s->si[0].fd, (struct sockaddr *)&s->frt_addr, &namelen);
Willy Tarreau14c8aac2007-05-08 19:46:30 +020053 s->flags |= SN_FRT_ADDR_SET;
54}
Willy Tarreaubaaee002006-06-26 02:48:02 +020055
Willy Tarreau81f9aa32010-06-01 17:45:26 +020056/* Finish a session accept() for a proxy (TCP or HTTP). It returns a negative
57 * value in case of failure, a positive value in case of success, or zero if
58 * it is a success but the session must be closed ASAP.
Willy Tarreaubaaee002006-06-26 02:48:02 +020059 */
Willy Tarreau81f9aa32010-06-01 17:45:26 +020060int frontend_accept(struct session *s)
Willy Tarreaueb472682010-05-28 18:46:57 +020061{
Willy Tarreau81f9aa32010-06-01 17:45:26 +020062 int cfd = s->si[0].fd;
Emeric Brunb982a3d2010-01-04 15:45:53 +010063
Willy Tarreaueb472682010-05-28 18:46:57 +020064 tv_zero(&s->logs.tv_request);
65 s->logs.t_queue = -1;
66 s->logs.t_connect = -1;
67 s->logs.t_data = -1;
68 s->logs.t_close = 0;
69 s->logs.bytes_in = s->logs.bytes_out = 0;
70 s->logs.prx_queue_size = 0; /* we get the number of pending conns before us */
71 s->logs.srv_queue_size = 0; /* we will get this number soon */
Willy Tarreaubaaee002006-06-26 02:48:02 +020072
Willy Tarreau35a09942010-06-01 17:12:40 +020073 s->data_state = DATA_ST_INIT;
Willy Tarreaueb472682010-05-28 18:46:57 +020074 s->data_source = DATA_SRC_NONE;
Willy Tarreaua5555ec2008-11-30 19:02:32 +010075
Willy Tarreau35a09942010-06-01 17:12:40 +020076 /* FIXME: the logs are horribly complicated now, because they are
77 * defined in <p>, <p>, and later <be> and <be>.
Willy Tarreaueb472682010-05-28 18:46:57 +020078 */
Willy Tarreau35a09942010-06-01 17:12:40 +020079 if (s->logs.logwait & LW_REQ)
80 s->do_log = http_sess_log;
81 else
82 s->do_log = tcp_sess_log;
83
84 /* default error reporting function, may be changed by analysers */
85 s->srv_error = default_srv_error;
Willy Tarreaubaaee002006-06-26 02:48:02 +020086
Willy Tarreauf67c9782010-05-23 22:59:00 +020087 /* Adjust some socket options */
Willy Tarreau35a09942010-06-01 17:12:40 +020088 if (unlikely(setsockopt(cfd, IPPROTO_TCP, TCP_NODELAY, (char *) &one, sizeof(one)) == -1)) {
Willy Tarreauf67c9782010-05-23 22:59:00 +020089 Alert("accept(): cannot set the socket in non blocking mode. Giving up\n");
Willy Tarreau35a09942010-06-01 17:12:40 +020090 goto out_delete_cfd;
Willy Tarreauf67c9782010-05-23 22:59:00 +020091 }
92
Willy Tarreau81f9aa32010-06-01 17:45:26 +020093 if (s->fe->options & PR_O_TCP_CLI_KA)
Willy Tarreauf67c9782010-05-23 22:59:00 +020094 setsockopt(cfd, SOL_SOCKET, SO_KEEPALIVE, (char *) &one, sizeof(one));
95
Willy Tarreau81f9aa32010-06-01 17:45:26 +020096 if (s->fe->options & PR_O_TCP_NOLING)
Willy Tarreauf67c9782010-05-23 22:59:00 +020097 setsockopt(cfd, SOL_SOCKET, SO_LINGER, (struct linger *) &nolinger, sizeof(struct linger));
98
99 if (global.tune.client_sndbuf)
100 setsockopt(cfd, SOL_SOCKET, SO_SNDBUF, &global.tune.client_sndbuf, sizeof(global.tune.client_sndbuf));
101
102 if (global.tune.client_rcvbuf)
103 setsockopt(cfd, SOL_SOCKET, SO_RCVBUF, &global.tune.client_rcvbuf, sizeof(global.tune.client_rcvbuf));
104
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200105 if (s->fe->mode == PR_MODE_HTTP) {
Willy Tarreaueb472682010-05-28 18:46:57 +0200106 /* the captures are only used in HTTP frontends */
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200107 if (unlikely(s->fe->nb_req_cap > 0 &&
108 (s->txn.req.cap = pool_alloc2(s->fe->req_cap_pool)) == NULL))
Willy Tarreau35a09942010-06-01 17:12:40 +0200109 goto out_delete_cfd; /* no memory */
Willy Tarreaubaaee002006-06-26 02:48:02 +0200110
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200111 if (unlikely(s->fe->nb_rsp_cap > 0 &&
112 (s->txn.rsp.cap = pool_alloc2(s->fe->rsp_cap_pool)) == NULL))
Willy Tarreau35a09942010-06-01 17:12:40 +0200113 goto out_free_reqcap; /* no memory */
Willy Tarreaueb472682010-05-28 18:46:57 +0200114 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200115
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200116 if (s->fe->acl_requires & ACL_USE_L7_ANY) {
Willy Tarreaueb472682010-05-28 18:46:57 +0200117 /* we have to allocate header indexes only if we know
118 * that we may make use of them. This of course includes
119 * (mode == PR_MODE_HTTP).
Willy Tarreau042cc792007-03-19 16:20:06 +0100120 */
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200121 s->txn.hdr_idx.size = MAX_HTTP_HDR;
Willy Tarreau45e73e32006-12-17 00:05:15 +0100122
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200123 if (unlikely((s->txn.hdr_idx.v = pool_alloc2(s->fe->hdr_idx_pool)) == NULL))
Willy Tarreau35a09942010-06-01 17:12:40 +0200124 goto out_free_rspcap; /* no memory */
Willy Tarreau45e73e32006-12-17 00:05:15 +0100125
Willy Tarreaueb472682010-05-28 18:46:57 +0200126 /* and now initialize the HTTP transaction state */
127 http_init_txn(s);
128 }
Willy Tarreaue5f20dc2006-12-03 15:21:35 +0100129
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200130 if ((s->fe->mode == PR_MODE_TCP || s->fe->mode == PR_MODE_HTTP)
131 && (s->fe->logfac1 >= 0 || s->fe->logfac2 >= 0)) {
132 if (likely(s->fe->to_log)) {
Willy Tarreaueb472682010-05-28 18:46:57 +0200133 /* we have the client ip */
134 if (s->logs.logwait & LW_CLIP)
135 if (!(s->logs.logwait &= ~LW_CLIP))
136 s->do_log(s);
Willy Tarreaua3445fc2010-05-20 16:17:07 +0200137 }
Willy Tarreaueb472682010-05-28 18:46:57 +0200138 else if (s->cli_addr.ss_family == AF_INET) {
139 char pn[INET_ADDRSTRLEN], sn[INET_ADDRSTRLEN];
Willy Tarreau14c8aac2007-05-08 19:46:30 +0200140
Willy Tarreaueb472682010-05-28 18:46:57 +0200141 if (!(s->flags & SN_FRT_ADDR_SET))
142 get_frt_addr(s);
Willy Tarreau14c8aac2007-05-08 19:46:30 +0200143
Willy Tarreaueb472682010-05-28 18:46:57 +0200144 if (inet_ntop(AF_INET, (const void *)&((struct sockaddr_in *)&s->frt_addr)->sin_addr,
145 sn, sizeof(sn)) &&
146 inet_ntop(AF_INET, (const void *)&((struct sockaddr_in *)&s->cli_addr)->sin_addr,
147 pn, sizeof(pn))) {
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200148 send_log(s->fe, LOG_INFO, "Connect from %s:%d to %s:%d (%s/%s)\n",
Willy Tarreaueb472682010-05-28 18:46:57 +0200149 pn, ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port),
150 sn, ntohs(((struct sockaddr_in *)&s->frt_addr)->sin_port),
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200151 s->fe->id, (s->fe->mode == PR_MODE_HTTP) ? "HTTP" : "TCP");
Willy Tarreaubaaee002006-06-26 02:48:02 +0200152 }
153 }
Willy Tarreaueb472682010-05-28 18:46:57 +0200154 else {
155 char pn[INET6_ADDRSTRLEN], sn[INET6_ADDRSTRLEN];
Willy Tarreau14c8aac2007-05-08 19:46:30 +0200156
157 if (!(s->flags & SN_FRT_ADDR_SET))
158 get_frt_addr(s);
Willy Tarreaubaaee002006-06-26 02:48:02 +0200159
Willy Tarreaueb472682010-05-28 18:46:57 +0200160 if (inet_ntop(AF_INET6, (const void *)&((struct sockaddr_in6 *)&s->frt_addr)->sin6_addr,
161 sn, sizeof(sn)) &&
162 inet_ntop(AF_INET6, (const void *)&((struct sockaddr_in6 *)&s->cli_addr)->sin6_addr,
163 pn, sizeof(pn))) {
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200164 send_log(s->fe, LOG_INFO, "Connect from %s:%d to %s:%d (%s/%s)\n",
Willy Tarreaueb472682010-05-28 18:46:57 +0200165 pn, ntohs(((struct sockaddr_in6 *)&s->cli_addr)->sin6_port),
166 sn, ntohs(((struct sockaddr_in6 *)&s->frt_addr)->sin6_port),
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200167 s->fe->id, (s->fe->mode == PR_MODE_HTTP) ? "HTTP" : "TCP");
Willy Tarreaubaaee002006-06-26 02:48:02 +0200168 }
Willy Tarreaueb472682010-05-28 18:46:57 +0200169 }
170 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200171
Willy Tarreau2281b7f2010-05-28 19:29:49 +0200172 if (unlikely((global.mode & MODE_DEBUG) && (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)))) {
Willy Tarreaueb472682010-05-28 18:46:57 +0200173 int len;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200174
Willy Tarreaueb472682010-05-28 18:46:57 +0200175 if (!(s->flags & SN_FRT_ADDR_SET))
176 get_frt_addr(s);
Willy Tarreaubaaee002006-06-26 02:48:02 +0200177
Willy Tarreaueb472682010-05-28 18:46:57 +0200178 if (s->cli_addr.ss_family == AF_INET) {
179 char pn[INET_ADDRSTRLEN];
180 inet_ntop(AF_INET,
181 (const void *)&((struct sockaddr_in *)&s->cli_addr)->sin_addr,
182 pn, sizeof(pn));
Willy Tarreaubaaee002006-06-26 02:48:02 +0200183
Willy Tarreaueb472682010-05-28 18:46:57 +0200184 len = sprintf(trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n",
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200185 s->uniq_id, s->fe->id, (unsigned short)s->listener->fd, (unsigned short)cfd,
Willy Tarreaueb472682010-05-28 18:46:57 +0200186 pn, ntohs(((struct sockaddr_in *)&s->cli_addr)->sin_port));
187 }
188 else {
189 char pn[INET6_ADDRSTRLEN];
190 inet_ntop(AF_INET6,
191 (const void *)&((struct sockaddr_in6 *)(&s->cli_addr))->sin6_addr,
192 pn, sizeof(pn));
Willy Tarreaufa7e1022008-10-19 07:30:41 +0200193
Willy Tarreaueb472682010-05-28 18:46:57 +0200194 len = sprintf(trash, "%08x:%s.accept(%04x)=%04x from [%s:%d]\n",
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200195 s->uniq_id, s->fe->id, (unsigned short)s->listener->fd, (unsigned short)cfd,
Willy Tarreaueb472682010-05-28 18:46:57 +0200196 pn, ntohs(((struct sockaddr_in6 *)(&s->cli_addr))->sin6_port));
197 }
Willy Tarreau9a2d1542008-08-30 12:31:07 +0200198
Willy Tarreaueb472682010-05-28 18:46:57 +0200199 write(1, trash, len);
200 }
Willy Tarreaubaaee002006-06-26 02:48:02 +0200201
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200202 if (s->fe->mode == PR_MODE_HTTP)
Willy Tarreaueb472682010-05-28 18:46:57 +0200203 s->req->flags |= BF_READ_DONTWAIT; /* one read is usually enough */
Willy Tarreaubaaee002006-06-26 02:48:02 +0200204
Willy Tarreaueb472682010-05-28 18:46:57 +0200205 /* note: this should not happen anymore since there's always at least the switching rules */
206 if (!s->req->analysers) {
207 buffer_auto_connect(s->req); /* don't wait to establish connection */
208 buffer_auto_close(s->req); /* let the producer forward close requests */
209 }
Willy Tarreaud7971282006-07-29 18:36:34 +0200210
Willy Tarreaueb472682010-05-28 18:46:57 +0200211 s->req->rto = s->fe->timeout.client;
Willy Tarreaueb472682010-05-28 18:46:57 +0200212 s->rep->wto = s->fe->timeout.client;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200213
Willy Tarreaueb472682010-05-28 18:46:57 +0200214 fdtab[cfd].flags = FD_FL_TCP | FD_FL_TCP_NODELAY;
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200215 if (s->fe->options & PR_O_TCP_NOLING)
Willy Tarreaueb472682010-05-28 18:46:57 +0200216 fdtab[cfd].flags |= FD_FL_TCP_NOLING;
Willy Tarreau6e6fb2b2009-08-16 18:20:44 +0200217
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200218 if (unlikely((s->fe->mode == PR_MODE_HTTP && (s->flags & SN_MONITOR)) ||
219 (s->fe->mode == PR_MODE_HEALTH && (s->fe->options & PR_O_HTTP_CHK)))) {
Willy Tarreaueb472682010-05-28 18:46:57 +0200220 /* Either we got a request from a monitoring system on an HTTP instance,
221 * or we're in health check mode with the 'httpchk' option enabled. In
222 * both cases, we return a fake "HTTP/1.0 200 OK" response and we exit.
223 */
224 struct chunk msg;
225 chunk_initstr(&msg, "HTTP/1.0 200 OK\r\n\r\n");
226 stream_int_retnclose(&s->si[0], &msg); /* forge a 200 response */
227 s->req->analysers = 0;
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200228 s->task->expire = s->rep->wex;
Willy Tarreau35a09942010-06-01 17:12:40 +0200229 EV_FD_CLR(cfd, DIR_RD);
Willy Tarreaueb472682010-05-28 18:46:57 +0200230 }
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200231 else if (unlikely(s->fe->mode == PR_MODE_HEALTH)) { /* health check mode, no client reading */
Willy Tarreaueb472682010-05-28 18:46:57 +0200232 struct chunk msg;
233 chunk_initstr(&msg, "OK\n");
234 stream_int_retnclose(&s->si[0], &msg); /* forge an "OK" response */
235 s->req->analysers = 0;
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200236 s->task->expire = s->rep->wex;
Willy Tarreau35a09942010-06-01 17:12:40 +0200237 EV_FD_CLR(cfd, DIR_RD);
Willy Tarreaueb472682010-05-28 18:46:57 +0200238 }
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200239 /* everything's OK, let's go on */
Willy Tarreaueb472682010-05-28 18:46:57 +0200240 return 1;
Willy Tarreau8ced9a42007-11-04 17:51:50 +0100241
242 /* Error unrolling */
Willy Tarreau35a09942010-06-01 17:12:40 +0200243 out_free_rspcap:
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200244 pool_free2(s->fe->rsp_cap_pool, s->txn.rsp.cap);
Willy Tarreau35a09942010-06-01 17:12:40 +0200245 out_free_reqcap:
Willy Tarreau81f9aa32010-06-01 17:45:26 +0200246 pool_free2(s->fe->req_cap_pool, s->txn.req.cap);
Willy Tarreau35a09942010-06-01 17:12:40 +0200247 out_delete_cfd:
248 fd_delete(cfd);
Willy Tarreaueb472682010-05-28 18:46:57 +0200249 return -1;
Willy Tarreaubaaee002006-06-26 02:48:02 +0200250}
251
Willy Tarreau645513a2010-05-24 20:55:15 +0200252/* set test->i to the id of the frontend */
Willy Tarreaud41f8d82007-06-10 10:06:18 +0200253static int
Willy Tarreau645513a2010-05-24 20:55:15 +0200254acl_fetch_fe_id(struct proxy *px, struct session *l4, void *l7, int dir,
255 struct acl_expr *expr, struct acl_test *test) {
Willy Tarreau662b2d82007-05-08 19:56:15 +0200256
Willy Tarreau662b2d82007-05-08 19:56:15 +0200257 test->flags = ACL_TEST_F_READ_ONLY;
Willy Tarreau662b2d82007-05-08 19:56:15 +0200258
Willy Tarreau645513a2010-05-24 20:55:15 +0200259 test->i = l4->fe->uuid;
Willy Tarreau662b2d82007-05-08 19:56:15 +0200260
Emeric Brun5d16eda2010-01-04 15:47:45 +0100261 return 1;
262}
263
Willy Tarreau645513a2010-05-24 20:55:15 +0200264/* set test->i to the number of connections per second reaching the frontend */
Willy Tarreaud41f8d82007-06-10 10:06:18 +0200265static int
Willy Tarreau645513a2010-05-24 20:55:15 +0200266acl_fetch_fe_sess_rate(struct proxy *px, struct session *l4, void *l7, int dir,
267 struct acl_expr *expr, struct acl_test *test)
Willy Tarreau662b2d82007-05-08 19:56:15 +0200268{
Willy Tarreau645513a2010-05-24 20:55:15 +0200269 test->flags = ACL_TEST_F_VOL_TEST;
270 if (expr->arg_len) {
271 /* another proxy was designated, we must look for it */
272 for (px = proxy; px; px = px->next)
273 if ((px->cap & PR_CAP_FE) && !strcmp(px->id, expr->arg.str))
274 break;
275 }
276 if (!px)
277 return 0;
Emeric Brun5d16eda2010-01-04 15:47:45 +0100278
Willy Tarreau645513a2010-05-24 20:55:15 +0200279 test->i = read_freq_ctr(&px->fe_sess_per_sec);
Emeric Brun5d16eda2010-01-04 15:47:45 +0100280 return 1;
281}
Alexandre Cassen5eb1a902007-11-29 15:43:32 +0100282
Willy Tarreau645513a2010-05-24 20:55:15 +0200283/* set test->i to the number of concurrent connections on the frontend */
Willy Tarreaud41f8d82007-06-10 10:06:18 +0200284static int
Willy Tarreau645513a2010-05-24 20:55:15 +0200285acl_fetch_fe_conn(struct proxy *px, struct session *l4, void *l7, int dir,
286 struct acl_expr *expr, struct acl_test *test)
Willy Tarreau8797c062007-05-07 00:55:35 +0200287{
Willy Tarreau645513a2010-05-24 20:55:15 +0200288 test->flags = ACL_TEST_F_VOL_TEST;
289 if (expr->arg_len) {
290 /* another proxy was designated, we must look for it */
291 for (px = proxy; px; px = px->next)
292 if ((px->cap & PR_CAP_FE) && !strcmp(px->id, expr->arg.str))
293 break;
294 }
295 if (!px)
296 return 0;
Krzysztof Piotr Oledzki346f76d2010-01-12 21:59:30 +0100297
Willy Tarreau645513a2010-05-24 20:55:15 +0200298 test->i = px->feconn;
Krzysztof Piotr Oledzki346f76d2010-01-12 21:59:30 +0100299 return 1;
300}
301
Willy Tarreau8797c062007-05-07 00:55:35 +0200302
303/* Note: must not be declared <const> as its list will be overwritten */
304static struct acl_kw_list acl_kws = {{ },{
Willy Tarreau645513a2010-05-24 20:55:15 +0200305 { "fe_id", acl_parse_int, acl_fetch_fe_id, acl_match_int, ACL_USE_NOTHING },
306 { "fe_sess_rate", acl_parse_int, acl_fetch_fe_sess_rate, acl_match_int, ACL_USE_NOTHING },
307 { "fe_conn", acl_parse_int, acl_fetch_fe_conn, acl_match_int, ACL_USE_NOTHING },
Willy Tarreau8797c062007-05-07 00:55:35 +0200308 { NULL, NULL, NULL, NULL },
309}};
310
311
312__attribute__((constructor))
Willy Tarreau03fa5df2010-05-24 21:02:37 +0200313static void __frontend_init(void)
Willy Tarreau8797c062007-05-07 00:55:35 +0200314{
315 acl_register_keywords(&acl_kws);
316}
317
318
Willy Tarreaubaaee002006-06-26 02:48:02 +0200319/*
320 * Local variables:
321 * c-indent-level: 8
322 * c-basic-offset: 8
323 * End:
324 */