blob: 6e6472e6fa2a9097ca9a3a229819f9b599c0fcfc [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
2 include/types/proto_http.h
3 This file contains HTTP protocol definitions.
4
5 Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
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
22#ifndef _TYPES_PROTO_HTTP_H
23#define _TYPES_PROTO_HTTP_H
24
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020025#include <common/config.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020026
27/*
28 * FIXME: break this into HTTP state and TCP socket state.
29 * See server.h for the other end.
30 */
31
32/* different possible states for the client side */
33#define CL_STHEADERS 0
34#define CL_STDATA 1
35#define CL_STSHUTR 2
36#define CL_STSHUTW 3
37#define CL_STCLOSE 4
38
39/*
40 * FIXME: break this into HTTP state and TCP socket state.
41 * See client.h for the other end.
42 */
43
44/* different possible states for the server side */
45#define SV_STIDLE 0
46#define SV_STCONN 1
47#define SV_STHEADERS 2
48#define SV_STDATA 3
49#define SV_STSHUTR 4
50#define SV_STSHUTW 5
51#define SV_STCLOSE 6
52
53
Willy Tarreau58f10d72006-12-04 02:26:12 +010054/* Possible states while parsing HTTP messages (request|response) */
55#define HTTP_PA_EMPTY 0 /* leading LF, before start line */
56#define HTTP_PA_START 1 /* inside start line */
57#define HTTP_PA_STRT_LF 2 /* LF after start line */
58#define HTTP_PA_HEADER 3 /* inside a header */
59#define HTTP_PA_HDR_LF 4 /* LF after a header */
60#define HTTP_PA_HDR_LWS 5 /* LWS after a header */
61#define HTTP_PA_LFLF 6 /* after double LF/CRLF at the end of headers */
62#define HTTP_PA_ERROR 7 /* syntax error in the message */
63#define HTTP_PA_CR_SKIP 0x10 /* ORed with other values when a CR was skipped */
64#define HTTP_PA_LF_EXP 0x20 /* ORed with other values when a CR is seen and
65 * an LF is expected before entering the
66 * designated state. */
67
68
Willy Tarreaubaaee002006-06-26 02:48:02 +020069#endif /* _TYPES_PROTO_HTTP_H */
70
71/*
72 * Local variables:
73 * c-indent-level: 8
74 * c-basic-offset: 8
75 * End:
76 */